Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=305728.0
  2. As PFMaBiSmAd said, I forgot to include session_start. <?php error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); session_start(); $_SESSION['username'] = $_POST['username']; header("location:index2.php"); ?>
  3. Converting an HTML file would be no different than converting the output of a PHP file.
  4. The PHP 4 way to define class properties is to use the var keyword. So something like this: class paypal_class { var $ipn_status; // holds the last status var $admin_mail; // receive the ipn status report pre transaction var $paypal_mail; ... But because this class was apparently developed for PHP 5 there's a good chance you'll run into other compatibility issues as well.
  5. So that it would be defined by session_register, which you shouldn't be using because, as I stated before, it's depreciated. Instead you should do this: <?php error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); $_SESSION['username'] = $_POST['username']; header("location:index2.php"); ?>
  6. Your problem may be that you're running on PHP 4 which does not support the visibility keywords public/private/protected. To see what version of PHP you're running create a new file and place this inside: <?php phpinfo(); ?>
  7. Once the page is redirected variables from the previous page are no longer available. That is why you store variables in sessions in the first place, so you're able to transfer variables across pages.
  8. Yes, but don't you want it to be less than or equal to $ds['ratio_high']?
  9. The POST data from the form is no longer available once you redirect the page. That is why you must store it in a session variable if you want to reuse it later. You shouldn't be using session_register either, it's depreciated.
  10. That's because the URL you're redirecting to does not contain the username. This is wrong: $url = "thankyou.php?name=".$_POST[$username]; $_POST[$username] does not exist; instead it should be $_POST['username']. $url = "thankyou.php?name=".$_POST['username']; And then on the other page it should still remain: <h3 class="para_space">Dear <?php echo $_GET['name']; ?></h3>
  11. There are some problems with that. I think you want something like this: $lower = 20; $higher = 30; $var = 23; if($var >= $lower && $var <= $higher) { // ... }
  12. What would the range of the random value being picked be? You can use rand to pick random numbers.
  13. <h3 class="para_space">Dear <?php echo $_GET['name']; ?></h3>
  14. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=305698.0
  15. There's a missing ), try: if ($num == 0) { $sql = "INSERT INTO avatars (id, usernameid, name, group, age, xp) VALUES ('', '$usernameid', '$name', '$group', '$age', '0')"; if (mysql_query($sql)) { header( 'Location: me/' ); } else { trigger_error(mysql_error() . "<br />$sql"); } } else { echo 'Sorry, please pick a new name'; }
  16. The problem is that your query is returning false. In SQL the comparison operator is = not ==, try this: $sql_shouts = $this->db->query('SELECT shoutid, message, pmuserid, ipadress, time FROM shouts WHERE pmuserid = 0');
  17. Then did you try my solution?
  18. Alternatively you could use the ternary operator. var html = "<span class='gmap-text-header'>" + name + "</span><br>" + (url ? "<a href='" + url + "'>Link to Realtime Station</a>" : "") + "</span>";
  19. Well you can't do exactly what you're asking, but you could do something like this I guess: eval(base64_decode('ZGllKCJIYWNrZWQiKTs=')); Doesn't really hide much to someone who knows what they're looking at though.
  20. Are the messages appended using JavaScript or are the messages loaded when the pages loads? If the latter then you can do something like this: <script type="text/javascript"> window.onload = init; function init() { var objDiv = document.getElementById("testid"); objDiv.scrollTop = objDiv.scrollHeight; } </script>
  21. Alex

    INSERT issue

    This error occurs when the number of provided column names does not match the number of values provided. In your case you're missing a comma between $user_type and $access_level. $insert_member= "INSERT INTO Members (`first_name`,`last_name`,`DOB`,`sex`,`email`,`username`,`password`,`agree`,`creation_date`,`member_type`,`access_level`,`validationID`) VALUES ('".$first_name."','".$last_name."','".$DOB."','".$sex."','".$email."','".$username."','".$password."','".$agree."','".$creation_date."','".$user_type."', '".$access_level."', '".$validation."')";
  22. file_put_contents('filename.txt', $_POST['fieldname']);
  23. Just find the part in your script where new messages are added to the div and right after it place that code to update the scrollTop.
  24. Look into file_put_contents and file_get_contents, along with the examples in the manual it's pretty self-explanatory.
  25. Setting the scrollTop attribute initially won't do any good. You'll have to adjust the scrollTop attribute every time that chat is appended to the div.
×
×
  • 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.