[SOLVED]submission to another page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
word32
Forum Commoner
Posts: 27
Joined: Sun May 29, 2005 5:07 pm

[SOLVED]submission to another page

Post by word32 »

i just need to know how to have 1 page with an input feild and anothe page that displays the text you submitted in the input feild.

Visual ex.:
------------------------------------------------
page one

[-INPUT TEXT BOX-]
------------------------------------------------
===========================
------------------------------------------------
page two

this is what i put in the input text box
------------------------------------------------

thx in advance,
Last edited by word32 on Wed Aug 31, 2005 6:08 pm, edited 4 times in total.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Code: Select all

<input type="text" name="whatever">

Code: Select all

<?php

echo $_POST['whatever'];

?>
word32
Forum Commoner
Posts: 27
Joined: Sun May 29, 2005 5:07 pm

Post by word32 »

no, i mean like on 2 diferrent web pages
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

that is two different pages.

Your form (with the text field) submits (posts) to a page, that page then has the posted information.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Page 1 would look like this:

Code: Select all

<form action="page2.php" method="post">
<input type="text" name="field" size="20">
<input type="submit" value="Submit">
</form>
Page 2 would look like this:

Code: Select all

<?
echo $_POST['field'];
?>
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
word32
Forum Commoner
Posts: 27
Joined: Sun May 29, 2005 5:07 pm

Post by word32 »

do u need a database to do that?

because i did it from my admin page

http://habbotime.biz.ly/admin/admin_values.html

and it comes out on

http://habbotime.biz.ly/raretrades/raretrades.html

i only have 1 test line on the raretrades.html

but anyway, when i submit my info on admin values it takes me to raretrades.html and the info i typed in isnt there
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

a mountain of exclamation points in your topic is entirely uncalled for. :roll:

You're submitting values to an HTML page. You need to submit to php, not HTML.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Yes, feyd is correct. PHP doesn't just happen :P You have to have a PHP enabled webserver (remotely or locally) and change your .html extension to .php on the page where you want to show the form input.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
word32
Forum Commoner
Posts: 27
Joined: Sun May 29, 2005 5:07 pm

Post by word32 »

thanks and sorry about the exclaimation points :)
word32
Forum Commoner
Posts: 27
Joined: Sun May 29, 2005 5:07 pm

Post by word32 »

now when i go to admin page and test the first line, it says posting is forbidden

and now there's something going on with my host (i dont know if any of you use biz.ly but mabee you could still fix it) that when i go to raretrades.php it says it is forbidden to veiw the page.

can someone help me fix and finish this please? and all of you that have helped me, your help is greatly appreciated.

thanks x10 in advance,

word32
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I would bet the host disallows all "files" outside of .html (and images) ...
word32
Forum Commoner
Posts: 27
Joined: Sun May 29, 2005 5:07 pm

Post by word32 »

hm.......

ok

thank you know i know exactly what to do

:)
Post Reply