Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. here is a tutorial on php and post variables http://www.tizag.com/phpT/postget.php
  2. try mysql_fetch_assoc instead of mysql_fetch_array
  3. thats because you have no echo statements in your code... or at least not any that I can see
  4. alright so what is happening when you run your code, and what do you expect to happen
  5. is that output what you expect?
  6. I suppose you could just put the recaptcha check in the same page as the form, and have the form submit to itself. But since you are already refreshing the page, I don't how making it go to the same apge is better
  7. manrows is an array, not an object, and you are treating it as an object in the second foreach $deduct = $row->deductible; should probably be something like $deduct = $row['deductible']; assuming that $row is an associative array
  8. $row is an array, not an object. So you can't use the -> symbol to choose data. also, you probably want the php to return an associative array. Also, the sum will be total, not amt (I think, i could be wrong) $amt = mysql_query("SELECT SUM(amt) AS total FROM provider WHERE day = '01' AND month = '06'"); $row =mysql_fetch_assoc($amt); $total = $row['total'];//if doesnt work try $row['amt']; echo $total; that should work. Hope that helps!
  9. you can style the links with php if you want...
  10. You have to close the PHP tags to do what you want. Also, you don't need to write "endifelse;" if you have opening and closing brackets. <?php if ($ip == "255.255.255.255") { echo "Your IP Is Blocked!"; } else { ?> <script type="text/javascript"> <!-- my javascript code --> </script> <?php } ?> hope that helps!
  11. when do you do print_r. if its after the foreach then the variables will have been overwritten each time the foreach runs, and will only have the results from the last entry in the array
  12. interesting. I'm not sure if PHP has support for nested funtions. That might be your problem. I just tried a simple example on my server with a nested function. the code was: <?php function tacos ($taco){ echo $taco; insite($taco . "to"); function insite($poop){ echo $poop; } } tacos("hello"); ?> the output was: hello Fatal error: Call to undefined function insite() in C:\Server\htdocs\text.php on line 5 so I think your nested functions is the problem
  13. when you use a foreach loop, you refer to each entry in the variable as the value variable you use. so instead of using $_SESSION['states'] in your code, you have to use $value. so: foreach($_SESSION['states'] as $key=>$value) { $stateName = explode("-",$value); echo $stateName[0].' <br />'; } echo "</blockquote>"; should work for what you're doing
  14. well, since it is using php, the only way for the script to validate the form entry is to refresh the page/go to a new page. This is because PHP is parsed server side. If you want it to be more "dynamic" I think you will have to use some combination of javascript or AJAX.
  15. im assuming that the results returned you are talking about are stored in the variable $prem? that seems to be the only variable that gets any data stored after the initial query in the first foreach loop. if that is true, than that is your problem. You will need to store the data from each loop in an array. The variable will get overwritten with new data every time until the last iteration, and that is why the data from the last entry in the array is the only data you are seeing.
  16. looks like its a simple syntax error. delete the space between the function name (request) and the parentheses. public function request($tableorsql, $crit="") { hope that helps EDIT: Nevermind, just tested a simple function and a space between the function name and parameter list is allowed
  17. No one is going to do your project for you, or explain how you are supposed to do your project. That is up to you. I read some of that sheet, and it seems like you were supposed to be doing this project for a while. But i didn't read all of it, so i'm not sure. If you have a PHP related problem with some code you have, I would be glad to help, but unless you want to pay me to do this project for you, i'm afraid I can't help you
  18. ok, so exactly how many times does your foreach run. it should be 3 times right? is it running 3 times, 2 times, once? What happens when it runs, and what do you expect to happen?
  19. forgot a comma. mysql_query('UPDATE imuzic_mp3 SET valid=\'-2\', last_checked=\''.date('Y-m-d H:i:s').'\', check_now=check_now+1 WHERE id=\''.$mp3['id'].'\'') or die(mysql_error());
  20. well firstly, that is syntactically incorrect. you have an else statement that isn't connected to an if statement. (also, you can enclose your code in code tags to make it easier to read in the future.) this part is wrong: //you need an if statement above the else statement {//this is wrong else //you need a opening bracket here ##{ $raise = $userbet; $pcash = $pcash - $userbet; } $pot += $raise; I am not sure what if statement you would need connected to that part, becaue I don't really know how poker works, and small blind rounds make no sense to me. Hope that helps! I'll be leaving work soon, so I wont be online for the rest of the night. Good luck, and if you can't get any more help you can email me
  21. eregi is regex. if you want to detect just the word hi or hello something like $patternHi = "/^hi$/"; $patternHello = "/^hello$/"; should work (hopefully. haven't done much regex at all, but have done some with javascript, and I don't know how much different, or if there is a difference, between javascript regex and php regex) that will match the word only. now that i think of it, just having the word as the pattern would probably work too. In any case, for regex help, i'm not the one to go to. Hope that helps!
  22. you will want to look into RegEx
  23. something like that would be very advanced. I think that moneytooth's method is the best so far (well I can't think of a better way) You could probably do some wicked regex and work it out, like for example, taking a bad word, exploding it into its specific chars, and making a regex expression that searches for all those characters with any number of spaces in between each character. and then of course you could expand that to any number of other characters
  24. well firstly, try doing or die("ERROR: " . mysql_error()); whenever you do a mysql query. There is probably a problem with the query, resulting in a return value of false, rather than returning a valid mySQL resource.
  25. Here is a basic php & forms tutorial: http://www.tizag.com/phpT/forms.php that should get you started. Its really very simple once you get used to what you need to do. Hope that helps!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.