/    Sign up×
Community /Pin to ProfileBookmark

URL format for entering prefilled info in a form

Take a look at this page.

[url]http://www.diablomag.com/Diablo-Magazine/Best-of-the-East-Bay-Ballot/index.php[/url]

I am trying to create a URL that prefills certain fields on this form. I have tried the tricks I know.

I would appreciate any help you can give.

KeenerGuy

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@jwitt98Mar 21.2011 — I'm not sure if this is what you mean, but if you're trying to pass values from a url to a form using php, you could do it like this. After the index.php part of your url add the name/value pairs like so:

index.php?first_name=John&last_name=Doe

Then for your form you could do this:
[code=php]
<input type="text" name="first_name" value="<?php if(isset($_GET['first_name'])) echo $_GET['first_name'] ?>" />
<input type="text" name="last_name" value="<?php if(isset($_GET['last_name'])) echo $_GET['last_name'] ?>" />[/code]
×

Success!

Help @KeenerGuy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...