Jump to content

a question on IFs


hosseind600

Recommended Posts

hi

i have a form. if user selected private i want the form to be sent to table private

else the data should be sent to normals table

 

	<?php 
			include ('connection.php') ;
			$name = $_GET['name'];
			$r = rand();
			$q = $_GET['q'] ;
			include ("PersianDate.Class.php");
			$pd = new PersianDate;
			date_default_timezone_set('Asia/Tehran');
			$pd2 = $pd->Date("y/m/d") ;
			$p = $_GET['pri'] ;
			if ($p == 1) {
			$sql1 = "insert into private (id,name,question,date,code) values (NULL,'$name','$q','$pd2','$r')" ;
	        mysql_query($sql1);
	        }
                  else {
			$sql3 = "insert into normals (id,name,question,date,code) values (NULL,'$name','$q','$pd2','$r')";
			mysql_query($sql3);
			}
			?>

 

where is my problem

Link to comment
https://forums.phpfreaks.com/topic/145974-a-question-on-ifs/
Share on other sites

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.