Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-13-2004, 10:50 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

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>&nbsp;</p>
<p>&nbsp;</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>
-That's page where you enter it!

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>&nbsp;</body></html>
That is where entries are!!! if this is wrong i'm not happy!! lol.
Reply With Quote
  #2  
Old 07-13-2004, 11:15 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

lol from my opinion i don't think it will work but we will see won't we >....
Reply With Quote
  #3  
Old 07-13-2004, 01:53 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
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
Reply With Quote
  #4  
Old 07-13-2004, 02:24 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

What do u mean it won't save?
Reply With Quote
  #5  
Old 07-13-2004, 02:26 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

or be kept*
Reply With Quote
  #6  
Old 07-13-2004, 03:19 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
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
Reply With Quote
  #7  
Old 07-13-2004, 06:43 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

lol great i don't feel like working that hard I don't even know mysql!!!
Reply With Quote
  #8  
Old 07-13-2004, 06:51 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Well, I'll be glad to help where/ when I can. Just contact me by yahoo or aim (or send a u2u).




IcI
Reply With Quote
  #9  
Old 07-13-2004, 07:17 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
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 .
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net.
Free Teamspeak servers: http://gamersnetwork.us/

Reply With Quote
  #10  
Old 07-13-2004, 11:30 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

K thanks
Reply With Quote
  #11  
Old 07-14-2004, 04:41 AM
SilentTrigger is offline SilentTrigger
-1PARA-

Join Date: Sep 2002
Location: Sweden
Posts: 3,972

I'm always to late, when i get here every questions are allready answered, hehe
__________________
-1PARA-AlexKall

My photography website



Reply With Quote
  #12  
Old 07-14-2004, 10:40 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

lol
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -5. The time now is 10:23 PM.




Powered by vBulletin®