Results 1 to 6 of 6

Thread: HTML/PHP Form 2

  1. #1
    Join Date
    Jul 2009
    Location
    Washington (USA)
    Posts
    94
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Exclamation HTML/PHP Form 2

    Hello everyone!

    I need an error reportfor my site. the last one, made by <name here>, was almost perfect (see it here). However, after a re-model i need something diffrent. I need a submit button that, when clicked, will send an email to me the URL of the page. This will go on hundereds unique pages so i need one that can detemin the URL by itself. If possible, I'd like it to display an alert like message before it is sent saying something like "Before submiting and error report, please close out of your browser and try again.......". Can any one help me?

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    How does JShor's solution (per your link) not work for you? What, exactly, do you need done differently?

  3. #3
    Join Date
    Jul 2009
    Location
    Washington (USA)
    Posts
    94
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default

    not sure exactly... the solution was made to send the url source of an iframe. i'm no longer using an iframe; i need one that will work with a unique page.

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    So your script is going to actually reside on the page that it reports? Use JShor's solution (minus the javascript) and replace the "message" value with the current page url, like so:
    PHP Code:
    <?php

    if(isset($_POST['submit'])) {

    $to "someone@example.com";
    $subject "Page source";
    $message $_SERVER['SCRIPT_FILENAME'];
    $from "someonelse@example.com";
    $headers "From: $from";

    mail($to,$subject,$message,$headers);

    echo 
    "Mail successfully sent";

    }

    ?>

    <iframe src="blah blah" id="sourceFrame"></iframe>

    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <input type="hidden" name="hidden" value="hidden">
    <input type="submit" name="submit" value="Send Mail!">
    </form>

  5. #5
    Join Date
    Jul 2009
    Location
    Washington (USA)
    Posts
    94
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default

    Thanks for the hep. but is there a way to send the pages url instead of the file name?

  6. #6
    Join Date
    Jul 2009
    Location
    Washington (USA)
    Posts
    94
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default

    One more thing, does the file have to be a PHP file? I was currently using the form action="file.php" to send it, but it sends me the php file's url. can it sendmethe prevoiuse pages' URL?
    Last edited by kaos; 09-07-2009 at 06:11 PM.

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
  •