Jump to content

Passing Form Fields through URL


Wildhalf

Recommended Posts

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

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]<?php
header("Location: http://www.theirsite.com/formpage.php?code=54292kg")
?>[/code]

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.