Jump to content

TheJoey

Members
  • Posts

    334
  • Joined

  • Last visited

    Never

Everything posted by TheJoey

  1. would that only unset the login function and not the cart session.
  2. im not using databases. but thanks.
  3. 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.
  4. Thanks how would i run the sql so just show people who play pacman
  5. 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.
  6. mikesta... your a star. Thanks mate
  7. 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.
  8. <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
  9. 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?
  10. 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
  11. 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>
  12. Absoulte paths? like full paths. Dont they do the same job.
  13. 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 />
  14. 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
  15. This could be my problem. Let me try it out.
  16. 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
  17. 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.
  18. 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
  19. i forgot to add the rest sorry if (is_numeric(luhn_check($cc))){$postErrorsCredit = true; } }
  20. 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)))
  21. The problem was i was calling it twice. Thanks for that.
  22. yup at the top of my page
  23. 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
  24. i fixed the syntax, is still showing my form when im logged in though.
  25. 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
×
×
  • 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.