I have a server with MySQL and want to be able to have maybe a contact form on a website that sends the information that can be recalled.
Sorry this is so general, but how can this be done please?
Cheers in advance
This is a simple project, and a perfect gateway to more complex PHP things. The process is quite simple and can be loosely broken down into 4 or 5 steps.
Step 1: Create a web form (and validate it!)
Step 2: Connect the form to a MySQL Database
Step 3: Write the data to the database
Step 4: Email the data (sounds like this might be what you meant by 'sends the information'
Step 5: Write a simple admin to recall the info.
All-in-all, this is a simple project and makes for a great learning experience, and I'm sure a lot of guys here would be willing to help. Why not take a stab at it with the above help, show us what you've got, and we can help.
Originally Posted by chaz2290
To the OP:
One tip you might find useful, hidden in a lot of documentation and I think is very pertinent to handling form data for multiple selects or checkboxes via PHP:
In your form set the select attribute name value to name so upon submission PHP will store the selected options in an array named $_POST['name'].
Upon submit, reference all options selected via $_POST['options'] and use foreach to loop through it, or whatever you prefer.
<select name="options"> .... </select>
Sorry for the late reply my internet has been down...
Thanks I'll go through the forms now and hopefully will have one up and running soon, I want to be able to get in to web design once I've done my degree and think this is important but unfortunately not covered.
I'll look in to Ajax, notice the links kindly provided by OW don't include a server side form validation which I certainly want.
I have no idea what any of that means! ha, sorry im really new. I'll read go through the links, learn how its done and read that again and will hopefully understand it more.
Thanks fellas ;D
If anyone ever sees (or can guess) the form's action aka landing page, they can launch an attack. So perhaps your client becomes disgruntled or simply wants to see how you handle such an attack so they write a simple form with some malicious code. I'd be surprised if they stay your client much longer!
Originally Posted by chaz2290
Maybe they aren't even intending to attack your server or test you. If there name is 'drop table users they might accidentally destroy your database. http://xkcd.com/327/
There is no magic bullet to PHP form validation. However it's really quite important. Even basic validation (and sanitizing data) can stop your server being owned. I'd advise reading up a bit.
That is sooo cool, ill be using that in future!
Originally Posted by SyCo
In all seriousness I can see where you're coming from, i'll be sure to read up once I've learnt the basics.
heh, just having a laugh. I understand sometimes you just don't know what to google for!
Good luck and see you around.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)