Posted on 2011-04-26
Last Modified: 2012-05-11
I have some code below which is used to delete an item row.

Problem is when I run the page which contains the "link code" I get the following error.

Notice: Use of undefined constant page - assumed 'page' in C:\wamp\www\recyclebin.php on line 98

line 98 is <a href='delete_bin.php?pageid=".$row['pageid']."&valueid=".page."' class='a'>delete</a>

<a href='delete_bin.php?pageid=".$row['pageid']."&valueid=".page."' class='a'>delete</a>


//Delete Page Item Permanently
if	($_GET['valueid']== "page"){
	$query="DELETE FROM pages WHERE pageid = '" . $_GET['pageid'] . "'";
	@mysql_select_db($database) or die("Couldn't execute query"); 

Open in new window

Question by:Cheryl Lander
    LVL 8

    Expert Comment

    page not a variable? should it be $page?
    LVL 8

    Accepted Solution

    and if its not a variable and just the text than,

    <a href='delete_bin.php?pageid=".$row['pageid']."&valueid=page' class='a'>delete</a>

    Author Comment

    by:Cheryl Lander
    The value that needs to be passed is "page" but no its not set anywhere.

    it needs to be hardcoded.

    Author Closing Comment

    by:Cheryl Lander
    <a href='delete_bin.php?pageid=".$row['pageid']."&valueid=page' class='a'>delete</a>


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: CSS Specialist

    We don’t have to sell you on the idea of becoming a developer. If you’re you here, you already know it’s one of the most lucrative (and fastest growing) career tracks out there. It’s CSS that allows you to set yourself apart from other web and mobile developers.

    Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now