Matt79 Posted February 16, 2009 Share Posted February 16, 2009 What I am trying to do is make it so when a user submits a forum I can take it and process it in one file then have php "auto submit" or something like that it back to another page to view. Kind of like when you login into a email account you do not have to add the "yahoo.com" on the end of your email. I want to add it automatically. thanks for any info, Matt Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/ Share on other sites More sharing options...
drisate Posted February 16, 2009 Share Posted February 16, 2009 I am not sur i understand your question ... but you could use sessions to transfer the data to an other page ... or if your realy wana "submit" as $_POST you can use JavaScript ... session_start(); $_SESSION[what_ever] = $_POST[what_ever]; Then you can use $_SESSION[what_ever] in any pages starting by session_start(); When your done using those data you can do a session_destroy(); to delete them. (They will be deleted anyway after 30 min) Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763566 Share on other sites More sharing options...
Matt79 Posted February 16, 2009 Author Share Posted February 16, 2009 ok basically I want to add "@test.info" at the end of a user name that someone submits. So if I put Matt79 in a input box and submit it, php will make it [email protected]. It will then automatically submit it to a email database (or another webpage). Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763574 Share on other sites More sharing options...
drisate Posted February 16, 2009 Share Posted February 16, 2009 oh $email = $_POST[username]."@test.info"; $INSERT= mysql_query("ISERT INTO table ('email') VALUE ('$email)") or die (mysql_error()); To insert that into a session you only use the code i gave you above. That will make the email available in every pages. Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763581 Share on other sites More sharing options...
allworknoplay Posted February 16, 2009 Share Posted February 16, 2009 What you should do is create a function to first test for valid email. If say someone put in "[email protected]" you don't want your script to automatically add "@test.info" So you will end up with "[email protected]@test.nfo" So check for that first, if it's just a regular name, then you can add the email part.... Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763587 Share on other sites More sharing options...
drisate Posted February 16, 2009 Share Posted February 16, 2009 Thats a very good idea. STRSTR would be what your looking for. http://ca3.php.net/strstr Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763589 Share on other sites More sharing options...
Matt79 Posted February 16, 2009 Author Share Posted February 16, 2009 Thanks for the replies, but I still am not seeing a way to create what I need. I need to have the user name with the @test.info added to the end. I know that I can do this like $name= "$_POST['username'].'@test.info'"; Now I could just echo $name; but I need to automatically send the $name to another webpage without me having to manually press submit. thanks Matt79 Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763602 Share on other sites More sharing options...
drisate Posted February 16, 2009 Share Posted February 16, 2009 You would do that using JavaScript document.myform.submit(); For more info go on the JavaScript board ;-) Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763606 Share on other sites More sharing options...
Matt79 Posted February 16, 2009 Author Share Posted February 16, 2009 but right now the server has it and is processing it. It is not on the client computer. Is there no way to have php submit something after it has modified it? Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763635 Share on other sites More sharing options...
drisate Posted February 16, 2009 Share Posted February 16, 2009 no the trick is to do it befor ... This is something i did for an IPN script 1. build the forme and make it submit to a php page on your server 2. the php page receives the info ... save the stuff to a database 3. while doing it theres a message saying please whait while we transfer you 4. when it's done you build a hidden forme and auto submit it to the processor 5. the processor posts back the info to your IPN script 6. using the custome var features of your IPN you track down the row where the info is stored 7. You update the status with (complete, uncompleted) or just 1 or 0 for short Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763639 Share on other sites More sharing options...
Matt79 Posted February 16, 2009 Author Share Posted February 16, 2009 How do I auto submit? Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763646 Share on other sites More sharing options...
drisate Posted February 16, 2009 Share Posted February 16, 2009 lol 2 topics on the same subject hehe this is what i posted in the other one <html> <head> <title>Test</title> <?php if($_POST['username'] == NULL){?> <script language="javascript"> function MyFormSubmit(){ document.myname.submit(); } </script> <?php } ?> </head> <body onload="MyFormSubmit()"> <FORM ACTION="http://localhost/test.php" METHOD="POST" name="myname" id="myname"> <INPUT TYPE="HIDDEN" NAME="username" id="username" VALUE="latheesan"> </FORM> </body> </html> Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763650 Share on other sites More sharing options...
Matt79 Posted February 16, 2009 Author Share Posted February 16, 2009 ok I think I will just use javascript. It works for what I need. thanks guys. Link to comment https://forums.phpfreaks.com/topic/145444-solved-send-variable-to-process-and-back/#findComment-763655 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.