![]() |
| ||||||||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
HyperActive Warrior
Join Date: Jul 2009
Posts: 160
Thanks: 6
Thanked 8 Times in 6 Posts
|
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! |
|
|
|
|
|
#2 |
|
Peace Room Member +
War Room Member
Join Date: Oct 2009
Location: The World Is Flat
Posts: 21
Thanks: 2
Thanked 1 Time in 1 Post
|
<?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 .. |
|
|
|
|
|
|
#3 |
|
HyperActive Warrior
Join Date: Jul 2009
Posts: 160
Thanks: 6
Thanked 8 Times in 6 Posts
|
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. |
|
|
|
|
|
#4 |
|
Peace Room Member +
War Room Member
Join Date: Oct 2009
Location: The World Is Flat
Posts: 21
Thanks: 2
Thanked 1 Time in 1 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.
$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 =/ |
|
|
|
|
| The Following User Says Thank You to Voon For This Useful Post: |
|
|
#5 |
|
HyperActive Warrior
Join Date: Jul 2009
Posts: 160
Thanks: 6
Thanked 8 Times in 6 Posts
|
|
|
|
|
|
|
#6 |
|
Peace Room Member +
War Room Member
Join Date: Oct 2009
Location: The World Is Flat
Posts: 21
Thanks: 2
Thanked 1 Time in 1 Post
|
Your welcome..
|
|
=)
|
|
|
|
|
![]() |
|
| Tags |
| form, php, postback |
| Thread Tools | |
|
|
![]() |