HTML & PHP Form

YASANI

New Member
Messages
3
Reaction score
0
Points
0
Hello everyone;

I am really new in web design and trying to learn PHP!!

Any how, I want to creat a from of course action to PHP and will be using Dreamwaver.

My question is : What is the different between making a from starting as new PHP and as new html page?

does this make a different? if so what features?

I do not want in one of them then find the feature I want in the other.

Any help will be appriciated

YASANI
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
What exactly are you trying to do?
Do you want the form to be on an HTML page then have a PHP page process it (action)?
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
What I seem to understand is : What are the advantages/disadvantages of using php or html for a form?

If so, here is the differences:
When you set up a form on an html page, there is no backend processing. This means that the page is transfered to the client as is: you cannot change it dynamically.
Whereas, when using php, you can construct the page dynamically, so that it includes details that may change.
 

sourfacedcyclop

New Member
Messages
221
Reaction score
0
Points
0
I am sorta confused, I can't say I know a lot about php, but i'm pretty sure you can't make a form which sends data with HTML unless you want to use the mailto function or something. Do you mean having the php inside of the initial html form page where the action of the form is repeating the page and if there is input, processing the form?
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
for example, if you have a form and want to use it to send an email, the form would look something like this:

HTML:
<form name="mailForm" action="process.php" method="post">

<textarea name="message" value=""></textarea>

<input type="submit" value="Submit" />

</form>

this then sends the data from the textarea to process.php:

PHP:
<?php

$message = $_REQUEST['message'] ;        // takes info sent from the form
$sent = mail('you@domain.com','subject here',$message,'From: Your Site');        // attempts to send message and stores result in variable $sent

if ( $sent ){        // if message send succeeds
    echo '<h1>Message Sent Successfully!</h1>';
}
else{        // if message send fails
    echo '<h1>Message Failed!</h1>';
}

?>

you can process your data however you want based on what you're trying to do, but thats how forms work.
 

YASANI

New Member
Messages
3
Reaction score
0
Points
0
Dead Battery Exactlly I want to have html page (with form ) but then to be processed PHP, but advantages xav0989 seem that he answered my question, thanks to all
 
Top