PHP and forms

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
codewarrior
Forum Commoner
Posts: 81
Joined: Wed Aug 07, 2002 1:28 pm

PHP and forms

Post by codewarrior »

Ok this is a form I'm trying to create for a Game forum I mod @. Here is what I'm trying to do. Create a form that would ask users to Upload the maps (Screen Shots) SS, author name, map's brief description and type of map into a mysql database. Maps are later reviewed and posted as Map of the week, month, year, etc. In the code below, for now, I'm only looking at collecting author name, description and type of map. Next step would be to save it in MYSQL DB.

Please let me if I'm on the right track! THanks :D

Code: Select all

if ($submit == "click"){ 
  echo "Hello, $UserName"; 
} 
else{ 
echo ' 
<html><body> 
<form method="post" action="input.php3"> 

Enter Your Name 
<input type="text" name="Name"></input><br> 

<input type="submit" name="submit" value="click"></input> 

Enter Map's brief description
<input type="text" name="description"></input><br> 

<input type="submit" name="submit" value="click"></input> 

Enter Map's Type
<input type="text" name="type"></input><br> 

<input type="submit" name="submit" value="click"></input> 

</form> 

</body></html> 
'; 
} 

?>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

wow, you're sure it has to be done in php3?

instead of that long echos I prefer to close the php-block or to use heredoc syntax, but that's only a matter of opinion.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Code: Select all

<?php
if ($submit == "click"){  
  echo "Hello, $UserName";  
}  
else{  
echo "<html><body> 
<form method="post" action="input.php3"> 

Enter Your Name 
<input type="text" name="Name"></input><br> 

<input type="submit" name="submit" value="click"></input> 

Enter Map's brief description 
<input type="text" name="description"></input><br>  

<input type="submit" name="submit" value="click"></input>  

Enter Map's Type 
<input type="text" name="type"></input><br> 

<input type="submit" name="submit" value="click"></input> 

</form> 

</body></html>";  
}  

?>
Image Image
Post Reply