Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. put error_reporting(E_ALL); at the top of the page and see if any errors are thrown.
  2. If you check the manual you'll see that fwrite() takes 2 mandatory parameters: 1. The resouce ($handle in your case) which you are passing. 2. The data that you want to write to the file. if(fwrite($handle, $data)) {...}
  3. Add some debugging to your code so you can see what's going wrong. More specifically you might want to check to make sure $session->referrer contains what you want it to.
  4. $var = implode("\n", array_map(create_function('$a', 'return implode(" || ", $a);'), $arr)); First array_map() is preformed on $arr which is our multidimensional array. For every array it preforms implode(" || ", $a), which basically takes each array and implodes with a delimiter of " || ". So basically array_map() in this case overall returns an array of strings like "linkname || linkurl.com", finally the last implode() takes that array returned by array_map() and creates a string with a delimiter of "\n". array_map() create_function() implode()
  5. You're never closing your constructor. class Process { /* Class constructor */ function Process(){ global $session; /* User submitted registration form */ if(isset($_POST['subjoin'])){ $this->procRegister(); } } // Forgot this.
  6. That's just a static array for the example.. You can plug any other Array with any other number of elements and it'll work.
  7. Yea, I can see it's there.. But why?
  8. Why are you doing this? for($i=0; $i<256; $i++) { imagecolorallocate($file, $i, $i, $i); } There's no purpose for that at all..
  9. Then just use a similar concept to append text to a div 5 seconds after a page has loaded if the account was created.
  10. If I understand you correctly, you want the user to enter information, press submit then in about 5 seconds output if it's valid or not? This seems like a very bad idea for many reasons.. But here's a basic example: <script type="text/javascript"> function validate(username) { var t = setTimeout("check('" + username + "')", 5000); } function check(username) { alert('It\'s been 5 seconds..'); } </script> <form action="" method="" onsubmit="return false;"> <input type="text" name="username" /> <input type="submit" value="submit" onclick="validate(this.form.username.value)" /> </form> Inside check() you'd want to perform any checks on the data..
  11. You can get this effect by using JavaScript validation (make sure you're also validating by PHP) and timed events.
  12. The reserved $this variable can only be used inside methods of objects.
  13. I don't know what you're talking about.. My solution will work with any number of arrays..
  14. You'd do it simply like this: $username = mysql_real_escape_string($_POST['user_name']); I don't see why you'd want to preform stripslashes on the input as well.. You'd use that when returning the information from the database if magic quotes are on (which isn't a good idea in the first place).
  15. You never closed the bracket on this line: if ($_SESSION['username']) { And I'm guessing you're also mixing up some brackets.
  16. To answer your question, no it will not check the queue function only once. It will check it each iteration.
  17. You should never reply on a hidden field named MAX_FILE_SIZE. You should be checking the filesize in PHP using filesize(). To prevent mysql injections preform mysql_real_escape_string() on all data before passing it to mysql_query().
  18. I showed you which brackets weren't being closed. To solve your problem simply put 2 more right curly brackets before ?>
  19. <?php $arr = Array( Array('linkname', 'linkurl.com'), Array('linkname', 'linkurl.com'), Array('linkname', 'linkurl.com') ); $var = implode("\n", array_map(create_function('$a', 'return implode(" || ", $a);'), $arr));
  20. $end errors are almost always caused by forgetting a bracket. In your case you're missing 2 brackets that you need to add to the end of your PHP. Both of these statements aren't be closed: if ($submit); { //check for existance if($name&&$surname&&$email&&$username&&$password&&$confirmpassword) { And for the future make sure you use [ php ] or [ code ] tags (without the spaces).
  21. So like the opposite of what I did? I don't really follow what you're saying..
  22. You want to use explode(), not implode(). implode() takes an array and makes a string, the opposite of what you want to do. <?php $file = <<<FILE linkname || linkurl.com linkname || linkurl.com linkname || linkurl.com linkname || linkurl.com FILE; $arr = array_map(create_function('$a', 'return array_map("trim", explode("||", $a));'), explode("\n", $file)); echo "<pre>"; print_r($arr); echo "</pre>"; Output: Array ( [0] => Array ( [0] => linkname [1] => linkurl.com ) [1] => Array ( [0] => linkname [1] => linkurl.com ) [2] => Array ( [0] => linkname [1] => linkurl.com ) [3] => Array ( [0] => linkname [1] => linkurl.com ) )
  23. Np, just remember to always mark topics as solved once the issue has been resolved. There's a button on the bottom left to do so.
×
×
  • 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.