Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. Take a look at "sticky forms" and file_get_contents, file_put_contents
  2. AyKay47

    Calendar

    So, what's the problem?
  3. You are referencing index values that do not exist. You must first verify that both indices are set before using them.
  4. 1. "Login" isn't really an object it's a procedure and shouldn't be made into a class. Creating a User class and creating login method(s) for that class would be a better OOP solution. 2. In the call to mysql_query() you are using variable $connection when in fact variable $conn is what holds your mysql link.
  5. The user can input apostrophe's without tampering with the SQL code as long as mysql_real_escape_string() is called on the data before using it in the SQL statement. This will escape any potentially harmful characters so they are not parsed as literal characters.
  6. Besides the incorrect SQL syntax:
  7. To clarify, session_start() is needed in any script where you are using sessions.
  8. I wouldn't use a $_GET value to begin form handling for various reasons. Instead, check either a hidden input value or an existing input value being passed to begin form handling. Make sure to only use the die() function during development, as it is not very user-friendly. Also, you should be implementing error checking logic into your code so you can see exactly what and where the problem is: $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $q = "SELECT * FROM `client` WHERE `Username`= '$username' AND `Password`= '$passLIMIT 1"; $r = mysql_query($q); if(!$r) { die("SQL statement: " . $q . "<br />" . "SQL Error: " . mysql_error()); } ... I'm also curious why you are using the MYSQL PASSWORD() function? You shouldn't be in this context.
  9. There is also a nice tutorial on this topic provided by phpfreaks: http://www.phpfreaks.com/tutorial/sessions-and-cookies-adding-state-to-a-stateless-protocol
  10. Please post the code onto this thread.
  11. Something like this should work for you: $emails = array(); //initialize $query = "SELECT * FROM mailinglist ORDER BY email"; $result = mysql_query($query); $numrows = mysql_num_rows($result); while($row = mysql_fetch_array($result)) { $id = $row['id']; $email = $row['email']; $links .= '<li><a href="mailto:'.$email.'">'.$email.'</a> <span class="delete"><a href="?cat=05&delete='.$id.'" onclick="return confirm(\'Are you sure you want to delete?\n This action CAN NOT be undone\')"><a></span></li>'; $emails[] = $row['email']; } $list = implode("; ", $emails); Also, be sure to implement error checking logic into your code
  12. Just from the context of those two lines, a few things can be said: 1. $row is already an array (What does the index "email" actually hold?) 2. $emails contains a two dimensional array 3. A variable that does not yet exist in the script context is being concatenated onto. We need to see ALL of the relevant code logic in order to be able to properly help you.
  13. Make sure that the allow_url_fopen option is enabled in the servers master php.ini file.
  14. Post the initial problem and solution to possibly help others in the future.
  15. make sure that the "id" index is set in the $_GET superglobal array before setting it's value to a variable. $id = (isset($_GET["id"])) ? intval($_GET["id"]) : false then proceed with PaulRyan's code
  16. Look into using fgets and store the lines into an array.
  17. What? Jessica pointed out the problem that we both overlooked.
  18. Please post the error you are receiving along with the relevant code to this thread.
  19. Also, it may help to output your query and check for errors there.
  20. ya
  21. What results are you expecting? Also, use mysqli_error() instead of mysql_error()
  22. "a" and "b" are both string keys. In a situation where you would need to have string keys and do not want to use a foreach loop (why not?), use a persistent naming convention for the keys so you can reference them properly inside of the loop(s). Something like this: $mArr = array( "number1"=>array(1, 2, 3, 4, 5), "number2"=>array(7, 20, 43, 44, 25) ); $i = 0; $c = count($mArr); while($i < $c) { $index = "number" . ($i + 1); $j=0; $c2 = count($mArr[$index]); while($j < $c2) { echo $mArr[$index][$j] . PHP_EOL; $j++; } $i++; }
  23. Holy global batman! Please post the relative code in this thread instead of an attachment.
×
×
  • 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.