Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. From PHP.net Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). http://us3.php.net/time check that page out. That will probably help answer some of your questions. I'm sure someone else on these forums could help too, but I don't use the time() function much so I can only provide a link. hope that helps!
  2. here is a basic tutorial on the XML DOM and XML parser that PHP has built in. http://www.w3schools.com/php/php_xml_dom.asp
  3. well if you want it to be dynamic, you want to go with javascript for a function that changes what the bet to be played is. For PHP, you will have to have said button submit to a form, and then use that form to update the value of the bet.
  4. yeah I realized right as I posted, srry
  5. looks fine to me. Try deleting the space between the decrement operator and the variable, IE $_SESSION['cart']['items'][$id]['quantity']--; other than that I dont really see a problem. Althought Im not sure what the is_item_in_basket method does, or if that could be impacting things
  6. Ok. just use the mail function to email them. PHP.net page http://us2.php.net/manual/en/function.mail.php tutorial on mail function http://www.w3schools.com/PHP/php_mail.asp
  7. ahh ok, I was under the impression that you didn't know anything about upload scripts. You could make your own API (like the Facebook API) and make user's use that for MySQL functions and other php functions that effect the server, and then forbid the built-in functions from working good luck
  8. isnt isset($_SESSION['post']['Obituary_ID']) and !empty($_SESSION['post']['Obituary_ID']) the same thing? EDIT: Nevermind
  9. jesus christ that code is ridiculous. Wrap in some code tags and format it a little bit please. I don't understand what you want really
  10. well, even with HTML, people could insert harmful javascript. If you really don't know where to star, I suggest you start with a much smaller project than a web hosting website. As Maq has said, check out those upload tutorials. For security, What I would do is, before outputting any php page, search through it with a function, and have a forbidden function array or forbidden mysql array and "cleanse" the page before it is output. Again, if you are just starting with learning how to handle uploads, something like this can be very overwhelming (and I doubt that my way is the best way, or even a particularly good way, as I don't have much experience with what your talking about) best of luck
  11. it seems to me that the form object is outputting before you call the header. Instead of using a header, you could simply exit() the script and echo something like "Your not logged in. go here to log in" OR you can try to edit the form class to not output anything
  12. are you getting an error? what happens when you run the script?
  13. So now i'm confused. did you get rid of the break and was the problem solved?
  14. ahh I just had this error! but for a much different reason. You don't seem to have any statement that the break would be in. you have multiple closing brackets in the posted code, but only one opening bracket. post the code thats above what you posted
  15. no there is not. I don't even know what you are trying to accomplish with more than 1 =>. Just use a multi-dimensional array.
  16. there is a syntax error there. You don't need to echo PHP inside php tags <?php session_start(); require("con_mgr.php"); $chapSelect = $_POST['chapSelect']; $_SESSION['wordArray']=$get_field; $_SESSION['currentWord']=$value; $result = mysql_query("SELECT GreekWord FROM WORD where Chapter >= $chapSelect"); $num_rows = mysql_num_rows($result); $get_field = mysql_fetch_row($result); foreach($get_field as $value) { $display="<HTML>"; $display.="<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\">"; $display.="<div id=\"testWord\">"; $display.="$value"; $display.="</div>"; $display.="</HTML>"; } echo($display); //header("Location:http://localhost/SessionDemo/demo2.php"); ?>
  17. use PHP to echo the HTML than unlick?
  18. sessions are stored on the server, so besides tampering by you, there can't be much tampering on the user end. Are you looking for protection against things like SQL injection? you want to look up the mysql_real_escape_string() function: http://us.php.net/manual/en/function.mysql-real-escape-string.php along with perhaps trim(), htmlentities(), and stripslashes() depending on what content you are validating
  19. excellent. thank you! sorry, I don't really know why i didn't just google this...
  20. oh... I'm an idiot. well, assuming that your text file is valid I can't really see a problem. although it seems that, from your output, your first key has a null value (and the key itself is a null value) this probably has something to do with the error as wat has said
  21. Can you pass values by reference, Ala other high level languages like C++ (and Java I think) for example, would the following compile? function afunction(&$refVar, $otherVar, $another){ //do stuff //with function //return something, also change $refVar }
  22. where do you create the content array. I can't seem to find it in your code
  23. http://us3.php.net/manual/en/function.mail.php also, wrap your code with code tags. have you ran that code? what seems to be the problem?
  24. well, unless you have an entry in the database with a user, and their account is active, it won't say "login failed. please try again." if the user doesn't exist on the database the following will execute: if ($userstatus != 'active'){ // Set error message $_SESSION["message"] = '<div class="error mb">Login failed, your account has been disabled, contact admin.</div>'; // After error message move to login.php header ('Location: ../login/login.php'); } because $userstatus is null, and thus not equal to 'active'. if you want to test if the user both exists and they are not active, you have to add another clause to that if statement, something like $num =mysql_num_rows($result); if ($userstatus != 'active' && $num > 0){ // Set error message $_SESSION["message"] = '<div class="error mb">Login failed, your account has been disabled, contact admin.</div>'; // After error message move to login.php header ('Location: ../login/login.php'); } that will then test if the userstatus is active, and that there was a row returned. If there wasn't a row returned (which would be the case if the username didn't exist on the table, OR the username was entered incorrectly) than the if statement wouldn't execute. hope that helps!
  25. is your script in the same directory as your image folder?
×
×
  • 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.