Jump to content

Do you suggest I learn Javascript?


Luke4123

Recommended Posts

Like it says:$var_name = value;So what do I replace them 2 with?

Link to comment
Share on other sites

Notice how this is basically a normal web page with just a few lines of PHP added. From this basic structure you can go as far as you want.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><?php $myVar = "Luke"; ?><html>   <head>   </head>   <body>	  <h1><?php echo $myVar; ?></h1>   </body></html>

Link to comment
Share on other sites

$var_name - This can be anything you want it to be. Make it descriptive; if it will hold your name, call it $name - for the date, call it $date.value - What do you want to carry in that compartment you just named? Once you've decided, you need to choose an appropriate data type for that information.For now, let's limit your choices of data types to the three basic ones (PHP calls them "scalar").

  • boolean - either TRUE or FALSE - "Did you take out the garbage?" "Have you had lunch?" Those questions require boolean answers.
  • number - any number, either negative or positive - Think simple mathematics.
  • string - text - The two questions I mentioned at the top are strings - strings (or sequences) of characters.

Link to comment
Share on other sites

I learned concepts of JavaScript by making a profit calculator, and concepts of PHP by making a sign up and login page for a useless web site. The trick with learning is to find a project you really want to do, and then make a forum and have someone help you learn until you get it.

Link to comment
Share on other sites

Yeah so at the moment on my website there is a section were you can sign up but I'm not sure of it will work... So if I want to create a forum, I will have to make up my own codes? :)

Link to comment
Share on other sites

Well, you can look through an open source system's like phpBB's, but it is far less confusing to start afresh. I wouldn't, however, suggest doing a forum as a first PHP project - try something simpler like a shoutbox or news system first.

Link to comment
Share on other sites

Like a news system were you members can add there own news? Is that what you mean?

Link to comment
Share on other sites

Yeah so at the moment on my website there is a section were you can sign up but I'm not sure of it will work...
Have you tried it?
So if I want to create a forum, I will have to make up my own codes? :)
Well, the whole idea of building a forum is to write the source, right? Otherwise you could just install someone else's source.
Link to comment
Share on other sites

Yeah true. But isnt there a set code for Log In and Post?

Link to comment
Share on other sites

Don't ask me. I know that

  • every login script uses cookies, but that they can work (limitedly) without them, and
  • every post/comment script uses (or should use) the POST method and a database.

But I've only programmed them (or at least the comment part) when I was first learning PHP, and I'm sure no site would settle for that implementation.

Link to comment
Share on other sites

Ok. I'm confused now. :) Where do you suggest I start? Like if I wanna learn how to make a forum, what things do I need to know/learn?

Link to comment
Share on other sites

Where do you suggest I start?
I suggest making something very simple first - like the aforementioned and postscripted news system.
Like a news system were you members can add there own news? Is that what you mean?
Well, even trying to make a system where you can add news to your site through a form without opening the page in a text editor would be a good thing to attempt :) start small and build up :)
Like if I wanna learn how to make a forum, what things do I need to know/learn?
* How to use functions and manipulate data* How to control output* How PHP can interact with forms through the GET and POST methods* Sessions and cookies, and superglobals in general* How to interact with databases* Some more things, can't think of any atm though
Link to comment
Share on other sites

So how would I do that news thing?

Link to comment
Share on other sites

Btw, moderators, this is a PHP topic now, split please.

So how would I do that news thing?
Well, first you would create a database, I suggest MySQL, and create a table with columns, perhaps id INT(6) NOT NULL PRIMARY KEY AUTO_INCREMENT, title VARCHAR(100), date INT(32), content TEXT. Then, create a PHP page that will be the display page, and select the last five rows (using LIMIT) from the table and display them. Also, create another page that you will use to add news, password protect it with a simple form, and create a form to add the news items. Dates can be added as UNIX timestamps and then parsed with date().
Link to comment
Share on other sites

Well, since you can't download or install PHP 6 at this point I would say start with PHP 5.
Actually yes you can, but only as binaries, you have to install it yourself At the snapshots part of php.net, Though I would still recommend php5 atm, after after you get familiar with php a little start to read up on php6
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...