|
Web design and Programming Discuss website creation and other programming topics. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Would ths work?....
Would this work?
(My first attempt at a actual PHP Script other than writings! SO be critical but not mean) ![]() Code:
<html><head><title>Welcome guest, add your comment!</title></head> <body> Type in your information: <P> </p> <p> </p> <form action="action.php" method="post" ID=Form1> <p>Your name: <input type="text" name="name" ID=Text1 size="20" value="Example"/></p> <p>Your age: <input type="text" name="age" ID=Text2 size="20" value="30"/></p> <p>Email: <input type="text" name="Email" size="20" value="user@example.com"></p> <p>Comments: </p> <p><textarea rows="7" name="comments" cols="24">Comments</textarea></p> <p><input type="submit" ID=Submit1/></p> </form> </body> </html> Code:
<html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 2</title> </head> <body> Posted by: <b><?PHP echo $_POST[ 'name' ]; ?></b> who is <b><?PHP echo $_POST[ 'age' ]; ?></b>! <p>Email him at this adress: <?PHP echo $_POST[ 'Email' ]; ?> <P> Comments: <?php /*Here his commets will go and be really cool *\ ?></p> <p> <?php $_POST[ 'comments' ]; ?> </p> <p> </body></html> ![]() |
#2
|
||
|
lol from my opinion i don't think it will work but we will see won't we >....
|
#3
|
||
|
yes it will work. I assumed that the code containing the php script is to be called action.php. Keep in mind though that the submited info isn't kept :-)
Note: I modified your example to fix a couple errors (which I have bolded for you): <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 2</title> </head> <body> Posted by: <b><?PHP echo $_POST[ 'name' ]; ?></b> who is <b><?PHP echo $_POST[ 'age' ]; ?></b>! <p>Email him at this adress: <?PHP echo $_POST[ 'Email' ]; ?> <P> Comments:<?php /*Here his commets will go and be really cool */ ?></p> <p> <?php echo $_POST[ 'comments' ]; ?> </p> <p> </body></html> HTH, IcIshoot |
#4
|
||
|
What do u mean it won't save?
|
#5
|
||
|
or be kept*
|
#6
|
||
|
According to your code, all that happens is that the data gets passed to the actions.php script, then displayed.
To keep the data, it needs to be saved in either in a file (don't have any experience with this) or in a database (more familier with this, if it is a mysql database). Of course, you then need to have away of retrieving the data and displaying it. IcIshoot |
#7
|
||
|
lol
![]() ![]() |
#8
|
||
|
Well, I'll be glad to help where/ when I can. Just contact me by yahoo or aim (or send a u2u).
![]() IcI |
#9
|
||
|
http://php.net look up file under functions and it will help you also look up mysql under there functions as well... great resource to use and those comments that the others in that community give are excellent. If you need help with anythin drop me a line if its about php or mysql
![]()
__________________
![]() Free Teamspeak servers: http://gamersnetwork.us/ ![]() |
#10
|
||
|
K thanks
|
#11
|
||
|
I'm always to late, when i get here every questions are allready answered, hehe
|
#12
|
||
|
lol
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New Work | SMITIE | Sigs and Graphics | 5 | 11-02-2005 09:38 PM |
New Work | BaLoR | Sigs and Graphics | 10 | 08-28-2004 08:03 PM |
My best work so far | D STROYER | Sigs and Graphics | 10 | 08-12-2004 04:59 PM |
New Work | Fire | Sigs and Graphics | 14 | 07-23-2003 12:35 PM |
does it work | Stain ev | Sigs and Graphics | 0 | 06-05-2003 11:42 PM |