3 Replies - 856 Views - Last Post: 10 August 2009 - 03:26 AM Rate Topic: -----

#1 Ryanmiller   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-June 09

How to go about making a sort of comment type script?

Posted 09 August 2009 - 05:38 PM

I'm not too great in PHP / MySQL but I've mastered html/css... I'm trying to make a script that allows a user to go to one page, type in information, and then that information is posted onto another page. For example:

On submit.php I would want a form saying:
Name:
City:
Date:
Testimonial:
SUBMIT

and then on testimonials.php, every time someone submits that form, the data is posted on this page in chronological order.

I'm not looking for someone to write me a whole script, I just want to know the best way to go about doing this?

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: How to go about making a sort of comment type script?

#2 RudiVisser   User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,566
  • Joined: 05-June 09

Re: How to go about making a sort of comment type script?

Posted 09 August 2009 - 05:41 PM

Well first of all you should look up how to do queries on a database, setup a database and test inserting/reading data from the database with PHP.

Then setup your submit.php file with those form fields and have a block at the top of it (above any output) that contains something like:
if(isset($_POST['submit'])) { /* The form is submitted */
   // Process code here (validating fields, mysql_query to insert the data)

   // If all is good, redirect them to testimonials.php
   header("Location: testimonials.php");
}


When they submit your form that code block will be executed and it will insert the data and redirect to testimonials.

There are several PHP/MySQL tutorials around just a Bing / Google away :)
Was This Post Helpful? 0
  • +
  • -

#3 Ryanmiller   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 21-June 09

Re: How to go about making a sort of comment type script?

Posted 10 August 2009 - 12:43 AM

View PostMageUK, on 9 Aug, 2009 - 04:41 PM, said:

Well first of all you should look up how to do queries on a database, setup a database and test inserting/reading data from the database with PHP.

Then setup your submit.php file with those form fields and have a block at the top of it (above any output) that contains something like:
if(isset($_POST['submit'])) { /* The form is submitted */
   // Process code here (validating fields, mysql_query to insert the data)

   // If all is good, redirect them to testimonials.php
   header("Location: testimonials.php");
}


When they submit your form that code block will be executed and it will insert the data and redirect to testimonials.

There are several PHP/MySQL tutorials around just a Bing / Google away :)



Ok, thanks I was just making sure PHP/MySQL was the right place to go for a task like this.

Do you think I'll be able to create what I want after reading these two tutorials?:
http://www.tizag.com...sqldatabase.php
http://www.allsyntax...ts-Script/1.php

Thanks.

Also, about MAGEUK, would you happen to have any room for me? I've done tons of graphic work and have built several websites.

Also on your home page, under We Do Website, you might wanna change optimisation to optimization.
Was This Post Helpful? 0
  • +
  • -

#4 RudiVisser   User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,566
  • Joined: 05-June 09

Re: How to go about making a sort of comment type script?

Posted 10 August 2009 - 03:26 AM

View PostRyanmiller, on 9 Aug, 2009 - 11:43 PM, said:

Ok, thanks I was just making sure PHP/MySQL was the right place to go for a task like this.

Do you think I'll be able to create what I want after reading these two tutorials?:
http://www.tizag.com...sqldatabase.php
http://www.allsyntax...ts-Script/1.php

Thanks.

Tizag Tutorials are very good and definitely worth a read yes, that alone will probably give you the skills you need to make it.

View PostRyanmiller, on 9 Aug, 2009 - 11:43 PM, said:

Also, about MAGEUK, would you happen to have any room for me? I've done tons of graphic work and have built several websites.

Possibly yes, but we already have designers. Submit the application form without selecting a position and just type in Further Comments what you're interested in. :)

View PostRyanmiller, on 9 Aug, 2009 - 11:43 PM, said:

Also on your home page, under We Do Website, you might wanna change optimisation to optimization.

We're British not American :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1