New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

PHP form with html?


Post Reply New Thread Subscribe

 
Thread Tools
design2
Guest
 
Posts: n/a

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'];
?>
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
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.
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
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
QUOTE Thanks
design2
Guest
 
Posts: n/a

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
QUOTE Thanks
design2
Guest
 
Posts: n/a

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 />";
?>
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
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!
QUOTE Thanks
design2
Guest
 
Posts: n/a

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
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
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!
QUOTE Thanks
design2
Guest
 
Posts: n/a

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.
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
Well it is what I do for a living, so hopefully I am pretty decent at it Good luck with all of that!
QUOTE Thanks
design2
Guest
 
Posts: n/a

how do i close a thread i started?
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
You can't
QUOTE Thanks
design2
Guest
 
Posts: n/a

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
QUOTE Thanks
witeshark

 
witeshark's Avatar
 
Member Since: Mar 09, 2004
Location: Miami FL
Posts: 2,860
witeshark will become famous soon enough
Mac Specs: G4 1Ghz OS X 10.4.7

witeshark is offline
This is very interesting thread Design2: The mods can close or merge threads as needed, no worries!
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« invisible cookie page counter | My Site (ChiefCodeMonkey) »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Cant see what is typed in html form Chris322 Running Windows (or anything else) on your Mac 3 04-27-2004 02:25 PM
Enabling PHP JGarcia Web Design and Hosting 3 03-05-2004 09:35 PM
Bogus PHP bug on Mac OS X... mark Web Design and Hosting 19 10-03-2003 07:34 PM
html question powermacg4_450 Web Design and Hosting 2 09-09-2003 04:05 PM
PHP help urble Web Design and Hosting 1 08-11-2003 10:22 AM

All times are GMT -4. The time now is 07:29 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?