-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
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!
-
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
-
Editting and creating functions in PHP for a Poker game
mikesta707 replied to Senor Ramos's topic in PHP Coding Help
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. -
yeah I realized right as I posted, srry
-
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
-
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
-
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
-
isnt isset($_SESSION['post']['Obituary_ID']) and !empty($_SESSION['post']['Obituary_ID']) the same thing? EDIT: Nevermind
-
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
-
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
-
Need Help Redirecting users who are not logged in.
mikesta707 replied to The.Pr0fess0r's topic in PHP Coding Help
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 -
are you getting an error? what happens when you run the script?
-
[SOLVED] Fatal error: Cannot break/continue 1 level.....
mikesta707 replied to iamz3r0's topic in PHP Coding Help
So now i'm confused. did you get rid of the break and was the problem solved? -
[SOLVED] Fatal error: Cannot break/continue 1 level.....
mikesta707 replied to iamz3r0's topic in PHP Coding Help
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 -
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.
-
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"); ?>
-
How to remove(unlink) file with random name
mikesta707 replied to stockton's topic in PHP Coding Help
use PHP to echo the HTML than unlick? -
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
-
excellent. thank you! sorry, I don't really know why i didn't just google this...
-
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
-
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 }
-
where do you create the content array. I can't seem to find it in your code
-
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?
-
Help With Parse error: syntax error, unexpected T_ELSE
mikesta707 replied to jigsawsoul's topic in PHP Coding Help
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! -
is your script in the same directory as your image folder?