alankeoy Posted April 6, 2008 Posted April 6, 2008 hi, i am learning on php and sql coding. i have a static website but need to have forms to be inserted. i am not entirely sure where to start. for example. i need to create a message reply to me where user will enter their email, name and message. 1) is differnt web hosting serivice will require me to rewrite the whole coding ? 2)how can i view the database ? thanks
evildrneil Posted April 6, 2008 Posted April 6, 2008 First check that your host supports PHP and MySQL (assuming that's the DBMS you are using!) then you will need to check whether they have mod_php available to you or whether you need to write CGI scripts. Once you have ensured that your host supports what you need then take a look here: http://www.php-mysql-tutorial.com/php-tutorial/using-php-forms.php for a quickie overview As for the database viewing that will depend on the setup of the webhost. Personally I prefer to have shell access and go in via the monitor however many web hosters won't allow that and instead use PHPMyADMIN or similar.
alankeoy Posted April 6, 2008 Author Posted April 6, 2008 thanks. i am abit confuse between PHP and MySQL when i create a form let say in macromedia which have name, email and mesasge and save as query.html - the coding inside is it mysql ? then i will create a php call query.php - wht is the main function ? then i have things like db.opt, .frm, .MYd....wht is the funtion and how do i write it ? sorry for being ignorance but if anyone can have the step by step. currnently i am having difficulty of even the basic step and conneting them together thanks
Ghozer Posted April 6, 2008 Posted April 6, 2008 The method you are describing is NOT MySQL, im not sure what method that is.. mysql uses a database engine, and mysql needs to be installed on your server before hand, you also need to set up a database, and all the rows/columns (tables) etc manually first too..
esme Posted April 7, 2008 Posted April 7, 2008 ignore MySQL for the moment, what you want to do is write a PHP routine that will output HTML that displays a form on the users browser when i create a form let say in macromedia which have name, email and mesasge and save as query.html - the coding inside is it mysql ? no the coding inside is in HTML, the text in this file is basically what you want to make query.php output when it is called also be aware that people who send spam are constantly on the lookout for email forms that can be exploited to send spam, I suggest you investigate the use of CAPTCHA images to secure the form, the march issue of PCPlus (issue 266) had a nice piece showing how to generate and use them and also verify the users input to the form before passing them to the sendmail routine
sccsux Posted April 7, 2008 Posted April 7, 2008 I suggest you investigate the use of CAPTCHA images to secure the form Like the one I posted here over a month ago:thumbsup:
esme Posted April 7, 2008 Posted April 7, 2008 Like the one I posted here over a month ago:thumbsup: oo I forgot about that one cheers
Ghozer Posted April 7, 2008 Posted April 7, 2008 Heres one I made and use on my own sites -- http://www.sychosis.com/includes/captcha.php
Phanerothyme Posted April 7, 2008 Posted April 7, 2008 I'd avoid using CAPTCHA and instead opt for other, less intrusive, Turing tests.
adaline Posted April 7, 2008 Posted April 7, 2008 What you guys on about, you dont need any scripts to produce a form, just one to process it. As alankeoy was going, you have an html form that posts to a php script called query.php; Its inside this script that php would interact with the database through a language called SQL (structured query language). It sounds to me like alankeoy can use some basic knowledge of web applications, perhaps a book on web development from the library or a bookstore will make this all much clearer
Recommended Posts
Archived
This topic is now archived and is closed to further replies.