SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Second Submit button

    I am having an issue getting the second submit button to be recognized. What happens is when a search is made on the database, it outputs the records into an HTML table with a edit button on the end of each line, which I am trying to get it to pull up the record into another form that will allow me to edit the fields and then save them back to the database.

    I have gotten it all the way to the point where the table is generated with teh edit button on the end, but when I clicked the button, it's not recognized as being hit.

    I am not sure how the best way to post this, because the code is getting awful long.

    I left out the code that generates the table to save space, but if necessary i will post it.

    Here is the Code for the button that it geneartes...

    Code PHP:
    if ($_SERVER['REQUEST_METHOD'] != "POST")
    	{
    		include "search.html.php";
    	}
    else if (!empty($name))
    	{
    		$name = ($_POST("value"));
    		echo($name);
    	}
    else
    	{
    		$pagetable = NULL; 
    		$pageinfo = array();
    		if(!empty($_POST['searchid']) || (!empty($_POST['pagename'])))	
    					{
    						//generates HTML table		
    					}	
    		else $error = "You must enter search terms";				
    		include "searchres.html.php";
    	}

    and here is the button that is generated at the end of every table row...

    Code PHP:
    <input type="submit" name="edit" value="Edit Page #' . ($row['id']) .' "/>
    	}

    THank You for the help...

  2. #2
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is much easier to use a link instead of a button
    as easy as
    PHP Code:
    <a href="edit.php?id=222">Edit</a
    if you want it strictly to be a button, you have to make it with name. Like
    PHP Code:
    <input name="edit[222]" ... > 

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You for the reply.

    I am still new to PHP programming so could you help me how that link calls the page I need.

    Thank You

  4. #4
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you just click it

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was referring to how does the script call the actual page, but after some experimenting with it, I figured it out...


    Thanks again for you help... I appreciate it.

  6. #6
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    script does not call the pages
    your browser does


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
  •