Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Server-Side Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-10-2008, 11:13 AM
Member
 
Join Date: Aug 2005
Posts: 88
Default Help with function

I have a function

Code:
$query = sprintf("INSERT INTO table (field1, field2) VALUES ('$_POST[value1]','$_POST[value2]')");
if (!mysql_query($query)) {
header ("Location: "page1.php");
}
else {
header ("Location: "page2.php");
}
I would like to post the value1 and value2 to page2.php when the header is executed.
How would I do this?
__________________
__________________
md
AskAGeek.com - Where geeks answer your computer and tech questions.
Ann-Lindsey.com - My Wife's Budget Fashion and Shopping Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-11-2008, 11:50 AM
BigAlReturns's Avatar
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 291
Send a message via MSN to BigAlReturns
Default

Unfortunately you can't do this with $_POST, so you have two options.
1) Append the values onto the URL you're redirecting to, i.e. page1.php?val1=$_POST['value1'] etc., then access them with$_GET on the next page
2) Use sessions to store them
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i ... skat Server-Side Scripting 10 12-23-2007 04:27 PM
Javascript Inheritance and Scope SavedLinuXgeeK Server-Side Scripting 0 08-27-2006 09:55 AM


All times are GMT -5. The time now is 02:07 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.