Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts 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. 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.

  4. If you have the image id as auto_increment in database it will be unsigned int, in which case it is better to check against

    if (intval($_GET['photo']) > 0)
    {
         // image id is valid
    }
    

     

    ..since is_numeric can take some other values also than normal numbers like +0123.45e6 or hexadecimal notations.

    True, however intval gives unexpected results with integers. It's more designed for strings

  5. 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)

  6. 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);
    }
    

  7. 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?

  8. 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.

×
×
  • 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.