Add php to website

5 views
Skip to first unread message

Devon Williams

unread,
Jul 16, 2012, 8:14:06 PM7/16/12
to nycresistormi...@googlegroups.com

Hey....I'm very new to php. I have downloaded xampp and have constructed a website in html. Go daddy is my hoasting company. My question is how should I start adding php to the site. I want to add a contact form and a menu check out using php.

motoki hayashi

unread,
Jul 16, 2012, 10:10:10 PM7/16/12
to nycresistormi...@googlegroups.com, nycresistormi...@googlegroups.com
It's very simple.  All you have to do is to change .html extension to .php.  And then you can insert php code directly in the html code you have.  The code must start with "<?php" and end with "?>."  For example, below is a very simple page just puts out 'Hello PHP.'
Just keep in mind not to omit semicolons after each line of php code.

<html>
<head>PHP TEST</head>
<body>

<?php
   echo 'Hello PHP';
?>

</body>
</html>

Now you have php added to your site.  From there, you'd want to decide how you want the contact form to work.
Simple solution is to have php send you an email whenever the form gets submitted.  You need a form written in plain html, and the form should submit to a separate page written in php.  

Following links should show you two key components of a php email form. 

To read values from forms submitted:

To send an email:


Other solution involves MySQL database, but it's a bit more involved one.  Godaddy should give you access to database via their control panel.  I don't recall, but phpMyAdmin should be available.  PHP can then connect to it and write the form data in the database with a credential.  You may want PHP to display the data too.  In that case you'll also want to protect it with username and password.  
I'd recommend you start with the email solution though.


Some info above might have been obvious, but hopefully that helps.  
I can give you a breakdown on how PHP connects to databases if you want.


Moto



On Jul 16, 2012, at 08:14 PM, Devon Williams <movement...@gmail.com> wrote:

Hey....I'm very new to php. I have downloaded xampp and have constructed a website in html. Go daddy is my hoasting company. My question is how should I start adding php to the site. I want to add a contact form and a menu check out using php.


--
You received this message because you are subscribed to the Google Groups "NYCResistor:Microcontrollers" group.
To post to this group, send email to nycresistormi...@googlegroups.com.
To unsubscribe from this group, send email to nycresistormicrocon...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nycresistormicrocontrollers?hl=en.
Reply all
Reply to author
Forward
0 new messages