[PHP & MySQL] Tutorials and Scripts Created 21 years ago2003-12-12 21:13:25 UTC by Buster Buster

Created 21 years ago2003-12-12 21:13:25 UTC by Buster Buster

Posted 21 years ago2003-12-12 21:13:25 UTC Post #7475
Hi @ all THWL Members!

First I have to say is: This site ownz!!! It has a very cool looking but simple design and the PHP and MySQL code is awesome!!! Grats and Thumb up @ atom, you have done a very good job here!!! :)

Now my question: atom has a very good PHP & MySQL knowledge how I can see through his own coded forum(!!!) and his other cool stuff like the member script or the awesome tutorials base. I am learning PHP and MySQL now and tried out a few times to create a secure login with sessions. But I think I failed there. So can you write any tutorials about PHP & MySQL scripts and advance your site with a new tutorials section? Or can you give out the sourcecode of your site without, of course, the admin/data base passwords/names? That would be very cool!!! ;) I am very impressed from your features you have implemented in this site through PHP & MySQL. Great Job!!! Keep up the good work!!! :)

Thanks in advance!!! Youre my teacher/master, atom. :D

.:Buster
Posted 21 years ago2003-12-13 06:51:50 UTC Post #7507
Lol... thanks!

I think PHP tuts would look a bit funny near 'how to make trees' and so on, but I have another site which has an open-source scripts section -> http://cariad.co.za/bluebox/?sec=scriptbox

It's still kind-of under development, so there's not much there yet.

I prob. won't release TWHL source code soon, partly because lots of it is a real mess. If I rewrite TWHL at some stage, I might release the old code, but you'll probably have learnt PHP by then :)

Of course, you're welcome to e-mail me with PHP questions, because I like answering them. :)
Posted 21 years ago2003-12-13 07:59:17 UTC Post #7516
hhehehe,

Jump on the PHP bandwagon :P

^_^
Posted 21 years ago2003-12-13 08:53:38 UTC Post #7537
Hey, cool this PHP sourcecode site is awesome! :D I like these cubes! ;) But the collection of scripts is very rar. :
Hmm, can I reach you in IRC or in ICQ? That would be cool! Emailing is annoying. :(

Btw this counter has no IP blockade! :D

.:Buster
Posted 21 years ago2003-12-13 10:09:51 UTC Post #7543
Calm down with the smileys ;)
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 21 years ago2003-12-13 15:29:03 UTC Post #7575
Tell me when you release the source code. I'm going to set up TWJA so...
Posted 21 years ago2003-12-13 15:56:40 UTC Post #7583
The counter's as basic as it gets. I did it a while ago because I needed something to put in there. More to come, of course.

TWJA :)
Posted 21 years ago2003-12-13 15:59:32 UTC Post #7586
In honor to TWHL. ;)
Posted 21 years ago2003-12-14 19:37:07 UTC Post #7783
I've been doing design in php for a while. But I can't get my new goddamn logon script to work!!! GRRRRRRrrrrrrrrr... Can u tell me how you did urs atom?
:lol:
m0p m0pIllogical.
Posted 21 years ago2003-12-14 20:47:43 UTC Post #7790
Youre a talented scripter, atom. I like your new News 'n Stuff Forum. G/J!

Scripts from you I want to look at are:

+ Login/Registering-System plus How to test Login?
+ Tutorials/Mapvault-System
+ Member-System with private Journal, private Mapvault, ...

A few questions on you:

+ Do you script a lot with classes?
+ How do you script to keep the best overview over your scripts? A lot includes and seperate PHP files?
+ How have you learned PHP and MySQL? Which books and sites are recommended?
+ Are your scripts very optimized? Best script overview? Fast script work off? And how do you optimize? Whats the right way?

More questions follow! ;)

.:Buster

[Seventh-Monkey: that's a known bug at the server side]
Posted 21 years ago2003-12-16 17:04:48 UTC Post #7990
Yeah, questions!

Login stuff was the hardest to get to grips with, after ASP's basic session handling. But it's pretty simple really:
login: session_start(); $_SESSION['uid'] = $userid
all other pages: session_start(); if(isset($_SESSION['uid'])) { //user stuff }.

Tutorials / Vault / Journals: all just mysql stuff.

Classes: no. Most pages are very simple and linear. Even the forum system is just a bunch of functions. I can't even be bothered to try OO stuff for sites like this. Not worth the effort, IMO, but it's the way to go if you want to progress to non-web-based programming, or if you're planning some really advanced site.

This site really only has a header include, footer include, and content. With bluebox I experimented with having one 'driver' page that finds and displays content, so everything seems to run from index.php. Which is better depends on what you're doing, I guess.

Get the CHM manuals come from www.php.net and www.mysql.com. They're about the most useful files I've downloaded in years :) And experiment!

Optimization: not really. There's always more than one way to do something - just think about the different ways and you'll work out which one is more efficient.

Hope this helps you out a bit :)

[Seventh: Added a slash to make one of your italic tags closed ;) ]
Posted 21 years ago2003-12-17 18:23:52 UTC Post #8132
Yeah, it helped a bit!

Hmm, what do you think about that Login-Script (its not mine)?

Good or not good? Too easy or too hard written?

Here it is:

http://martin.f2o.org/php/login

.:Buster
Posted 21 years ago2003-12-17 18:48:35 UTC Post #8133
u should use a script with MD5 Encryption
:lol:
m0p m0pIllogical.
Posted 21 years ago2003-12-18 14:10:20 UTC Post #8237
It looks pretty cool, but it's more than i would bother with. As he says, it's all modular, so you could use it on multiple sites easily.
Posted 21 years ago2003-12-18 18:26:10 UTC Post #8261
When can we expect your login script for download and/or when can we look at it? ^^

.:Buster
Posted 21 years ago2003-12-19 04:13:46 UTC Post #8341
lol, "your scripts or your life" :
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 21 years ago2003-12-19 07:10:14 UTC Post #8347
L?L! Oo

Btw I have another question: Are the tutorials PHP includes or are they readed from database? I mean every individual tutorial not the table. The table is readed from database, I think. ;)

Thanks!

.:Buster
Posted 21 years ago2003-12-19 18:12:53 UTC Post #8423
Lol, the download 'script' is really messy, because I wrote it as an experiment. It's spread out across three pages, and it's just confusing.

You should just try making a PHP page like this:

<?session_start();$_SESSION['myvar']='test'?>

Then put a link on that page to another page, and on the new page, do this:

<?session_start();echo $_SESSION['myvar']?>

That's basically all that's involved in a login. Now you just have to think about the logic of it (e.g. set 'myvar' only if the password is right; instead of echoing 'myvar', echo something else that only logged-in people should see).

The other question: the tutorial info (like the author, keywords and so on) is stored in a database table. The actual tutorial texts are stored in .txt files which are read in by PHP. I did it like that just because it would be easier to work with than having the text in the database. And because it'd be more fun to code. :)
Posted 21 years ago2003-12-19 20:11:10 UTC Post #8465
Hehe, k. :) But why dont you just include the texts with a PHP file instead of a TXT file? Its a bit easier and, I think, faster. Is it only the fun to code a reading function for the TXT files or ... whatever?

.:Buster
Posted 21 years ago2003-12-19 23:03:39 UTC Post #8492
this is all nerd talk 2 me.
Posted 21 years ago2003-12-20 17:50:58 UTC Post #8577
Well I actually didn't even think of that, but as it turns out, it has to be that way because it needs to be able to parse the text for things like highlighted words and so on. You can't do that with includes, because they're 'special language constructs'. :)
Posted 21 years ago2003-12-21 08:48:22 UTC Post #8715
Ah, I understand.

And how do you change the DIV backgroundcolor for every entry in the shoutbox or forums?

Like that?

$color = ($color=='#888888')?'#FFFFFF':'#888888';

This stands in a loop.

And as start color for example: $color = '#888888';

Is it that system u change the color?

.:Buster
Posted 21 years ago2003-12-22 18:54:53 UTC Post #8946
That would work fine, but I usually do this:

$clr = ($clr)?false:true;
....
<?=($clr)?'bgcolor=#888888':''?>

...just because of the way the tables are set up on most pages. Also I like to keep variables simple and print html directly.
Posted 20 years ago2003-12-23 15:19:41 UTC Post #9079
hey, thats a terrific idea, cos everyone with b/band (like me for instance) wont be able to join!!!
m0p m0pIllogical.
Posted 20 years ago2003-12-23 16:38:43 UTC Post #9097
I don't think this applies to TWHL
Posted 20 years ago2003-12-24 07:56:35 UTC Post #9186
You get a new IP everytime you connect to the internet if you're using a modem? So this would mean all modem users are blocked. And that's a lot so let's drop the dynamic IP block. :
Posted 20 years ago2003-12-24 08:09:46 UTC Post #9191
I don't think he means all dynamic IPs, think he's talking about how to block a particular person who has a dynamic IP, through their IP + hostname.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2003-12-24 09:26:57 UTC Post #9203
Yep, it's a tricky one. I think the last part of the hostname is usually the beginning of the IP... anyway, we don't ban people here at TWHL, so I've never really tried it :) All I know is, there's no perfect way to ban anyone, ever, short of finding out where he lives and shooting him.
Posted 20 years ago2003-12-24 09:50:40 UTC Post #9204
I'm all for that. Special festive season rates, ?100/head. Ring 0-800-KILL-U for details.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2003-12-24 16:41:38 UTC Post #9245
meh, I prefer the spork in the neck... messy, but satisfying :badass:
Posted 20 years ago2004-02-14 10:36:07 UTC Post #16165
I'd e-mail him, he's very busy atm and is having a break from TWHL.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2004-02-14 20:51:32 UTC Post #16207
Hmm, k, I dont want to disturb him when he is very busy atm. I will wait till he's back. :)

.:Buster
Posted 20 years ago2004-02-14 21:46:27 UTC Post #16210
download the forum!? wtf!?
Posted 20 years ago2004-02-14 22:14:50 UTC Post #16214
I think he means get the script/code for these forums
AJ AJGlorious Overlord
Posted 20 years ago2004-02-15 12:17:02 UTC Post #16256
Yeah, of course the script. ;) Its a great forum I think, sweet and so personal. phpBB forums are too big, better for firms and companies. Only thing I miss @ TWHL forum is an edit button to edit your personal post. I hate doubleposts. :D

Btw the Anonymous function is bad. :

.:Buster
Posted 20 years ago2004-02-15 14:12:48 UTC Post #16264
We have one, we mods ;)
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2004-02-15 19:08:33 UTC Post #16285
Gah too much script talk for me.
And you evil mods should share your edit-joys to us mere workers(mappers).
Posted 20 years ago2004-02-16 04:03:27 UTC Post #16313
Atom plans to, when he gets back.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2004-02-16 11:20:39 UTC Post #16337
Wow, good decision from atom. :) No more doubleposts!

//fake-edit: ^^ And the anonymous feature? It souldn't exist anymore. :

.:Buster
Posted 20 years ago2004-02-16 12:12:13 UTC Post #16344
There aren't any doubleposts, I take care of them ;) oh the power of bein' a mod, lol

#Mustard Plug - Mr Smiley#
I remember how it used to be,
and all the things you said to me.
You always taught me right from wrong.
(Wrong from right, right from wrong)
'Til you went on the killing spree,
and killed your family.
Why is this the way things have to be?

Oh Mr. Smiley,
how could it be true,
the things they say that they knew?
I can't believe it! What has happened to you?
I took my time while thinking it through.
Digging through facts, believing in you.
Oh Mr. Smiley. Give me a clue,
why they said it was you,
I can't accept it! Tell me it's not true.
Because you were once so good to me,
oh Mr. Smiley tell me how it could be.

You always had a smile on your face,
I never thought you'd become a criminal case.
Until I saw your face on my TV.
Was it just for entertainment?
Because now you face solitary confinement, in jail.
Why is this the way it has to be? Tell me!

Oh Mr. Smiley, what has happened to you? Tell me it's not true!
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2004-02-19 17:08:20 UTC Post #16590
@atom: How many MySQL tables have you created for your forum? I guess 3, right? One for forums, another for threads and the last for posts. K, thats it. Can you post your tables with items and types? That would help me a lot, PHP code is unnecessary then. ^^

Thx a lot! :)

.:Buster
Posted 20 years ago2004-02-20 14:48:59 UTC Post #16659
@atom: Another question: How do you manage it that the 'AFTER-POSTING'-redirection is before the HTML body include. My PHPs looks always like that:

HEADER
MENU
include 'bla.php'; // Site Content
FOOTER

Problem: If the redirection is in bla.php there follows an error because the redirection should come before any HTML body is executed.

You understand my problem? I don't think so. :

.:Buster
Posted 20 years ago2004-02-20 17:41:52 UTC Post #16675
Atom is not here!
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 20 years ago2004-02-21 05:19:25 UTC Post #16730
Yeah, I know, but I can wait till he answer my questions. Can be in 1 or 2 month, doesnt matter. I am patient. ;)

.:Buster
You must be logged in to post a response.