Wildhalf Posted November 17, 2006 Share Posted November 17, 2006 Hi,What i am trying to do is wass a value ( 54292kg ) to a form on someone else's website. This site collects 3 things Your name, your email and a code ( 54292kg is my code). I want to fill in the code for the user. Is this possible???I could even have a different webpage that sends the user to this page if needed Link to comment https://forums.phpfreaks.com/topic/27636-passing-form-fields-through-url/ Share on other sites More sharing options...
Psycho Posted November 17, 2006 Share Posted November 17, 2006 Only if the receiving page is built to accept the data on the URL and to populate the fields. Usually the fields must be named the same in the url as they are on the form, so you could easily test if they will accept it. Link to comment https://forums.phpfreaks.com/topic/27636-passing-form-fields-through-url/#findComment-126400 Share on other sites More sharing options...
marcus Posted November 18, 2006 Share Posted November 18, 2006 couldn't you do[code]<?php$code = $_GET[code];echo "<form name=yo action=gocode.php method=post><br>Code: <input type=text name=code value=$code><br><input type=submit value=Go>";?>[/code]suttin like that you mean?[/code] Link to comment https://forums.phpfreaks.com/topic/27636-passing-form-fields-through-url/#findComment-126495 Share on other sites More sharing options...
Psycho Posted November 18, 2006 Share Posted November 18, 2006 @mgallforever,He stated that it is "a form on someone else's website." Link to comment https://forums.phpfreaks.com/topic/27636-passing-form-fields-through-url/#findComment-126502 Share on other sites More sharing options...
simcoweb Posted November 18, 2006 Share Posted November 18, 2006 mgallforever's code is a good example. The 'receiving' page/form needs to grab the code from the URL using the $_GET parameter which then sets the value for the $code variable. Then, in their form code, they populate the field with the variable:[quote]Code: <input type=text name=code value=$code>[/quote]To pass the code you'd need in your form script (in the action="yourscript.php") the command to do that. Probably a 'header' function similar to:[code]<?phpheader("Location: http://www.theirsite.com/formpage.php?code=54292kg") ?>[/code] Link to comment https://forums.phpfreaks.com/topic/27636-passing-form-fields-through-url/#findComment-126515 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.