Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design

Notices

Reply
 
Topic Tools
  #1  
Old March 30th, 2006, 04:55 PM
dudeking's Avatar
dudeking dudeking is offline
Banned
 
Join Date: Dec 2005
O/S: Linux
Location: UK, Midlands
Age: 17
Posts: 2,842
PHP Help

PHP Code:
<td class="body">
                    <div class="home">
                        Submit Script
                    </div>
                    <form action="test.php" method="POST">
                         Your name: <input type="text" name="name" />
                         <Br>
                         Your age: <input type="text" name="age" />
                         <br>
                         <input type="submit">
                    </form>
                    <br>
                    <br>
                    Hi <?php echo $_POST["name"]; ?>.
                    <br>
                    You are <?php echo $_POST["age"]; ?> years old.
                </td>
How can I hide the output
PHP Code:
   Hi <?php echo $_POST["name"]; ?>.
                    <br>
                    You are <?php echo $_POST["age"]; ?> years old.
Untill somthing has been entered?
At the moment before you press Enter it just says Hi...you are...Years old.

Not quite sute how to fix it any help will be welcome
Reply With Quote
  #2  
Old March 30th, 2006, 05:02 PM
degsy's Avatar
degsy degsy is offline
Cyber Tech Help Moderator
 
Join Date: Jul 2001
Location: North-East, UK
Posts: 22,023
Blog Entries: 1
Code:
<input name="Submit" type="submit" id="Submit" value="Submit">
PHP Code:
<?php if(isset($_POST['Submit'])){ ?>
                    Hi <?php echo $_POST["name"]; ?>.
                    <br>
                    You are <?php echo $_POST["age"]; ?> years old.
                    <?php ?>
__________________
Cheers,
Degs

Please post back with your results
CTH Terms of Use

CTH Subscriptions :: Adaware Guide :: HijackThis
Reply With Quote
  #3  
Old March 30th, 2006, 05:07 PM
dudeking's Avatar
dudeking dudeking is offline
Banned
 
Join Date: Dec 2005
O/S: Linux
Location: UK, Midlands
Age: 17
Posts: 2,842
Thanks Degsy am still learnin only half way through the book

Thanks again Dudeking
Reply With Quote
  #4  
Old March 30th, 2006, 08:21 PM
dudeking's Avatar
dudeking dudeking is offline
Banned
 
Join Date: Dec 2005
O/S: Linux
Location: UK, Midlands
Age: 17
Posts: 2,842
How can I desplay PHP on a site??
I know how to show html with the <xmp> tag.
But this does not show PHP code.

Any one know??
Reply With Quote
  #5  
Old March 30th, 2006, 08:26 PM
degsy's Avatar
degsy degsy is offline
Cyber Tech Help Moderator
 
Join Date: Jul 2001
Location: North-East, UK
Posts: 22,023
Blog Entries: 1
Use highlight_file or show_source or if your host supports it a .phps extension.
http://uk.php.net/highlight_file
__________________
Cheers,
Degs

Please post back with your results
CTH Terms of Use

CTH Subscriptions :: Adaware Guide :: HijackThis
Reply With Quote
  #6  
Old March 30th, 2006, 08:49 PM
dudeking's Avatar
dudeking dudeking is offline
Banned
 
Join Date: Dec 2005
O/S: Linux
Location: UK, Midlands
Age: 17
Posts: 2,842
Thanks degsy

The highlight_file and highlight_string were a bit of a pain went with the show_source alot easier.

Thanks Dudeking
Reply With Quote
Reply

Bookmarks

Topic Tools

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


All times are GMT +1. The time now is 12:24 PM.

[ RSS ]