Something to create/code [PHP]

I’ve been gradually getting to grips with the basics of PHP and I would say that my theory side of things will hold up pretty well.

However, I doubt I would be able to do much in practice and I was wondering if anybody could suggest some things that aren’t hugely complicated and won’t take forever to create/code but that will force me to work a little harder with PHP. It could even be something that’s been created in the past (not linked in with mySQL though please - haven’t reached that yet).

[I have one idea of my own that I have the basics of but it’s going to take time to put together (don’t know enough to complete it) so I need some shorter projects to keep me going.]

Thanks,
JK.

Try doing include tags. Doing form requests and posts, if and else statesments and switch/case statements.

Thanks DP. However, I can do the majority of that in theory - it’s application of it that is my problem. I was asking for ways in which I could practice these… just saying “do XYZ” doesn’t really help because I can’t think of where I would really want to use them.

I’ve used “post” in a php mailer form and I’ve used include for different parts of a website that I’ve been playing with. Hmmm… If you come up with any more specific ideas, please post here and let me know :). In an hour or two I will hit the next couple of pages of the php book I’m using (it’s great for explanations but not that useful for implementation).

Thanks again,
JK.

[Sorry if I appear ungrateful but I’m not sure what else I can say :-]

If you already seem to know that stuff then why do you want to play with it some more. Doing web programming is a lot like Flash, you need an application. All I could say is try developing a highly agile site where you can use PHP to change the style on the fly and stuff.

make a textfile-based guestbook and then another mySQL one… :slight_smile:

Hmm… that would probably involve using arrays, include, and the read/write for a text file. I’ll certainly need to do a little work for that one :). And then of course the mySQL version will require a lot more work but the first version should get me going… :beam:

Thanks a bunch ahmed :thumb:,
JK.

reaches for PHP book and txt file

Well, I’ve got the general structure of the textfile based guestbook running. I’ve set up a few If else statements in-case people don’t enter their message or their name and to avoid problems with the links if they don’t enter a website URL. I’ll tidy it up tonight or tomorrow morning, upload it, and post a link in this thread.

However, one problem that I can’t seem to get around is when a user uses ’ in the text they post, you get a ’ in the text file that it is written into which means that it comes up like that when it’s displayed in the guestbook.

As I understand it, I should’ve been able to solve that problem with strip_tags but it didn’t seem to work. Here’s an example of how I tried to use it:

$name = strip_tags($_POST["name"]) ;

And I’m not getting any errors when using this but I still get a \ before ’ or " :-\

Now that I think about it, there was one other problem: Is it possible to limit the number of characters that can be entered into a text area? Or do you have to use a text input box in order to be able to set the maximum number of characters?

[I guess you could use an if else statement to check the length of the relevant string and then have it print a certain message instead of processing the post, to let you know that you have entered too many characters. However, that’d mean you would probably need to add a small explanation regarding your guestbook (which would be a real waste of space on a webpage)].

Thanks for any and all help,
JK87.

JK87,

What reference material did you use for learning PHP? I’m way down there on ground zero, in terms of knowledge of PHP but am looking to read up on it…

At some point in my life I would like a message board for my site on Eric Cantona…

samba_7

samba, do you know any other programming languages? (ActionScript, or JavaScript, for example)

samba_7, I wouldn’t say that I know a LOT of PHP but what I do know, I feel quite confident with. I found a thread a week or two ago in which Jubba and a couple of others strongly recommended “PHP: Your Visual Blueprint for Creating Open Source, Server Side Content”.

I haven’t read that much of the book (around 100 pages out of 265) but it’s proven to be very useful and accurate. One problem I found was that it doesn’t really set you any tasks and the like which meant that I could only read so many pages before needing a break. However, if you know what you want to make (e.g. that message board for your website) then you can always work towards that and start by creating small parts of it using what you know.

The explanations in this book tend to be excellent and it also makes use of numerous screenshots to help visually. I strongly recommend this book :).

JK.

Actually I do…

In College I spent 2 years studying Visual Basic 5. I started using Flash about 3 months ago and have been looking at the similiarities of Actionscript to VB… apart from the way they change the If/Else statements - I pretty much understand what is going on.

It’s only recently where I actually became interested enough to buy a couple of books. The best thing I did was to find Kirupa.com

I’m hoping that my end result (currently reading about SQL) will be to create a simple forum where people (Eric Cantona fans) can post messages to each other. I know, as a beginner that is a fairly large mountain to climb - but - I know I can do it… it’s just a case of putting the time in.

Any help is always much appreciated and like I said Kirupa.com is the perfect place.

samba_7

:cool:

If you know other programming languages, I wouldn’t buy a book. PHP is actually quite a simple language to learn.

First I would get a IDE for PHP, like Dreamweaver MX or PHPEdit[link], which is freeware. This can be quite helpful for a beginner, as it pops up a list of functions.

Then I would find some tutorials. Start at the sticky thread at the top of this forum. Take all the introductory tutorials you can find. I quite like the ones at DevShed.com[link]. If you have any problems, just post here and someone will get back to you as quickly as possible.

Roger that!

Books are always good reference tool. I always find myself :trout: because there is something so simple that is so very effective.

To be honest though, there are alot of “Real Life” applications posted on Kirupa and other tutorials, that give you the information you really need to know! A purpose! Sometimes the books are filled with everything you need to know… but can’t actually apply to real situations.

My Site: has had 33k hits since it started… I get emails regularly from people all over the World… I would like to have a forum set up so people can chat and post things like pictures…

All your help/advice/reply’s are much appreciated.

samba_7

All you need is time…

Well, if you have a mySQL database with your hosting, why not use existing forums such as phpBB2 or vBulletin? That would mean that they are set up almost immediately and is likely to greatly reduce the chance of error. If you need links, just use http://www.google.com and search for phpBB2 or vBulletin.

[I don’t mind that this thread was hijacked but it is a little annoying that I had a question that I posted before it was hijacked and chances are, it won’t be answered unless I point it out.]

*Originally posted by JK87 *
**Well, if you have a mySQL database with your hosting, why not use existing forums such as phpBB2 or vBulletin? That would mean that they are set up almost immediately and is likely to greatly reduce the chance of error. If you need links, just use http://www.google.com and search for phpBB2 or vBulletin.

[I don’t mind that this thread was hijacked but it is a little annoying that I had a question that I posted before it was hijacked and chances are, it won’t be answered unless I point it out.] **

I think you did just point it out again and it is a question that you need to answer for yourself. Just look @ what you do in your everyday life and how you can improve it with PHP. :wink:

*Originally posted by samba_7 *
**My Site: has had 33k hits since it started… I get emails regularly from people all over the World… I would like to have a forum set up so people can chat and post things like pictures…

All your help/advice/reply’s are much appreciated.

samba_7 **

That is 33k refreshes not unique impressions. :slight_smile: These numbers can be quite inflated due to say everything pointing back to your homepage so whenever some hits ‘return home’ it will add another hit. Also, I’ve never heard of this guy but then again I’m American, I don’t know about anything outside my bubble of safety… :slight_smile:

lol… even I’ve heard of Eric Cantona and I don’t even like football (soccer for you Americans ;)).

And I would recommend re-reading my last 2 posts before samba_7 posted… that/they were the questions I was referring to :stuck_out_tongue: :-.

*Originally posted by JK87 *
**Now that I think about it, there was one other problem: Is it possible to limit the number of characters that can be entered into a text area? Or do you have to use a text input box in order to be able to set the maximum number of characters?

[I guess you could use an if else statement to check the length of the relevant string and then have it print a certain message instead of processing the post, to let you know that you have entered too many characters. However, that’d mean you would probably need to add a small explanation regarding your guestbook (which would be a real waste of space on a webpage)].

Thanks for any and all help,
JK87. **

Yes there is. You can either do this on the front or back-end. You can use PHP on submit to check the length of the string or your can do it in Javascript on the front-end using a length. If you really want to do this in Javascript I might be able to help you.

Click on the post reply button and as you can see there is a [check message length] button, click on it and you will see how it check the message length.

I think I’ll toy around with the PHP method seeing as the whole purpose of me even asking for something to do was to keep me occupied with PHP :). Thanks for the info. DP, I’ll see if I can crack it with PHP :thumb:.

If anybody knows how to solve the other problem (the problem with ’ and " being converted to ’ and " by PHP) then please let me know :wink: [see my post near the top of the previous page (4th post of mine in this thread I believe)].

JK.