War Room

Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Featured Warrior Special Offer...
"Members Of The *War Room* Discover Secrets To Immediate Success!"
Reply
 
LinkBack Thread Tools
Old 10-28-2009, 10:41 AM   #1
HyperActive Warrior
 
Franco Mocke's Avatar
 
Join Date: Jul 2009
Posts: 160
Thanks: 6
Thanked 8 Times in 6 Posts
Default Need Help With PHP Form Postback

Hello,

I have to collect contact details via a form on my site, and then send it to another website via this format:

tools/postLead.php?mwaid=303&title=Mr&name=Franco&surnam e=Mocke&idnumber=234253453456&cellno=ertertert&tel no=ertert&email=ertret@gmail.com

Obviously my contact form has the fields "Title", "Name" etc...

Now, I used the postback method of the form, and set the action to a .php page where I collect the variables, put the strings together to create the URL as above.

Now after that, how do I send the data? Meaning how do I click on the link without opening a page?

Would appreciate any help, thanks!
Franco Mocke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-28-2009, 10:53 AM   #2
Peace Room Member +
War Room Member
 
Voon's Avatar
 
Join Date: Oct 2009
Location: The World Is Flat
Posts: 21
Thanks: 2
Thanked 1 Time in 1 Post
Default Re: Need Help With PHP Form Postback

<?php
// process your $_GET or $_POST variables here
header("Location: /tools/postLead.php?" . http_build_query($_GET));
// or $_POST depend on your form method
// note: no echo before header is sent
?>

hope this helps..

=)

Last edited by Voon; 10-28-2009 at 10:55 AM. Reason: added comments ..
Voon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-28-2009, 11:22 AM   #3
HyperActive Warrior
 
Franco Mocke's Avatar
 
Join Date: Jul 2009
Posts: 160
Thanks: 6
Thanked 8 Times in 6 Posts
Default Re: Need Help With PHP Form Postback

Thanks Voon, but I'm a bit confused! Here is exactly what I have to do:

<?php

$title=$_POST[title];
$name=$_POST[name];
$surname=$_POST[surname];
$contact=$_POST[contact];
$email=$_POST[email];


$url= "http://www.miway.co.za/tools/postLead.php?mwaid=303&title=" . $title . "&name=" . $name . "&surname=" . $surname . "&idnumber=8808265175081&cellno=" . $contact . "&telno=&email=" . $email;

?>

Now, after that I want to "activate" the $url, in other words I want to open the page without opening it, just sending the data.
Franco Mocke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-28-2009, 11:32 AM   #4
Peace Room Member +
War Room Member
 
Voon's Avatar
 
Join Date: Oct 2009
Location: The World Is Flat
Posts: 21
Thanks: 2
Thanked 1 Time in 1 Post
Default Re: Need Help With PHP Form Postback

If you want to open the page without opening it, use either fopen or file_get_contents. I would choose file_get_contents as it is easier.

$src = file_get_contents($url);
// echo $src if you want to ...

=)

Last edited by Voon; 10-28-2009 at 11:33 AM. Reason: the php quote seems messed up =/
Voon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to Voon For This Useful Post:
Old 10-28-2009, 11:52 AM   #5
HyperActive Warrior
 
Franco Mocke's Avatar
 
Join Date: Jul 2009
Posts: 160
Thanks: 6
Thanked 8 Times in 6 Posts
Default Re: Need Help With PHP Form Postback

Quote:
Originally Posted by Voon View Post
If you want to open the page without opening it, use either fopen or file_get_contents. I would choose file_get_contents as it is easier.

= file_get_contents();
// echo if you want to ...
Thanks man that worked great!
Franco Mocke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-28-2009, 12:00 PM   #6
Peace Room Member +
War Room Member
 
Voon's Avatar
 
Join Date: Oct 2009
Location: The World Is Flat
Posts: 21
Thanks: 2
Thanked 1 Time in 1 Post
Default Re: Need Help With PHP Form Postback

Your welcome..

=)
Voon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
form, php, postback

Thread Tools

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

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



All times are GMT -6. The time now is 10:39 PM.