Please help,
I keep thinking I'm on the right track, but can't quite seem to get the hang of this. All I want to do is pass a variable to PHP from a URL. I know it can't be hard, but just can't quite make sense of it.
Here's my URL:
Here's the PHP:
<?php
mysql_connect('localhost', 'account', 'password') or die("Failed to connect to database");
mysql_select_db('the_db') or die("no such database");
function display_db_table() {
echo$query = $query;
$query_string = "select type,url,note,submitter from weblinks1 where type = $query";
$result_id = mysql_query($query_string);
$column_count = mysql_num_fields($result_id);
print("<TABLE CELLPADDING=0 BORDER=0>\n");
while ($row = mysql_fetch_row($result_id)) {
print("<TR ALIGN-LEFT VALIGN=TOP>");
print("<TD CLASS=table1>$row[0]</TD>\n");
print("<TD CLASS=table1><a CLASS=3 href='http://$row[1]'>$row[1]</a></TD>\n");
print("<TD CLASS=table1>$row[2]</TD>\n");
print("<TD CLASS=table1>$row[3]</TD>\n");
print("</TR>\n");
}
print("</TABLE>\n");
}
?>
<HEAD>
<TITLE>the title</TITLE>
some style sheets stuff here to control text formatting
</HEAD>
<BODY>
<?php display_db_table("weblinks1"); ?>
<br><a CLASS=3 href="http://www.website.net/php/weblinks1_entry.php3">submit form</a>
<br><?php echo$query; ?>
</BODY>
========================================
I know that this is one of the most basic of PHP functions, but I've studied two books, this forum, and all sorts of docs, and still can't get it through my head. What am I missing here?
Thanks!