turning html to php coding

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Michael Wright
Forum Newbie
Posts: 2
Joined: Fri Aug 01, 2003 10:02 pm
Location: Townsville

turning html to php coding

Post by Michael Wright »

Hi all...

This is my first time dealing with PHP coding how do i change this format to php. what i want 2 do is make this form go to my feedback e-mail could that be possable :cry:


< meta name="GENERATOR" content="Microsoft FrontPage 5.0">
< meta name="ProgId" content="FrontPage.Editor.Document">
< meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>feedbackline</title>
<base target="_self" href="http://www.kewlpcs.com/feedbackline/cgi ... rmMail.cgi">
</head>

<body>

<p>&nbsp;</p>

<p><b>Have you read</b> our
<a href="file:///C:/My%20Documents/My%20Webs/feedbackline.html">Terms & Conditions</a>&nbsp; page?</p>
<p>Please complete the following form ensuring you have selected the relevant
enquiry type.</p>
<form action="http://www.kewlpcscom/feedback_proc.jsp" method="post">
<table border="0">
<tr>
<td align="right" vAlign="top"><b>Name</b></td>
<td vAlign="top">
<input maxLength="50" name="yourname" size="40"> </td>
</tr>
<tr>
<td align="right" vAlign="top"><b>Email </b></td>
<td vAlign="top"><input maxLength="50" name="youremail" size="40"> </td>
</tr>
<tr>
<td align="right" vAlign="top"><b>Subject</b></td>
<td vAlign="top"><input maxLength="200" name="yoursubject" size="40"> </td>
</tr>
<tr>
<td align="right" vAlign="top"><b>Enquiry Type</b></td>
<td vAlign="top"><select name="enquiry_type">
<option selected>Feedback</option>
<option>Auctions</option>
<option>online store</option>
<option>Suggestion</option>
<option>Problem</option>
<option>Enquiry</option>
<option>Complaint</option>
<option>Praise</option>
<option>Other</option>
</select> </td>
</tr>
<tr>
<td align="right" vAlign="top"><b>Message</b></td>
<td vAlign="top"><textarea cols="50" name="body" rows="10"></textarea>
</td>
</tr>
<tr>
<td align="right" vAlign="top"><b>Feedback Relates To</b></td>
<td vAlign="top">
<input CHECKED name="regarding" type="radio" value="Auctions">Kew Pc's
Auctions<br>
<input name="regarding" type="radio" value="Kewlpcs Forums">Kewl Pc's
Forums<br>
&nbsp;</td>
</tr>
<tr>
<td align="right" vAlign="top">&nbsp;</td>
<td vAlign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Send feedback now ">&nbsp;</td>
</tr>
</table>
</form>

<p align="center"><font color="#FFFFFF" size="1">
<span style="font-family: Arial, 'MS Sans Serif', Helvetica, Geneva, san-serif">
<b><a href="#top">Top Page</a></b></span></font></p>
<p align="center"><font color="#FFFFFF" size="1">
<span style="font-family: Arial, 'MS Sans Serif', Helvetica, Geneva, san-serif">
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="file:///C:/My%20Documents/My%20Webs/index.html">Home</a> |
<a href="file:///C:/My%20Documents/My%20Webs/terms.html">Terms</a> |
<a href="file:///C:/My%20Documents/My%20Webs/disclaimer.html">Disclaimer</a> </span></font></p>


<p align="center">
<!--webbot bot="HitCounter" u-custom i-image="1" i-resetvalue="0" PREVIEW="<strong>[Hit Counter]</strong>" i-digits="0" startspan --><img src="file:///C:/My%20Documents/My%20Webs/_vti_bin/fpcount.exe/C:/My%20Documents/My%20Webs/?Page=feedbackline.html|Image=1" alt="Hit Counter"><!--webbot bot="HitCounter" i-checksum="5435" endspan --></p>


</body>

</html>
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

first go and search for good books. there's a few threads here with reccommendations.

second check php.net for the function: mail

added suggestion: dump front page for a good editor: emacs or xemacs

that would be a good place to start.

as you've worded that, it sounds to me like you want us to convert it to php for you
Michael Wright
Forum Newbie
Posts: 2
Joined: Fri Aug 01, 2003 10:02 pm
Location: Townsville

Post by Michael Wright »

First of thinks for the tip

second thing why would i let some do my work for me thats checting and i would not let anybody do my work. i was just giing a smiple html code php i'm not shore how it gose but i think its the same has html rite i'm not shore. all i would not be on this forum asking questions and i think every body has a chace to ask
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

I suggest you read up on why HTML is not programming.
Also you may want to have a look the introductory tutorial at php.net.
php.net wrote:PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.
This a thread about PHP-books, there are others if you need more info.
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

All right, what you want is called a form mailer. This is how you do it:

In your HTML form page, set <form action="formmail.php"> or whatever your script will be called. Then the script will look like this:

Code: Select all

//make sure you know the names of all your variables, this may be wrong
$date=date("F d Y");
$message="From ".$yourname."<br>
Email: ".$youremail."<br>
Comments: ".$yourcomments."<br>
Submitted on: ".$date;
mail ("you@youremail.com", $yousubject, $message,
     "From: formmail@{$_SERVER['SERVER_NAME']}\r\n"
    ."Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n"
    ."X-Mailer: PHP/" . phpversion()
    ."Content-type: text/html; charset=iso-8859-1\r\n");
Then just add your variables to the body of $message.

Sorry for spoiling newbies. :P
Post Reply