Jump to content

Review,News Script


shujjah

Recommended Posts

I would be grateful if anyone could help mei need a reviews and a news script for my gaming website written in php and sqli want a reviews,and a news script. i mean i want a script that will allow me to add reviews and some other editors to ad reviews or news. but it shoud not be like i have to create a new html page every time for a review but it should something like each review or news will have its own id and when you wil open it it will open like this http://yoursite.com/review.php?id=1 or something like that anyone willing to help me and plz give me the link if there is any script not exactly like this but like this for me do download and i might edit it a bit with your help of course :) :)

Link to comment
Share on other sites

Well I'm not sure about anyone else, but my time is generally spent on for-profit projects, I can't create a project like this as a favor. If you want to start it and ask questions I'm sure we can answer them, or else someone else might be looking for something to do.

Link to comment
Share on other sites

Maybe so, but I never had the experience either until I did it. Something like this really isn't all that difficult, it just takes time. This and nearly every other web application out there are nothing more then database input/output. All you really need to know is how to put data into the database, and how to get it out. There are some other bells and whistles like keeping track of a user who is logged in, but you can think of any page in the thing as either an input page or an output page. The pages on the back where admins add a review or news story are the input pages, they just add data to the database (or update it), and the pages that the users see are the output pages, they just read data from the database and format it on the page. The hardest part about the whole thing that requires the most experience is designing the database. If you want to code this, I'll be happy to design the database for you.But, if you want to learn how to program, you've got to start somewhere. If you don't want to learn how to program, then that's a different story.

Link to comment
Share on other sites

Well, you start with the database. But first things first, if you don't have PHP or MySQL installed on your computer you'll probably want to do that, so that it's easier for you to test things out. I prefer to install PHP and MySQL manually, but there are programs that will install both of them for you. You should be able to do a Google search for something like XAMPP to find an installation program.That's a fairly large step (getting PHP and MySQL working), but once you do that you can set up the database using phpMyAdmin, which is an admin interface for MySQL. I would probably set up these tables in the database:

users  id			int   autonumber	primary key  username	  varchar(20)  email		 varchar(100)  password	  varchar(40)news  id			int   autonumber	primary key  title		 varchar(200)  body		  text  date_added	int  author		intreviews  id			int autonumber	  primary key  title		 varchar(200)  body		  text  date_added	int  author		int

Things like datatypes (int, varchar, text) you'll see in phpMyAdmin, and there are also places for the autonumber attribute (I can't remember if phpMyAdmin calls it autonumber, or auto_increment, or which), and primary key is also an option for each field. That is a pretty basic setup. Right now both the news and reviews tables have the same structure, but you could change that if you want to add things. For example, you might want to add a "link" field to the reviews table so that each review could have a link to something like Amazon or wherever they can see what you are reviewing. Or for the users table, maybe you would want to add a picture filename field so that people could see a little picture of the author when they are reading a news or review article.The way the tables are conceptually set up though is that when you add a new user, you ask for a username, email address, and password. You can validate them (make sure the username is longer then 4 characters, that the username is not already in the database, etc) and then add them to the database. When you add the password, you will use the sha1 function to encrypt it, which makes a 40-character encrypted password (that's why the password field is set to 40 characters max). The database will automatically assign a number for the id column.When you add a news article or review, the user would type everything up like the title and body text, and when they hit submit the system would check which user they are (for the author field), and also automatically add the timestamp so that you know when the article was added. Then you can set up some type of archive system to only display articles from a certain month or something.That's basically how it's going to work. If you've never worked with PHP before, you'll want to read through some of the tutorials on the w3schools site for PHP, especially the one about forms. All of the input pages for this are going to use forms to send the information to PHP, so you'll need to know how to submit and process a form. Once you know that, then you'll want to learn how to connect and use the database so that you can save the information from the form and read it back out. Once you know that, then you'll want to learn about sessions so that when a user logs in you can keep track of which user is logged in. So, get PHP installed and start running through the tutorials. Post questions if you have any.

Link to comment
Share on other sites

i already have Wamp which has Phpmyadmin and php ok now i wanna know thati have created a database called users but when i went to create a table it asked for the the name and the no. of fields so what shud be the no. of fields.plz explain me step by step how to create teh tables with the help of images if u want ( that will make it a lot easier ).plus i also want to add the genre and the rating to the reviews so that it would be easy for the users to search it .also i would want maybe a serparate username and password the for reviews and news since there will be specific people for only reviews and news .

Link to comment
Share on other sites

First: make a list of functions you'll want to create (on a piece of paper).Then design your databases: what will you need, what data will it have to contain.Your pages will have to either read or send info from/to the database. Your pages will be html/css/javascript. (javascript isn't needed, but may be convenient in the future). Your scripts will have to make queries to the database.Learn about forms.Learn about variables.Learn about queries.Google for any of these words in combination with 'tutorial' until you find something that can teach you the things you'll need to do. Your local bookstore or library will have plenty of information on these topics.And try. And try. and debug. And test. And validate. We can only help you fix mistakes you make during your attempts. If you don't make mistakes, we cant help you. Ergo: you'll get nowhere unless you at least try.If you want something done right, you do it yourself.

Link to comment
Share on other sites

This is the exact same project I started learning with. I googled for tutorials and when i'd found a suitable one I edited using the tutorials here to create a script that worked for me.

Link to comment
Share on other sites

This is the exact same project I started learning with. I googled for tutorials and when i'd found a suitable one I edited using the tutorials here to create a script that worked for me.
To reclaim the bandwagon: the only way to learn about PHP is your own way.
Link to comment
Share on other sites

Why, so you can try to hack it?I listed the tables and fields in my last post. The users table, for example, I listed 4 fields with their data types and attributes. You'll probably want a fifth field in the users table to determine if the user has access to reviews, news, or both. That field can either be an integer or a varchar field (varchar is a "variable number of characters", if you have a varchar(50) field you can store up to 50 characters of text). If you use an integer, you might make rules like if the field is 0 they can't edit anything, if it is 1 they can only edit news, if its 2 they can only edit reviews, and if its 3 they can edit anything. If you make it a varchar field then you just might write "none", "news", "reviews", "all" etc for the value.The genres would probably be a varchar field. When you create a new review you would probably want to have them choose a genre from a dropdown list instead of typing it in, it makes it easier to search that way. For the ratings, you would actually need 2 fields. One would be a "total score", which would be an integer, and the other would be the number of ratings, which would also be an integer. Every time someone makes a rating, like if they rate it a 3, you would add 3 to the total score and add 1 to the number of ratings. To calculate the "average rating", you would divide the total score by the number of ratings. This would be quick and easy, but you wouldn't be able to tell who rated what or stop someone from rating something more then once. If you want to do that, it's a little more complicated because then you need to keep track of which users rated which items, and only allow registered users to rate things.Also, don't call the database "users", it holds a lot more then that. It has a users table, but it also has a table for news, reviews, etc. Call the database something general about the site, like the name of your site or whatever. It's just a database for the entire site, not only users.

Link to comment
Share on other sites

well thnkx justsomeguy for all ur database help. i would be really grateful and anyone experienced in php could tell me that how many scripts i will need for the users,news and reviews and what will each script do ( in detail ) that would be great plz :)

Link to comment
Share on other sites

You will need to know what you want to do.1. Users - They will need to register, login, logout, renew password when they forget, anything extra that comes with registering that a guest will not get like editing a profile, make a blog of their own, etc.2. News - Insert, Update, Select. (Delete can be in there if you wanted it. I don't think you should really "delete" using a script, but you doing it manually yourself).3. Reviews - Who will post reviews, users, guests? Re-read #2. Are you going to try and stop spam, use CAPTCHA? Will you add a rating system, who is able to use it, and will users get to see the results of others? Username (Guest/Anonymous if they are allowed too), date and time they posted?EDIT: Look back at justsomeguy's "code" box with the database tables to get a basic idea.

Link to comment
Share on other sites

Go to phpmyadmin, example http://localhost/phpmyadmin/ look at the left and click the drop down list to see the database(s), choose the one you've been working on. You should now see tables that you created, click on one, now you should see on the right the fields for that table and at the top is some menu links to click. Click on the Browse to see row(s) of information on each field (some may be blank, could be you didn't enter any value into them). To go back to the fields, click on the Structure link.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...