Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    gb3
    gb3 is offline
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How does this email form work w/o a post reference?

    Hi,

    I recently stumbled across a webpage that has the following code for their contact form on their webpage, contact.php:

    <form id="emailform" method="post" action="/contact.php">
    <fieldset id="contact_form">
    <legend>Please fill out the form completely.<br />You will be added to my mailing list unless you indicate otherwise.</legend>
    <input type="hidden" name="sendnow" id="sendnow" />
    <label for="fromname">Name</label>
    <div><input name="fromname" type="text" id="fromname" size="40" value="" /></div><br />
    <label for="from">Email Address</label>
    <div><input name="from" type="text" id="from" size="40" value="" /></div><br />
    <label for="what">Subject</label>
    <div><input name="what" type="text" id="what" size="40" value="" /></div><br />

    <label for="message">Message</label>
    <div><textarea name="message" cols="50" rows="10" id="message"></textarea></div>
    <a href="#" onclick="document.forms[0].sendnow.value='sent';document.forms[0].submit();return false;" id="contact_submit">Send</a>
    </fieldset>
    </form>


    There is no javascript reference or php reference in any other portion of the code to where this contact form points to translate the post information. Any ideas on how the heck this thing works and/or how I can find a form like it?

    I figured the following line might be a clue:

    <a href="#" onclick="document.forms[0].sendnow.value='sent';document.forms[0].submit();return false;" id="contact_submit">Send</a>

    Unfortunately, I don't see any reference to this string or anything similar to it when I search around on Google, etc.

    Hopefully one of you pro's can help?

    Thanks a bunch in advance for reading my post!

    Sincerely,
    G

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,007
    Thanks
    2
    Thanked 311 Times in 303 Posts
    I am not sure what you are talking about, because the form submits back to the same url -
    Code:
    <form id="emailform" method="post" action="/contact.php">
    The only code you see in the browser is the HTML/CSS/Javascript content that is output to the browser from the web server. Any PHP form processing code that might exist on that page only exists and is executed on the server.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    gb3
    gb3 is offline
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply, exactly. Since it submits back to the same url I can't find the code that translates the form. Is there any way to find the location of the script that is getting run here?

    It seems like there has to be some sort of reference to it so that the "send" or "submit" button will know where to send the form information to execute the code to translate it and email it, etc.
    Last edited by gb3; 07-15-2007 at 05:53 PM.

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,007
    Thanks
    2
    Thanked 311 Times in 303 Posts
    The action="..." parameter in the <form....> tag is where the form submits the data to.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    gb3
    gb3 is offline
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Heya, thanks for getting back to me again....

    The action tag is pointing to the same page I'm getting the form code off of, though, and there isn't any reference to any php script or javascript on that same page to translate the code.

    I was hoping I could find the area that contains the email address info, etc etc, so I can modify it and use it on my own home page.

    Does this make sense? Is the form script just invisible or something?

    Thanks again,
    G
    Last edited by gb3; 07-15-2007 at 06:14 PM.

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,007
    Thanks
    2
    Thanked 311 Times in 303 Posts
    PHP code and variables only exist on the web server. Browsing to a .php file causes the PHP code to be parsed and executed on the web server. You only get any output from PHP echo/print/print_r... statements or any static in-line HTML in that file that is outside of any php code.

    The only way to see php code in a .php file is through direct access to that file on the server, using FTP or a hosting account control panel... (or if someone places an additional copy of that code on the server using a file extension that is not parsed by the PHP language engine.)

    If your question is really "what does form to mail PHP code look like?" search the Internet for "PHP form to email" scripts and/or look here - http://www.hotscripts.com/PHP/Script...ors/index.html
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #7
    gb3
    gb3 is offline
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I will research what you just showed me, thanks a bunch for taking the time out to help.

    Have a great day,
    G
    Last edited by gb3; 07-15-2007 at 06:19 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •