Reply
 
Thread Tools
Old 16-07-2003, 07:35 PM   #1   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
Want to start with PHP

Hi, I want to start with PHP, I know nothing of it.

Well, I have Apache 2 installed, and acting as http server... I wanted to remake all my site to become PHP, but I'm really at a loss of what should I do.... I really can't understand anything the php instructions say, like how to make PHP work with Apache 2 (although I know its still experimental)

Could anyone with patience help me? Thanks

Update: I installed the PHP server, and tested it: works fine.

Now, what I want to do is the following, I need to make a php script that lets me have the logo of the site on top, a navigation bar on the left, and depending on what you click, displaying different info on the main body of the page. Isn't there any template I could use for that?
__________________
REI LIBERATION PARADE
Eva resources en espaņol

Last edited by AchtungAffen; 17-07-2003 at 12:01 AM.
AchtungAffen is offline   Reply With Quote
Old 18-07-2003, 09:30 AM   #2   [permalink]
Nulani
Forum Master
 
Nulani's Avatar
 
Join Date: 16 Dec 2000
Location: Norway.
Posts: 6,840
Send a message via ICQ to Nulani Send a message via AIM to Nulani Send a message via MSN to Nulani Send a message via Yahoo to Nulani
You don't really use php scripts to do the things you have mentioned: All php powered webpages that I have seen uses html for the layout, the php is only there to do all the things html can't do. A weblog, for example.

If there is a template, or a script, that does fulfill your requirements you should be able to find it on hotscripts.com or a similar webpage.
Nulani is offline   Reply With Quote
Old 21-07-2003, 06:48 PM   #3   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
Well, I don't exactly get what you mean, but until now I was using frames in html... but when I link to a specifical page, the whole frame does not load... that'w why I thought in using some PHP to load the html files inside a definite layer inside the main page. I'll try that site you mentioned and see what I can get. Thanks.

Edit: I've been checking that site, but seems like my newbiness weights. I don't know what should I be looking for... how do you call what I'm needing? Can that be done without php?

Last edited by AchtungAffen; 21-07-2003 at 06:52 PM.
AchtungAffen is offline   Reply With Quote
Old 23-09-2003, 06:51 PM   #4   [permalink]
mi6mania
Executive Member
 
mi6mania's Avatar
 
Join Date: 24 Aug 2001
Location: Australia / Sydney
Posts: 372
hey

"when I link to a specifical page, the whole frame does not load" ??
what frame...

if you want the whole page to reload, then use tables.
mi6mania is offline   Reply With Quote
Old 24-09-2003, 12:37 PM   #5   [permalink]
Nulani
Forum Master
 
Nulani's Avatar
 
Join Date: 16 Dec 2000
Location: Norway.
Posts: 6,840
Send a message via ICQ to Nulani Send a message via AIM to Nulani Send a message via MSN to Nulani Send a message via Yahoo to Nulani
You want to include a html page within a html page with the help of php?

PHP Code:
<?php include("PathToFile"?>
I have to admit, I don't really understand the question. Do you know of any pages that looks like what you want yours to look like?
Nulani is offline   Reply With Quote
Old 24-09-2003, 06:39 PM   #6   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
Yep, like the page from evamonkey:
http://www.evamonkey.com/

I might be wrong, but what I was looking for was a page that changed the 'mainframe' while always using the same other page for the left-hand menu. I mean, if I have to change the menu, I don't want to change it from every single page.

About tables... can I still load frames into tables, and when somebody access a page directly (not from the index, wich loads all frames) all the other frames will be automatically loaded?
AchtungAffen is offline   Reply With Quote
Old 25-09-2003, 01:03 PM   #7   [permalink]
Nulani
Forum Master
 
Nulani's Avatar
 
Join Date: 16 Dec 2000
Location: Norway.
Posts: 6,840
Send a message via ICQ to Nulani Send a message via AIM to Nulani Send a message via MSN to Nulani Send a message via Yahoo to Nulani
Ah, you want the image to automatically change each time the page is refreshed.

I believe that is a function that requires a database, such as mySQL, in addition to php. It needs somewhere to read what to load, and where it is.
Nulani is offline   Reply With Quote
Old 25-09-2003, 06:42 PM   #8   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
No no! Not the image, I mean the lefthand menu. Because if I don't use frames, just plain html, and try to have always a menu on the left, if I have to update something from the menu, I have to update every single page on the site! And if I use frames, when someone tries to access a page directly (without the index wich loads all frames) you don't get to see the menu.
AchtungAffen is offline   Reply With Quote
Old 09-01-2004, 01:11 AM   #9   [permalink]
Dastafarin
Forum Master
 
Dastafarin's Avatar
 
Join Date: 7 Feb 2001
Location: my little sanctuary
Posts: 3,752
Send a message via ICQ to Dastafarin Send a message via AIM to Dastafarin Send a message via Yahoo to Dastafarin
Nulani already answered it. What you do is in the cell or whatever that will hold the menu, put:

PHP Code:
<?php include("pathtofile"); ?>
Then, in the file that will hold the menu, you put everything that you want in the menu (but don't put the <html> or <body> tags, as this will be incorperated as part of the page), save it, and upload it to the directory you have specified in the php include.

Then, when you create each page, simply use that little script and all your pages will run that menu and you only have to edit one file.
Dastafarin is offline   Reply With Quote
Old 09-01-2004, 01:51 AM   #10   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
I'll try that later. I'm halfway through my site now, all done with pure html. I think I'll change it sooner or later. What I was looking for, a php template, I discovered is named "Portal". Well, t'seems theres a good one at sourceforge, who doesn't even require Mysql. Although I'll have to install mysql anyways on the server, too bad I don't have a clue how that works...
__________________
REI LIBERATION PARADE
Eva resources en espaņol
AchtungAffen is offline   Reply With Quote
Old 10-01-2004, 12:32 AM   #11   [permalink]
GuGuEaTeR
Forum Master
 
GuGuEaTeR's Avatar
 
Join Date: 29 Dec 2001
Location: Stratosphere
Posts: 2,271
Send a message via AIM to GuGuEaTeR Send a message via MSN to GuGuEaTeR
my site works on that include principle too now. much easier to update things. and no, it doesn't use a database either. although it would have been better. but alas, i have no MySQL support on my webhost...
__________________
mplayer > * media players, period.
GuGuEaTeR is offline   Reply With Quote
Old 10-01-2004, 02:18 AM   #12   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
Does MySQL make things easier or better? Hows that?

One thing more. So the include helps a lot... but how can I make the page to recognize the changes... I mean, how do I make the page recognize the command line? I.E. http://www.mysite.com/index.php#anotherpage (or ?anotherpage, don't know wich one is it)

How does the page recognize the anotherpage command and 'includes' the required page?
__________________
REI LIBERATION PARADE
Eva resources en espaņol

Last edited by AchtungAffen; 10-01-2004 at 02:20 AM.
AchtungAffen is offline   Reply With Quote
Old 10-01-2004, 02:30 AM   #13   [permalink]
GuGuEaTeR
Forum Master
 
GuGuEaTeR's Avatar
 
Join Date: 29 Dec 2001
Location: Stratosphere
Posts: 2,271
Send a message via AIM to GuGuEaTeR Send a message via MSN to GuGuEaTeR
that's environmental variables. make the page check if there's anything at the end of the browser address (after ? that is) and program to load which pages. and if it's the wrong one, load a default or just an error page.

mysql would in my thought make things much more safer. it's because i currently am dependent on flat-file database, which imo sucks. mysql would provide a much better management and security i say.
__________________
mplayer > * media players, period.
GuGuEaTeR is offline   Reply With Quote
Old 10-01-2004, 03:18 AM   #14   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
Originally Posted by GuGuEaTeR
that's environmental variables. make the page check if there's anything at the end of the browser address (after ? that is) and program to load which pages. and if it's the wrong one, load a default or just an error page.
Yes, but how do I do that? I have no idea on using PHP yet!
__________________
REI LIBERATION PARADE
Eva resources en espaņol
AchtungAffen is offline   Reply With Quote
Old 10-01-2004, 03:32 AM   #15   [permalink]
Dastafarin
Forum Master
 
Dastafarin's Avatar
 
Join Date: 7 Feb 2001
Location: my little sanctuary
Posts: 3,752
Send a message via ICQ to Dastafarin Send a message via AIM to Dastafarin Send a message via Yahoo to Dastafarin
A simple way is to write it like this to get it to load the addressed page:

for "http://www.mysite.com/index.php?p=address"

PHP Code:
<?php

  
//Variable with the filename for your error page.
  
$e "error.inc";

  
//This part checks to make sure if the variable $p is set. (Remember, variables are case-sensitive)
  
if (isset($p)) {

    
//This checks to see if the file requested exists.
    
if (file_exists("$p.txt")) {

      
//If the variable does exist and so does the page, then 
      //the code includes the page and adds the extension of the page (In this case, ".inc")
      
include "$p.inc";

    
//What happens if the file doesn't exist.
    
} else {

      
//Calls the default error page.
      
include "$e";

    }

  
//What happens if the variable does not exist.
  
} else {

    
//Calls the default error page.
    
include "$e";
  }

?>
Still, this is a very simple script. It would work fine for a small site, but if you plan to use it for a big site, I suggest looking into learning more about PHP to make it much more secure.
Dastafarin is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


New To Site? Need Help?

All times are GMT -4. The time now is 04:26 AM.


Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2018, vBulletin Solutions, Inc.