| | |
need help using links like test.php3?id=2
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2004
Posts: 3
Reputation:
Solved Threads: 0
I have been tring for a month now to figure out why I can't program my site to open field information from a link that looks like http://www.blablabla.com/test.php3?ID=2
I can't seem to figure out how to open just the field thats ID is = to 2.
If anyone can help I would be greatful. Thank you.
-Specdro
I can't seem to figure out how to open just the field thats ID is = to 2.
If anyone can help I would be greatful. Thank you.
-Specdro
•
•
•
•
Originally Posted by Specdro
I have been tring for a month now to figure out why I can't program my site to open field information from a link that looks like http://www.blablabla.com/test.php3?ID=2
I can't seem to figure out how to open just the field thats ID is = to 2.
If anyone can help I would be greatful. Thank you.
-Specdro
Ben
Application development, webhosting, and much more: www.webcentric-hosting.com
•
•
Join Date: Jul 2004
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by liliafan
How are you trying to access the data? Do you have a code example?
Ben
[php]$query = "SELECT * FROM mobsters";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
echo "<li><font face=verdana size=-2><b><a href=http://www.mafia-files.com/test2.php3?ID=$row[ID]><?$row[Name]
</td></tr><tr><td>";
}
?>[/php]
Last edited by cscgal; Jun 10th, 2006 at 11:54 pm.
From the look of the code on the next page:
Should work.
HTH
Ben
PHP Syntax (Toggle Plain Text)
<?php echo $ID; ?>
Should work.
HTH
Ben
Application development, webhosting, and much more: www.webcentric-hosting.com
What code are you actually using to fetch the ID on the next page?
Ben
Ben
Application development, webhosting, and much more: www.webcentric-hosting.com
•
•
Join Date: Jul 2004
Posts: 11
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by huwgomez
Try this as the query on ur second page. worked for me. (Got this off Roberdin)
$query = "SELECT * FROM mobsters where ID='{$_GET['ID']}'";
Huw.
[PHP]
$pageID = $_GET['ID'];
if(is_numeric($pageID) && $pageID > 0) {
$pageID = round($pageID);
$query = "SELECT * FROM mobsters where ID='{$_GET['ID']}'";
}
else {
print("Invalid Page ID");
}
[/PHP]
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Solved Threads: 0
I think he means how to access it..You would do this:
PHP Syntax (Toggle Plain Text)
$id = $_REQUEST["id"];
![]() |
Other Threads in the PHP Forum
- Previous Thread: Please Help me
- Next Thread: You have not selected search details.
| Thread Tools | Search this Thread |
advanced ajax apache api array basics beginner binary broken cakephp check checkbox class cms code combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert integration ip java javascript job joomla js limit link login loop mail menu mlm multiple mysql oop parse password paypal pdf php problem procedure query radio random recursion regex remote script search server sessions smarty smash sms soap source space sql stored syntax system table traffic tutorial unicode update upload url validator variable video web xml youtube





