SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    sweden
    Posts
    646
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    What is wrong here?

    I'm trying an sms service that Ifound.
    A company is recieving the sms from the user and send them to my web page and the number and text is added to my web page url:
    http://www.site.com/message_in.php?sms=test&nr=123

    I want the number and sms to be added to my database, but my script won't add the info.
    Can anyone see what's wrong in my script here?

    PHP Code:
    error_reporting(0); 

    require_once(
    'Connections/connect.php'); 

    $nr $_REQUEST["nr"]; 
    $sms = @urldecode($_REQUEST["sms"]); 

    sqlconnect(); 

    $query "INSERT INTO `nu_sms` (`nr`, `sms`) VALUES ('".$nr."', '".$sms."')"
    mysql_query($query); 

    mysql_close(); 

    echo 
    "Your message have been added"

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    Moscow, Russia
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, it's hardly to say what's wrong, but try to check the following items:
    1. $nr & $sms variables contain proper values?
    2. sqlconnect() creates a connection resource?
    3. '".$nr."' & '".$sms."' are valid within $query string and doesn't produce an error?
    4. mysql_query($query) uses a connection resource to execute $query?

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    what do you get when you comment out the error_reporting() line?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •