News:

Join the Facebook Fan Page.

Main Menu

Learn PHP

Started by Microcyb, August 18, 2003, 04:58:26 PM

Previous topic - Next topic

Microcyb

This is for Newbees trying their hand at PHP.
I know this is for Yabb{*COUGH*COUGH*} simplemachines forum, but you can learn a lot from trying your hand at PHP.
http://www.hotscripts.com/?RID=128439
Hotscript is a cool site to learn the newest and coolest PHP stuff on the net.
http://www.microcyb.com/?m=c&c=36
This is my personal tutorials to help teach people a few things about PHP, and MySQL.

If you other have stuff to post, like cool sites you should add them to the list.

Microcyb

Of course I am looking for people to ask for more tutorials.
I have been writting them as people request.

As Jeff knows I have been writting PHP scripts left right and backwards to learn everything I can.

So if you want to learn something tell me, and I will find a way to do it, and publish what I find on my site.

Seph|roth

Quote from: bostasp on August 18, 2003, 05:15:20 PM
Quote from: Microcyb on August 18, 2003, 05:09:02 PM
So if you want to learn something tell me, and I will find a way to do it, and publish what I find on my site.

don't say that... i'm in desperate need to learn php...
:D so am I ... but where to start  ::) ??? * confused *

My problem is.. a lot of site offer newbie tutorials.. but they're all too basic and all the same, learning you how to declare a variable and what a string is etc.. i'm really past that.

But it's really hard to find tutorials that take it up from that point, it seems like you can only find really basic tut's and very profession tut's  >:( :'(

Seph|roth

Quote from: bostasp on August 21, 2003, 07:16:02 PM
im just gonna get a book for 40 smackers, and sit in bed for days and learn
1st of all: practice makes perfect > so don't go sit in bed or you'll never learn it  ;) (well, err.. unless you have your comp in your bed LOL  :P)

2nd: errrr .. i forgot  >:( dammit

Seph|roth

no kidding... so you basically live in your bed  ;D that must be convenient  :)

Aquilo

Quote from: bostasp on August 21, 2003, 07:27:04 PM
The thing is... my computer basically is in my bed  :P

hehe I gata get my bed back out of storage! My desk and char are so comfortable ;D
for me my desk and char for my computer and me ;D, a couch, tv stand and tv, and dresser makeup the most I need for my bedroom :D

befor I got marred I didn't have room for a bed with all that and my huge Italian drafting table so I slept in my computer char. I miss my computer char. :(

eFishie

Nice tutorials, but I didn't see one for PHP frames. You know what I mean, a single web page that has a URL like index.php?page=contact.

And it pulls content from contact.txt.

I think that would be handy (even though I know how already).
--Jon

Abstraction Point Electronic Music Community - We don't bite! Really! I promise!

Check out my newest song: Alive

Aquilo


<?php
include("header.php");
switch(
$_REQUEST["page"])
{
   case (
"contact") :
      include(
"contact.txt");
   break;
   case (
"extras") :
      include(
"extras.txt");
   break;
   default :
      include(
"index.txt");
   break;
}
include(
"footer.php");
?>



I think this is one of the first things you figure out when you learn php
actualy aquilo.ionichost.com was the first php site I ever worked with
since they have free php hosting, and the first thing I started looking at was how they made the sites with index.php?page=contact.

I'm shure not everone learns this first but it's still "all too basic"  ;D

Seph|roth

Quote from: Aquilo on August 22, 2003, 12:44:08 AM

<?php
include("header.php");
switch(
$_REQUEST["page"])
{
   case ("contact") :
      include("contact.txt");
   break;
   case ("extras") :
      include("extras.txt");
   break;
   default :
      include("index.txt");
   break;
}
include(
"footer.php");
?>



I think this is one of the first things you figure out when you learn php
actualy aquilo.ionichost.com was the first php site I ever worked with
since they have free php hosting, and the first thing I started looking at was how they made the sites with index.php?page=contact.

I'm shure not everone learns this first but it's still "all too basic"  ;D
Thanks, i was looking for how to do that  ;) But.. the .txt files.. why? can't they be html/php files?

Overseer

#9
^ funnily i just replanned my site revamp around such a scheme.. be back to pinch this when at home tonight :)

and Seph|roth there is no reason whatsover...


Wezz6400

#10
Quote from: Seph|roth on August 22, 2003, 06:20:09 AM
Thanks, i was looking for how to do that  ;) But.. the .txt files.. why? can't they be html/php files?
I think it doesn't matter, PHP treats them as a .php file just as any other php file. You could even call them contact.seph I think, but I haven't tried it out though.

BTW, I'm gonna read those tut's for sure, I've been telling everybody that it's time for me to seriously learn php for ages now. I'm gonna write some scripts to learn I think. Maybe a news/blogscript evolving into a message board. Don't worry though, it won't be a SMF competitor 'cause I won't release it. ;D

Overseer

myself i'm just using it to simplify the layout and management of my site...

why make almost identical 10 pages with one section that changes

when u can have 1 script with a partial template, and passing a parameter changes the section u want ;)

for me and what i've learned.. for a 'normal' site managing repeated content, for stuff like site headers, banners etc etc its changed the way i'm thinkin now :)

eFishie

Holy crap, that's a long PHP Frame script, check mine out:

<?
$default="main";
if ($page=="") {
  $page=$default;
}
$pagetoopen="$page.txt";
$contents=file_get_contents($pagetoopen);
print "$contents";
?>
--Jon

Abstraction Point Electronic Music Community - We don't bite! Really! I promise!

Check out my newest song: Alive

Aquilo

Quote from: <?php Piranha ?> on August 22, 2003, 06:16:16 PM
Holy crap, that's a long PHP Frame script, check mine out:

<?
$default="main";
if ($page=="") {
  $page=$default;
}
$pagetoopen="$page.txt";
$contents=file_get_contents($pagetoopen);
print "$contents";
?>


but what if you want to have some $php_var on those pages? not to mention all those if,elseif,else statments if you need more then 2 pages for your site and if you did only need 2 pages I would do something like:
<?php
echo file_get_contents((empty($_REQUEST["page"]) ? "main" "about_me") . '.txt');
?>

eFishie

Mine works, dammit! >:(


Anyways, what do you mean, Aq?
--Jon

Abstraction Point Electronic Music Community - We don't bite! Really! I promise!

Check out my newest song: Alive

Aquilo

hehe! messing around :P

[Unknown]

Quote from: <?php Piranha ?> on August 22, 2003, 06:48:02 PM
Mine works, dammit! >:(


Anyways, what do you mean, Aq?

It's also very insecure :P.

-[Unknown]

eFishie

Insecure? How?

You're joshin' me!
--Jon

Abstraction Point Electronic Music Community - We don't bite! Really! I promise!

Check out my newest song: Alive

Aquilo

oh [unknown] is always so right!
$page could be a system file or something.

[Unknown]

Quote from: Aquilo on August 22, 2003, 07:26:02 PM
oh [unknown] is always so right!

I don't deserve such high praise - and I am so very often wrong too.

-[Unknown]

Advertisement: