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

Link to comment
Share on other sites

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
Share on other sites

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 Matt79@test.info. It will then automatically submit it to a email database (or another webpage).

Link to comment
Share on other sites

What you should do is create a function to first test for valid email.

 

If say someone put in "Matt@test.info" you don't want your script to automatically add "@test.info"

 

So you will end up with "Matt@test.info@test.nfo"

 

So check for that first, if it's just a regular name, then you can add the email part....

Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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