Yesideez Posted December 2, 2006 Share Posted December 2, 2006 Just been playing with something new...I've got a script to read a text box in a form and the menu is comprising of buttons rather than standard links. When a menu button is selected the script reads the text box and stores the contents in a variable. Depending on which menu button is clicked I need to pass the contents of the variable to another script using header("Location: ???.php");I've tried this:[code]$_POST['textbox']=$_POST['textbox'];[/code]But it doesn't work - hope you know what I mean - any ideas?The contents of the text box must not be carried in the URL or a session variable. Link to comment https://forums.phpfreaks.com/topic/29245-passing-data-via-post-through-forms/ Share on other sites More sharing options...
taith Posted December 2, 2006 Share Posted December 2, 2006 $_POST is a read only variable... the only way you can write in them, is through a submited form. you'd need to use[code]$textbox=$_POST['textbox'];[/code] Link to comment https://forums.phpfreaks.com/topic/29245-passing-data-via-post-through-forms/#findComment-134036 Share on other sites More sharing options...
Yesideez Posted December 2, 2006 Author Share Posted December 2, 2006 Yes I've got that earlier in the script already, was just wondering if there was any way of assigning my own data into $_POST - seems not :( Link to comment https://forums.phpfreaks.com/topic/29245-passing-data-via-post-through-forms/#findComment-134039 Share on other sites More sharing options...
kenrbnsn Posted December 2, 2006 Share Posted December 2, 2006 [quote]The contents of the text box must not be carried in the URL or a session variable.[/quote]Why can't you use sessions? That's the logical way of doing this.Ken Link to comment https://forums.phpfreaks.com/topic/29245-passing-data-via-post-through-forms/#findComment-134078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.