Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    design2
    Guest
    Exclamation PHP form with html?
    ive done a tested php form , as a basic intro to php, still on the first few pages..but i want to edit the text color and other properties.

    my form page is fine because its done in html, but the feedback page where it has the php response text is default text. I dont know where to put
    the properties.

    my code is:

    <?php // Script 3.4 - handle_form.php

    // This page recieves the data from feedback.html

    // It will recieve: title, name, email, response, comments and submit.

    print " Thank You " . $_POST['title'] . $_POST['name'] . " for your comments. <br />";
    print "Your " . $_POST['response'] . " response stated: <p>" . $_POST['comments'];
    ?>

  2. #2

    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    You can enter HTML underneath the PHP you've written. So just take out the print "" lines, close the php and make your html document from there. When you want to use the form data in the page (like to print their name) just open a php tag and put what you like. There are lots of ways of doing it

    eg.

    <?php

    mail the data

    ?>

    <html> etc... <body>
    <?php print "Thanks " . $POST['name]; ?>

    [or:]
    Thanks <?php echo $POST['name]; ?>
    </body>
    </html>
    I'm in your forums, writing sentences in a grammatically acceptable manner.

  3. #3

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Or my favorite:

    <?php

    mail the data

    ?>

    <html> etc... <body>
    <?='Thanks '.$POST['name]?>

    [or:]
    Thanks <?=$POST['name]?>
    </body>
    </html>


    Which cuts back on the code a bit

  4. #4
    design2
    Guest
    cool thanks guys, still learning..
    god it took me awhile to get started until i learned my register_globals was off and the tutorial i was following was old and all there $examples i had to write as {$_POST['example']} . php is abit tricky to learn. i mean i aint even into databases yet.

    Design2

  5. #5
    design2
    Guest
    Hey i made a small form and have made the php,
    and its responding, like it gives me the echo commands,
    but its not sending emails, what have i done wrong?
    Please Help, Thanks

    <?php
    $subject = "Ebesign Comment" ;
    $from = $_POST["form_email"] . "\n";
    $name = $_POST['form_name'] . "\n";

    $to = "liamlorigan@woosh.co.nz";

    $message = $_POST['form_message'] . "\n";
    mail($subject, $from, $name, $to, $message);
    echo "To: " . $to . "<br />";
    echo "Subject: " . $subject . "<br />";
    echo "Message: " . $message . "<br />";
    echo "From: " . $name . "<br />";
    ?>

  6. #6

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    PHP.net is your best friend!

    bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]])

    <?php
    mail("joecool@example.com", "My Subject", "Line 1\nLine 2\nLine 3");
    ?>

    <?php
    mail("nobody@example.com", "the subject", $message,
    "From: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
    "Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
    "X-Mailer: PHP/" . phpversion());
    ?>


    So in other words:

    $subject = "Ebesign Comment" ;
    $from = $_POST["form_email"];
    $name = $_POST['form_name'];
    $to = "liamlorigan@woosh.co.nz";

    $headers = "From: $from\r\n" . "Reply-To: $from\r\n" . "X-Mailer: PHP/" . phpversion());

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


    Cheers!

  7. #7
    design2
    Guest
    Cool :)
    hey much appreciation Murlyn, that worked. but i foundd my problem i forgot a ; dont u hate that? so i got my form running on my server, but my computer has to be on and apache running for the php to work yeah, so my new question is do you know any free php hosting place?
    Oh and Murlyn, have u done a php? if so, whats the url, id like to see what you can do..

    Design2

  8. #8

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Ok well.. don't laugh at my site because I just don't have time to work on it, but if you go to http://www.baskettcase.com you'll see a list of some of the stuff that I have done. I can't show you the administration for then though since they are my clients and I can't give certain business secrets away But most of those urls' have a really nice backend on them. the HawaiiHealthGuide one, is only one file per page, for 6 different domains.. which is pretty smooth I thought

    Anyways have fun!

  9. #9
    design2
    Guest
    Murlyn: you must be a good programmer/ coder.

    hey i found a free php host, no banners or anything, the server is a little slow but thats ok , the url is http://www.siriusdns.net/ setup Demo account. dont know how long for though.. i got mine at www.ebesign.siriusdns.net and the php works through their servers so it doesnt depend on running your own server and keeping it online.

  10. #10

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Well it is what I do for a living, so hopefully I am pretty decent at it Good luck with all of that!

  11. #11
    design2
    Guest
    how do i close a thread i started?

  12. #12

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    You can't

  13. #13
    design2
    Guest
    what why? so all the threads, eva posted just stick around in the database and waste space? well thats stupid. sort it out mac-forums.com

    Design2

  14. #14

    witeshark's Avatar
    Member Since
    Mar 09, 2004
    Location
    Miami FL
    Posts
    2,860
    Specs:
    G4 1Ghz OS X 10.4.7
    This is very interesting thread Design2: The mods can close or merge threads as needed, no worries!

  15. #15

    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    design2, if we close threads they're still in the database. It'd just appear as normal except nobody would be able to post in them.

    If, on the other hand you're suggesting we delete threads to get them out of the database, what happens when somebody has a similar question to yours? Should we have to go through the whole thing again? Surely it would be a better idea to keep old threads around. And we're not exactly running out of space...
    I'm in your forums, writing sentences in a grammatically acceptable manner.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP Contact Form - desparate for help
    By artdir in forum Web Design and Hosting
    Replies: 5
    Last Post: 09-13-2012, 02:06 PM
  2. What is the difference between HTML and PHP?
    By macuser1232 in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 03-22-2012, 06:36 PM
  3. covert html to php?
    By ranyin in forum OS X - Apps and Games
    Replies: 0
    Last Post: 06-09-2010, 03:55 AM
  4. Inserting Images from Local hard drive into html in PHP Site
    By samanthad in forum Web Design and Hosting
    Replies: 1
    Last Post: 09-25-2008, 02:49 AM
  5. Urgent help PHP form.
    By design2 in forum Web Design and Hosting
    Replies: 6
    Last Post: 11-29-2006, 09:30 AM

Posting Permissions

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