Jump to content


Photo

Storing Values


  • Please log in to reply
3 replies to this topic

#1 RedRevolution

RedRevolution
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 17 April 2006 - 05:54 AM

I'm trying to create a set of forms where a user can imput a score for a game in a field. Once he/she imputs a score, I need to be able to output it.

If someone would be so kind to create a quick, working, "Hello World" sort of thing, I'd be very appreciative. Thanks!

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 17 April 2006 - 08:48 AM

What do you mean? You want to just write what he submitted?
If so, do something like this:
In form.htm:
<html>
<form action="form.php" method="POST">
Enter your score:<br>
<input type="text" name="score">&nbsp;
<input type="submit">
</form>
</html>
For the form.php:
<html>
<?php
echo($_POST['score']);
?>
</html>
I am not sure if thats what you ment but it sure seems like it.

But if you ment having alot of forms and then output everything, you can either use <input type="hidden"> (not recommended) or use sessions.

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 RedRevolution

RedRevolution
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 April 2006 - 01:08 AM

That is a great start! Here is what I need.

I need the user to be able to go to a tournament page, enter a score, then that page stores the score somewhere so others can view it ( on the same page ).

I'm not quite sure how to approach this. This is a short rough algorithm.


> User enters a score and their name
> Score and name is stored in database
> Score and name is then shown on another page

#4 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 18 April 2006 - 07:40 AM

Yes, thats exactly what you need to do.
Look for tutorials to help you here :)

Orio.
Think you're smarty?

(Gone until 20 to November)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users