
TheJoey
Members-
Posts
334 -
Joined
-
Last visited
Never
Everything posted by TheJoey
-
would that only unset the login function and not the cart session.
-
im not using databases. but thanks.
-
Just wondering how i would create a logout function Would it just be <?php session_start(); HTML CODE unset($_SESSION['login']); header('location index.php'); ?> or should i use session_destroy mind you that im using sessions to maintain information from my shopping cart also.
-
Thanks how would i run the sql so just show people who play pacman
-
Besides from the simple Select CodeID, Firstname, Lastname FROM GAMERS ive very new to querrys. Any help very much appeciated, and its the only sql i use in my whole website.. im only trying to test something.
-
mikesta... your a star. Thanks mate
-
Hi im having trouble trying to create a querry that will retrieve codeID, Firstname & lastname of people i have playing on my server that only play pacman, then displays how many times they have played it.
-
<b>Warning</b>: file(/data/data.txt) im getting that error i have root -> data -> data.txt but my script is being run from root -> login -> change.php
-
i had it as solved but i want it to read from a diferent directory and this isnt working $fn = "../stored/data.txt"; what can i do to replace this?
-
Must of been how i was pointing to the file because when i move it all into the same folder and use just include('form.php'); it works fine.. thanks
-
Like i said it works on its own but when i include it is when i get the problems <body> <p> Create form <?php include("formtest.php"); ?> </p> </body>
-
Absoulte paths? like full paths. Dont they do the same job.
-
Im using a php code to create a form and load some txt. Only problem is when i implement it into my html and css it goes funny, but works perfectly fine on its own. <?php include("formtest.php"); ?> <form action="processchange" method="post"> <textarea rows="10" cols="10" name="formtest"> <?php $fn = "form.txt"; print htmlspecialchars(implode("",file($fn))); ?> </textarea><br> <input type="submit" value=""> </form> errors im getting <br /> <b>Warning</b>: file(test.txt) [<a href='function.file'>function.file</a>]: failed to open stream: No such file or directoryon line <b>5</b><br /> <br /> <b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed on line <b>5</b><br />
-
Well mine seems to be validating now, but the wrong way 3321 5678 9012 1334 which gives me no error 3321 5678 9012 1332 which gives me a error Thanks. It seems i was trying it off the wrong algorithm this whole time was making me go crazy
-
This could be my problem. Let me try it out.
-
i was reffered to that link, but i have been testing others, and even when i test the number that was valid for your algoirthm it didnt work. Did you use the changed version or the original algoirthm. both code give me invalid. if (luhn_check($cc)) $errorCC = true; im trying that one now
-
Something in my code, because im trying to validate it from a text input field. Where $cc is my text field name $cc = isset($_POST['cc']) ? trim($_POST['cc']) : ''; Althought it always seems to say invalid for me. Did you use the original version or the changed regex one.
-
Well would this work in that case if (luhn_check($cc))){$postErrorsCredit = true; } } and when i test your code snippet it doesnt seem to work im testing it with this credit card number off the internet 3321 5678 9012 1334
-
i forgot to add the rest sorry if (is_numeric(luhn_check($cc))){$postErrorsCredit = true; } }
-
i have taken this luhn algorithm off a website. Its a function to check credit cards, but it just doesnt seem to do the job properly <?php /* Luhn algorithm number checker - (c) 2005-2008 - planzero.org * * This code has been released into the public domain, however please * * give credit to the original author where possible. */ function luhn_check($number) { // Strip any non-digits (useful for credit card numbers with spaces and hyphens) $number=preg_replace('/\D/', '', $number); // Set the string length and parity $number_length=strlen($number); $parity=$number_length % 2; // Loop through each digit and do the maths $total=0; for ($i=0; $i<$number_length; $i++) { $digit=$number[$i]; // Multiply alternate digits by two if ($i % 2 == $parity) { $digit*=2; // If the sum is two digits, add them together (in effect) if ($digit > 9) { $digit-=9; } } // Total up the digits $total+=$digit; } // If the total mod 10 equals 0, the number is valid return ($total % 10 == 0) ? TRUE : FALSE; } ?> threw help from some people at php freaks they told me to change this $number=preg_replace('/\D/', '', $number); to $number=preg_replace('/[^\D]*/', '', $number); so if im trying to test this input box echo '<table><tr><td>Number:</td><td><input type="text" name="number"></td></tr></table>'; Because the way im doing just doesnt seem to work. if (is_numeric(luhn_check($number)))
-
The problem was i was calling it twice. Thanks for that.
-
yup at the top of my page
-
Correct, but its still showing my form. Mabye im not identifying the session id correctly $_SESSION['loginsuccessfull'] = true; header("location: loginsuccess.php"); } else { header("location: unsuccess.php"); is everything fine with that, im completly stuck
-
i fixed the syntax, is still showing my form when im logged in though.
-
im trying to give a error message if(!$_SESSION["loginsuccessfull"]) { echo 'Your Already Registered, Only one account allowed'; else Function showform() } Parse error: syntax error, unexpected T_ELSE Thanks in advance guys