Jump to content

quick question regarding GET


jbrill

Recommended Posts

if i have this:

$update = "UPDATE guestbook SET actual_time='".$_POST['actual_time']."',cat='".$_POST['cat']."', subcat='".$_POST['subcat']."',machine_time='".$_POST['machine_time']."', setup='".$_POST['setup']."', notes='".$_POST['notes']."' WHERE id='".$_GET['idr']."'";


echo $update."<br>";
mysql_query($update);

echo "<table align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\" class=\"tableoutline\">
<tr>
<td class=\"success\">";
echo "Step Was Updated Successfuly!</td></tr></table>";

 

 

i would like, upon success,  to forward to modjob.php where idr = id and table = jobs

 

could someone please write this for me?

 

Link to comment
https://forums.phpfreaks.com/topic/58781-quick-question-regarding-get/
Share on other sites

You are taking raw data directly from $_POST and $_GET and inserting it into your database.

 

$update = "UPDATE guestbook SET actual_time='".$_POST['actual_time'] . "...";

 

What happens if I enter the following in your actual_time field:

NULL; DELETE * FROM guestbook WHERE 1;

 

Your SQL query then becomes:

UPDATE guestbook SET actual_time=NULL; DELETE * FROM guestbook WHERE 1;

 

It would take some experimenting and knowledge about your site to get that far, but careless programming makes that kind of information easy to retrieve.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.