andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


??

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> MadLibs
View previous topic :: View next topic  
Author Message
submo
Newbie


Joined: 19 Feb 2004
Posts: 1

PostPosted: Sat Feb 21, 2004 2:11 am    Post subject: ?? Reply with quote

I'm new to PHP and I was wanting to know if there was a tutorial on how to use it on a website anywhere?
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Sun Feb 22, 2004 7:11 am    Post subject: Reply with quote

Hi, and welcome to the board!

Do you mean a tutorial for PHP, or for the MadLibs class?

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Sun Feb 22, 2004 3:34 pm    Post subject: Reply with quote

Well, I guess I could have been a bit more descriptive in that last post, so here it goes...

If you're talking about adding madlibs

It's really easy to use it!! You can use eitehr text files for your stories or mysql. I'll explain text files because it's really easy. First, set up a story file, something like this:

Code:
A simple test title
Yesterday, {OPPOSITESEX} and I went to the beach.  We had a really {ADJECTIVE} time!  We {VERB-ED} with my {NOUN}.


The first line is the title of the story and the rest of it is the story. Save this file in a directory called 'stories' and give it a name something like 'test.txt'.

Now in the PHP file you want to display the madlib game in, put these lines:

Code:
<?php

   require 'class.madlibs.php';
   $ml = new madlibs();
   $ml->useFS('./stories', '.txt');
   $ml->displayMadlib();

?>


And that's it. Should pull out a random story if you have more than one story file in the directory. Using MySQL is not much harder at all. Post up if you want to know how to use the class with a database.

If you're talking about how to use PHP in general

This really isn't a good place to look for a PHP tutorial. There are many, many, MANY websites out there that can give you a headstart. Here are a few listed:

http://www.php.net/
http://www.evolt.org/
http://www.sitepoint.com/
http://hotwired.lycos.com/webmonkey/
http://www.hotscripts.com/
http://www.zend.com/

And there are a whole host of others too - just search on Google (or your prefered search engine) for more.

HTH

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> MadLibs All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group