Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Script doesn't write to database

    A custom script who's job is to send out a verification email. The verification email get sent, the problem is the link in the email is suppose to write the email address to a database, instead the link gives an error. Recently I moved file paths around, but I don't know if that is the sole issue, as I checked and double checked everything.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Sorry, we are not psychic to know the errors that you got or the issues in your script without seeing it.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There isn't an error per se. When the email link is clicked, I have a text file that tells the user the email address was written to the database, thank you etc etc.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by CardinalQuest View Post
    Recently I moved file paths around, but I don't know if that is the sole issue, as I checked and double checked everything.
    Methinks you missed something. Moving file's around easily breaks a web app.
    Check your apache and PHP error logs. I'd suspect that one of them will indicate that an include or other file scan failed since a path could not be found. Enable your error reporting as well on the script in question to test it out:
    PHP Code:
    ini_set('display_errors'1);
    error_reporting(E_ALL); 
    If something like say a database connection or configuration file fails to load, and you fail to establish said connection, then writing to the database will fail.

  • #5
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How do I enable or view error reporting, and check my apache and php error codes ?

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    The code I posted will enable error reporting inline of the page process.
    Error logs for apache can be found under /path/to/httpd/log, and PHP often stores it in the executing directory, the home profile, or under apache as well. If your hosted check your control panel for the logs.

  • #7
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I checked the error logs within control panel. I looked for a log file in the directory you mentioned, there is nothing. I had to find an error log before with control panel and I couldn't get the info that I wanted, I usually don't rely on control panel for logs. I execute your script once, then go though the motion if the link will communicate with the database and I assume it writes a text file too ?

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Have you added those two line to the top of your script?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #9
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you added those two line to the top of your script?
    If you mean at the very top of the script before or after the opening PHP Tag <?PHP, then yes. When I clicked on the verification email link which looks like this; I continue to get a 404 error.


  • #10
    Regular Coder
    Join Date
    Jan 2012
    Posts
    134
    Thanks
    0
    Thanked 32 Times in 32 Posts
    404 means the page you tried to visit does not exist. You don't have a file named submit.php in your scripts folder. Did you move it?

  • #11
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    404 means the page you tried to visit does not exist. You don't have a file named submit.php in your scripts folder. Did you move it?
    I moved the submit.php to the scripts directory, it was in another directory, previously. If it is a path error, I can't find where it's pointing to the old path.

  • #12
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $Site/submit.php?action=verify&mc=$Code
    What does $Site mean in PHP, maybe this line has something to do with it.

  • #13
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    $Site is a variable that's defined in your script at line number 14
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #14
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If 404 is a path issue, as stated. I've double checked the HTML, and the Submit.php script and all the paths point to the new path that I moved the script to. This is driving me insane.

  • #15
    New Coder
    Join Date
    Jan 2011
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is driving me insane. I can't find what is causing the link not to communicate with the database. It's a simple link within the email that it suppose to tell the user that the link was recorded and then it writes in the database. I've checked everything, already a few times I can't find any faults. Anyone could verify if you have a custom script that the database would have to know of the custom script as well for them to communicate with each other ? I briefly checked PHPMyAdmin and MySQL but I don't have knowledge in this area so I don't know exactly where to look.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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