SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why does this not work?

    I added the following to a frameof a webpage with the intention of using a button to run the function, unfortunately it dos not work. I know the function works when fun from a file on its own, but does not seem to work with the buttons, any ideas?

    <form action ="<?php $PHP_SELF;?>" method ="post">
    <input type="submit" name="Submit" value="Serialise Links" >
    <?php
    include "fetch.class.php";
    $spider=new fetchlinks("http://www.anysite.com");
    $spider->show_href(1);
    ?>

    If it helps i can explain what fetch.class is supposed to do, or give you the source code.

  2. #2
    SitePoint Member
    Join Date
    Jul 2004
    Location
    Home
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you only want to execute a function if a submit function has been pressed you can try something like this:

    PHP Code:
    <?php

    if(isset($_POST['inputName']))
    {
      
    // Code to execute
    }

    ?>

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see. Thanks that works, but now i need to replace the URL in:

    $spider=new fetchlinks("http://www.anysite.com");

    with the url of a page that has been browsed to in my frame named "main"

    This brings me to the same problem that i have experienced with other buttons that are getting currently displayed URLs from other frames. Any ideas?


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
  •