View Full Version : Edit form
Johnnikins
13-08-2008, 11:39 PM
I have an ad management script already, i have a working form, but i am wanting to make this form
http://www.habboxforum.com/showthread.php?t=508217
into a edit form, so when i go to say
http://mysite.com/edit.php?RefNum=124515125
it would come up so that i can edit the information
Any help
Thanks, John
Calon
14-08-2008, 06:51 AM
I have an ad management script already, i have a working form, but i am wanting to make this form
http://www.habboxforum.com/showthread.php?t=508217
into a edit form, so when i go to say
http://mysite.com/edit.php?RefNum=124515125
it would come up so that i can edit the information
Any help
Thanks, John
You can easily do it with $_GET
Decode
14-08-2008, 11:41 AM
Use this-
<?php
$refnum = addslashes ( $_GET['RefNum'] );
$query = mysql_query (" SELECT * FROM $db_table WHERE RefNum = '$refnum' ");
if ( $mysql_affected_rows == "1" ) {
$data = mysql_fetch_assoc ( $query );
echo "Site: " . $data['Site'] . "<br \>";
echo "Contact: " . $data['Contact'] . "<br \>";
}
else {
echo $refnum . "doesn't exist";
}
?>
Where is says-
echo "Site: " . $data['Site'] . "<br \>";
-you can change it to any col name to show the data from it.
Johnnikins
15-08-2008, 01:41 AM
thanks for that, i've tried and tried to get this working but it will not work :(
it keeps saying refnum not found although it is there, and my db info is correct
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.