/    Sign up×
Community /Pin to ProfileBookmark

Display form input as heading on new page?

I want to have a field that someone can input text into and have it display on another page. Say someone types in “dog” in the search field, I want “dog” to display at the top of the page that follows – preferably a separate page.

I believ my server supports CGI.

Thanks!

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@3PinterNov 05.2005 — This is easily done using php.

I could explain the whole thing here because I've got a good link for you:

[URL=http://www.phpfreaks.com/tutorials/41/2.php]php session tutorial[/URL]

I hope that your's supports php ... otherwise this isn't much of a help afterall.

Good luck,


3Pinter

?
Copy linkTweet thisAlerts:
@VicNov 06.2005 — Alternatively, you can use querystring or cookies to pass the paramter. Of course, that will not work towards your search capability if you are using external data (for this you need server-side language like ASP, PHP, PERL ...)
Copy linkTweet thisAlerts:
@cbsargeauthorNov 08.2005 — actually, I want the word to just display on the following page. I have other code that is going to be on that ppage that will key off of the word the user typed in. All I need is to have the typed in search word displayed on the next page.
Copy linkTweet thisAlerts:
@ray326Nov 09.2005 — If your host supports CGI and Perl that's all you need. You can create or find a free templating system that will let you dynamically build the pages on the fly.
Copy linkTweet thisAlerts:
@cbsargeauthorNov 10.2005 — Can you give me some links to products like that?

This doesn't seem like it should be complicated. All I want is to have the text that someone enters in a form field display at the top of a blank page. ?

Is this harder than I think?
Copy linkTweet thisAlerts:
@simplygraphixNov 10.2005 — cbsarge,

Quick solution:

1. Create a form with the text field (which you would have done)

2. The form (on submission) takes the visitor to a PHP page. Thus, the next page would to be a PHP page which prints the visitor input.

Your form can be as follows: (take note of the *NAME* of the INPUT element)

<FORM NAME="myform" ACTION="next_page.php" METHOD="POST">

<INPUT TYPE="TEXT" NAME="visitor_input" VALUE=""><BR>

<INPUT TYPE="SUBMIT">

</FORM>

The visitor input can be printed on the next (the PHP) page as:

<?php

print "$visitor_input";

?>

Place this PHP code whereever you want.

Obviously, its assumed that your server supports PHP.

You can also use Perl (cgi) or ASP.

If your server does not support a server-side language/technology, use JavaScript cookies.
Copy linkTweet thisAlerts:
@cbsargeauthorNov 11.2005 — Thank you for the help so far. Could you give an example of the javascript version?
×

Success!

Help @cbsarge 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 5.13,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...