Jump to content

Is it possible...


joesaddigh

Recommended Posts

Consider the below code:

 

$message = 'Upload Successful';

	//Close the connection to the database	
	mysql_close($conn);
	header("Location: add_school_photo_form.php? message=$message");
	exit();

 

Can I pass through multiple values here. For example

 

message=$message, schoolid=$schoolid

 

When I have done the above example the result is get is as follows

 

Upload Successful, schoolid=83

 

So it is working to a certain extent. However I am only printing out the

echo $_GET['message']; so it is like they have been merged together. I know I could then use some sort of String function to seperate. Is there an easier way so that I have it as to different variables?

 

For example

echo $_GET['message'];  would print Upload Successful

echo $_GET['schoolid'];  would print 83

 

 

Thanks,

 

Joe

 

 

Link to comment
https://forums.phpfreaks.com/topic/193260-is-it-possible/
Share on other sites

Yes, it is, you need to use an ampersand as a seperator for tyhe get variables.

$message = 'Upload Successful';
      
      //Close the connection to the database   
      mysql_close($conn);
      header("Location: add_school_photo_form.php?message={$message}&schoolid={$schoolid}");
      exit();

Link to comment
https://forums.phpfreaks.com/topic/193260-is-it-possible/#findComment-1017600
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.