Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
my php form sends a nobody in thr from/sender field of my email
Jessica replied to mightymouse's topic in PHP Coding Help
You never set the headers. check out the manual. http://www.php.net/manual/en/function.mail.php -
new to php, and this problem is blowing my mind
Jessica replied to michaelreneer's topic in PHP Coding Help
your website should be standards compliant XHTML, not XML. If your website is XML, I can see why you're having problems. You don't need <?xml on your regular pages. Only on XML ones. Not XHTML. -
You said you need to find the number of them, not the IP, then complain that you can't print the IP....
-
[SOLVED] Grab Data From a table, Echo, Then Insert it into a new table...
Jessica replied to Teck's topic in PHP Coding Help
Are your columns really named column1 and column2? those are bad names. -
oh for pete's sake. Your code! That you want to use if they press the first button!
-
[SOLVED] Server Side Validation: Cannot get the error to display.
Jessica replied to suttercain's topic in PHP Coding Help
change it to <?php if(!isset($_POST['name']) || strlen(trim($_POST['name'])){ $errors['name']="Required!"; } ?>[code] [/code] -
<?php if(isset($_POST['goto1']){ //do the first }else{ //do the second } ?>[code] [/code]
-
He is asking about using a templating system like smarty, as opposed to just having html in the PHP code. While most people would say you should use a templating system, I feel they often make things more complicated than they need to be and say screw it on most projects. I think it becomes personal preference. As long as everything is neat and organized, you don't NEED a template system to write good code. If it helps you, use it.
-
Okay try putting in a little effort first. There are a BAJILLION examples out there for looping through an array. Cmon.
-
You'll want to use the DISTINCT keyword. SELECT DISTINCT ip from adverts_user_ip GROUP BY ip
-
Once the game is ready to be released I'll try to remember to PM you
-
I posted several examples of code that will do what you want. What are you asking for? If you don't even know how you want to determine how much their gold goes up, you need to figure that out before you code it.
-
it's online I just never released it because I have about 2% left to do The SQL I posted will update every user with 5 more gold, no matter how many users you have. You can do a lot in your SQL. If you get 5 gold for every level of gold mine, then it would be UPDATE users SET gold = (gold+(5*goldmine)) or if it's random, maybe it's from 1-5 time the goldmine. $num = rand(1,5); $sql = "UPDATE users SET gold = (gold+($num*goldmine))"; mysql_query($sql); etc. Just figure out how you want it to increment.
-
don't use www Do you know see the issue that I brought up? I mean, what if you have a user called files? How do you know which they want to get to. You can do site.com/username if you make sure all of your other urls are within another directory. But otherwise there is no way to tell what is what.
-
I would make a separate function for going all in, instead of just call. When they click the all in button, use that function.
-
How often is it supposed to go? I did a game like this once. Basically, you need to be checking the database every page load anyway for the user's status, messages, that sort of thing, yeah? So when you do that, you also get out their gold from the DB. Then make a cron job that runs every so often. I did mine every 10-15 minutes. That cron job will have an SQL command (Either a PHP file or just SQL, I did a PHP file) and update the entire database as gold = gold+5 or whatever gold amount. so "UPDATE users SET gold=(gold+5)" And you're good to go.
-
what is moof? I have never heard that before. Call the ISP.
-
What is the error? And where is the filled_out function defined?
-
$sql = "SELECT * FROM table WHERE date > $start && date < $end"
-
What field type are they? int, date, datetime?
-
I guess. It'd make more sense to me to loop through these arrays perhaps in a foreach, but that's me.
-
Way too vague. Do you want a dropdown with all of those options? What do you mean select? Are you talking about a database? we're not mindreaders, cmon.
-
That's the logic you will have to figure out. So when the user goes all in, that is when you would need to have more than one pot, so that is when you'd use an array. Then when the game is over you'd use the rules of poker to distribute it. This is really more of a logical issue than PHP code, so it's hard to tell you how to do it. All I can tell you is I have written tons of games. Blackjack was the funnest, figuring out how to do push/draw, insurance, split, etc. It was just a long time of testing and going over the logic. Make sure you use lots of comments. Write out some psuedo code first. //How much does the player want to bid //if it's all in, do this all-in stuff. //otherwise just bid what they bid. //game is over, is there multiple pots? no, okay just give it all to winner //there is, figure out who gets what. etc.
-
how to display a webpage logged in via a cURL request in an iframe
Jessica replied to arianhojat's topic in PHP Coding Help
To answer the header questions, I don't really know. I hacked this together from the comments on php's manual and some other examples around the net. You could try messing with the header lines to see how it affects the code when you change it to 0 or 1. the SSL is because my original example was an https page - you can remove those if your login page is not on ssl, https. -
Why do you have all of these spaces in the table and column names?