pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
wanting to create a simple form to print with required fields
pocobueno1388 replied to galvlo's topic in PHP Coding Help
All you have to do is check if the required fields are empty, like so <?php if (!isset($_POST['form_field'])){ echo "You didn't fill out the form field!"; } else { //it was filled out } ?> Here are some tutorials on working with forms http://www.tizag.com/phpT/forms.php http://php.about.com/od/learnphp/ss/php_forms.htm -
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
That site is a tutorial site. It is meant to teach you what you want to learn. So if you want to learn it you need to follow the steps and actually read and apply what it's telling you to do. If you don't understand a function it uses, then look it up in the manual. -
Need help with php mysql date related query...
pocobueno1388 replied to jpipes's topic in PHP Coding Help
The file can be named whatever it wants as long as it has a .php extension. -
Google "PHP MySQL registration tutorial".
-
Have you tried Google. There are TONS of tutorials on this.
-
Tell us what's not working about it.
-
SELECT * FROM topics JOIN text ON text.msg_id = topics.mt_msg_id JOIN members ON topics.mt_from_id = members.id JOIN topics ON topics.mt_to_id = members.login
-
You can look into the wordwrap() function.
-
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
Go through all the "file" tutorials on this site http://www.tizag.com/phpT/files.php -
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
They want to add the money the person won into a pot of money won by all users. So I think a database would be the best way to go. Database. Make a table like this TABLE counter -------------- winnerID - the userID of the winner of the money amount - the amount of money they won Now, whenever you want to get the total amount of money won, you would just do a query like this SELECT SUM(amount) as amount FROM counter -
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
<?php if (isset($_GET['click'])){ $rand = rand(1,2); if ($rand == 1){ $amount_won = rand(1,100); echo $amount_won."GP MONEY FOUND"; //process their money here } else { echo "Awww, you lose"; } } ?> <p> <a href="index.php?click=yes"><img src="01.png"></a> -
[SOLVED] Any idea why this wouldn't be working?
pocobueno1388 replied to 2DaysAway's topic in PHP Coding Help
We can't help you if you don't tell us what it is, and what isn't working about it. -
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
Here is an example of how you could have them click on the image and they have a 1 out of 2 chance of getting the money. Is that enough to get you started? <?php if (isset($_GET['click'])){ $rand = rand(1,2); if ($rand == 1){ echo "You Win!"; //process their money here } else { echo "Awww, you lose"; } } ?> <p> <a href="index.php?click=yes"><img src="01.png"></a> -
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
Of course it's possible =] For the 1 in 2 chance they find money, use the rand() function. To keep track of the money, just use a database. -
Yes, it's possible. http://www.tizag.com/phpT/fileopen.php http://www.tizag.com/phpT/filewrite.php **** http://www.tizag.com/phpT/fileclose.php
-
It's because the default method is GET, you want to change it to post. It will look something like this <form action="cart.php" method="post">
-
Try SELECT * FROM `order` WHERE cust_id = '$id' AND processed = 'yes' AND processeddate < (NOW() - INTERVAL 30 DAY) ORDER BY processeddate DESC, last_name ASC
-
Is the file a .php? Try using <?php instead of using the short tag (<?).
-
<?php $entext = $_GET['entext']; $emtext = $_GET['emtext']; echo $entext.' '.$emtext; ?>
-
So basically you want to make sure they have supplied a complete birthday? If you are using selects, then I will assume your first option looks something like this. [tt]<option value="none">Please Select Day/Month/Year</option> <?php if ($birth_date_year == 'none' || $birth_date_month == 'none' || $birth_date_day == 'none'){ echo "ERROR, you didn't fill out a complete birthday"; } else { //they supplied all 3 fields, continue } ?>
-
You never select "topicid" from the database in your query...that might explain why it's empty.
-
What does the URL look like exactly when you click on it? If there is nothing after the topicid=...then that variable is empty.
-
You need to put the name of the script before the "?". Instead of ?topicid= It should be script.php?topicid= Also, you may want to verify that the variable $row['topicid'] isn't empty.
-
If your able to update a row in the database without doing anything else, then most likely you should do that. If you have to manipulate data around to insert a row, or it creates unneeded information, then thats not the way to go.
-
Would mysql_fetch_assoc be faster than mysql_fetch_array
pocobueno1388 replied to cooldude832's topic in PHP Coding Help
I agree, I doubt one is that much faster than the other that it would really matter. If your curious, why not just run your own tests?