Jump to content

[SOLVED] Send variable to process and back


Matt79

Recommended Posts

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

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)

 

 

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).

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.

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....

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

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

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> 

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.