Skip navigation
Currently Being Moderated

Delete page malfunction

Nov 23, 2009 2:14 PM

I have built a number of input forms with PHP admin pages for displaying data and delete pages for the server side script that deletes the entries. These delete links work properly on all of the sites except my own! When I click the delete link I get a blank page with the URL:

http://turtlerockstudiomarketing.com/TRSMdelete.php?id=15

 

 

Check out these pages if you think you can figure it out. They are currently unsecured. It has to be something silly, right?

 

http://turtlerockstudiomarketing.com/TRSMadmin.php

http://turtlerockstudiomarketing.com/TRSMdelete.php

 
Replies
  • Currently Being Moderated
    Nov 24, 2009 10:15 AM   in reply to ED-H

    Without posting your code and verifying the data exists, there's no way to know for sure what is wrong.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 24, 2009 11:28 AM   in reply to ED-H

    ED-H wrote:

     

    When I click the delete link I get a blank page

    When you get a blank PHP page, it means there's an error, but that the display of errors has been turned off. There's a more detailed explanation in Why is my PHP page blank? in the Dreamweaver FAQ.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 28, 2009 6:03 AM   in reply to ED-H

    ED-H wrote:

     

    Here's the code:

    There's nothing immediately obvious in the code. Did you use the technique described in the FAQ article to turn on the display of errors temporarily?

     

    It's possible that Connections/trs.php is not accessible, or that there is something in that file that's causing headers to be output, thereby preventing the page from redirecting to TRSMadmin.php.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 29, 2009 11:52 AM   in reply to ED-H

    ED-H wrote:

     

    Adding the error display script results in this:

    Parse error: syntax error, unexpected ':' in /home/turtlero/public_html/TRSM/TRSMdelete.php on line 1

    Line 1 now contains the script that I asked you to put in to turn on the display of errors. Unfortunately, there was an error in that script. I used a colon instead of a semicolon. Sorry about that. I have now corrected the code in the Dreamweaver FAQ. Correct your version, and try it again.

    If my database connection, Connections/trs.php, were not accessible, how could I be getting input on my admin page?

    The path could be wrong. The whole point of displaying error messages is to try to find out where the error is being triggered. Until then, it's purely guesswork.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 1, 2009 6:38 AM   in reply to ED-H

    If you right-click that page, and view the source code, you'll see that it contains the HTML code for the page. That means it's loading correctly. Looking back over your previous posts, it's now obvious why it's not working. PHP is a case-sensitive language. The example URL you gave uses id in lowercase, but the code in your Delete Record server behavior is looking for ID in uppercase.

     

    Change the delete link to use uppercase, or change the Delete Record server behavior to use lowercase, and it should work.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 1, 2009 4:15 PM   in reply to ED-H

    ED-H wrote:

     

    Remember back at the beginning of this mess when I said it had to be something silly?!

    Case-sensititivity is very important in PHP, but it's certainly easy to miss.

     

    Thanks, David. I just bought one of your books. You've been a great help in my php adventure.

    Thanks for buying. Hope you find the book helpful.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points