Re: Newbie questions:
| From: | Joe Stump | Date: | Tue, 19 Dec 2000 09:53:10 +0000 |
| Subject: | Re: Newbie questions: | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31014@lists.php.net to get a copy of this message | ||
> 1. The website allows people to create projects. Each project's URL should
> be of the form www.domain.com/projects/project_name/index.php. So I guess
> php would have to create a project_name directory containing project
> pictures, files, etc, when the project is created. How in the world can I
> make it do that?
mkdir() function: http://www.php.net/mkdir
> 2. The website displays user-submitted news items stored in mySQL. Each
> news item can optionally be associated with a project or a project event.
> So if I wanted to go to a news item directly, I would go to something like
> www.domain.com/news/news_item_name. How do I get php to create the file
> news_item_name when the news is fetched from a database? And I still want
> everything to be searchable (eg, find all news items containing search
> string from project name).
You want to look into "Force Type"'s - there is a great article on PHPBuilder
about it: http://www.phpbuilder.com/columns/tim20000526.php3
> 3. Functions don't have defined to be on the same file as where they're
> called, do they? How can I tell php that a function in on another file?
No - check out include() at: http://www.php.net/include -
you put all of your
functions in a main file and then include() them in each file that will be
using them.
> 4. Classes and variables aren't remembered through different pages, are
> they? Would I want them to be remembered through different pages?
To answer your first question - they can be "remembered" but you kind of have
to "remind" the page what the variable is. You can set cookies (check out the
setcookie() function) or pass variables (ie index.html?foo=bar&test=1). There
are instances where you would want them to be remembered (ie. sessions).
> 5. And just making sure: if two people access the same web page that is
> generated by a php script, there is a seperate instance of the variables for
> each calling of the script, right?
Yep.
--Joe
---
Joe Stump
PHP Programmer
www.Care2.com