Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Everything posted by fugix

  1. I'm assuming that your two $_POST indices are what's causing the E_NOTICE Most likely this notice is being triggered because your form has not been submitted yet, therefore there are no $_POST indices to send. This notice can be avoided by using the isset() function to check for the post values first. E.g. if (isset($_POST['user'])) { // set your session variable } you can do the same for you other post value
  2. To make sure at the function is actually being called upon submitting, I would simply have an alert() inside of your send_form() function and nothing more. Then once you are sure that the function is being triggered upon the form being submitted, you can be sure that something in the function is faulty and cam troubleshoot from there
  3. What happens when you click on your phpinfo file? Do you have a file in your www directory labeled index
  4. http://www.howtoforge.com/ubuntu_lamp_for_newbies
  5. You aren't telling the browser where to change the field value. You need something like function change_text { var message = document.getElementById("message"); message.value = "test message"; }
  6. I myself prefer using memcache. However there are ways to specify cache times using Meta tags http://us3.php.net/manual/en/book.memcache.php
  7. Create a link to another php page, insert the recipients user id into the querystring to allow it to be used in your form page. I would create another table designed specifically to handle user messages. The typical fields for this would be an primary key, auto-incrementing field, recipient id field, sender id field, message field. Then create a messaging form that upon submitting, will insert the necessary information into your table. Also, create a section that will display messages where the current user id equals the recipient id in your table.
  8. depends on what each servers error_reporting and display_error settings are.
  9. do you both have a directory called "includes" with a file called header.php in it
  10. True, however intval gives unexpected results with integers. It's more designed for strings
  11. This is from php.net display_errors string This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. Value "stderr" sends the errors to stderr instead of stdout. The value is available as of PHP 5.2.4. In earlier versions, this directive was of type boolean. Note: This is a feature to support your development and should never be used on production systems (e.g. systems connected to the internet). Note: Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed. If you wish to set error_reporting or display errors from a different setting other than the default value, you should place the ini_set at the top of your script(s)
  12. On your photo.php page, you will want to grab the query string variable using $_GET['photo'] The only "cleansing" of this variable that really needs done is to make sure that the variable passed through the URL is a numeric value. $photo_id = $_GET['photo']; if (is_numeric($photo_id)) { // do something with the photo_id } else { trigger_error('invalid photo id',E_USER_ERROR); }
  13. You want to install libapache2-mod-php5 Refer here
  14. I would filter user given emails using preg_match() preg_match('/^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/i')
  15. Onclick="window.location.href='http://www.example.com'" Is something like that what you had in mind?
  16. You need to save your php files into your localhost www file. Should be located at /var/www
  17. You will want to add another header. $headers .= 'From: example@example.com' . "\r\n";
  18. Instead of passi variables. Try passing simple strung data to the server. $.post("add-client-info.php", { clientname: "clientname", clientcode : "test" } function(result){ Also, is your add-client-info.php in the sane dir as your executing script?
  19. The message that you reveive tells me that you do not have php properly installed on your localhost server. What directory do you have your php file in
  20. I am not an expert on .htaccess Hecer this sounds like you would need to create a rewrite rule in your htaccess file. Try googling it.
  21. Your submit function looks straightfoward. Have you tried troubleshooting your send_form function. Also, something I noticed is you are using $_SERVER['PHP_SELF'] as your form action. This should be avoided due to CSS vulnerability. Read here for elaboration.
  22. Change this while (!feof($fp)) { $data=true; $line=fgets($fp,128); To while ($line = fgets($fp,128)) { $data=true;
  23. Yes you can redstart your apache server using the shell command. sudo /etc/init.d/apache2 restart
  24. I would advise to always use long tags. <?php instead of short tags. <? To avoid php.ini setting issues on your server. Just a quick tip
×
×
  • 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.