PDA

View Full Version : Ask Me About Php


Demerzel
03-07-2007, 10:56 AM
And SQL. If you like.

MSG
03-07-2007, 03:20 PM
How reverse string?

Ynot
03-07-2007, 05:50 PM
How reverse string?
[/b]
http://uk.php.net/manual/en/function.strrev.php

look in the comments for unicode versions

Artelis
03-09-2007, 12:01 AM
I need a kick ass project for my new found hobby - shitty website! I'd like it to be php+mysql related. WHAT R GUD IDEAS?

TweaK
03-10-2007, 03:34 AM
I suppose you want a sort of news-blogish system, so I suggest doing that (you just want suggestions and not explanation on how to program it, right? Although I could help you with that too, but this isn't my thread :P). Also, make the menu/content part AJAX-based, so you can have realtime content changes without actually loading another page. If you haven't read up on AJAX/don't know what it is (beside a Dutch football club), Wikipedia's page on it. (http://en.wikipedia.org/wiki/AJAX)

You want a nice layout without too much bullshit probably (I say simplicity is the power), so I'd say make some images and do the rest in CSS/XHTML.

Maybe make a sort of admin-ish section for yourself so you can edit pages live (you could do this through a form and a <textarea> containing the contents of the page, then saving it).

Seeing you want MySQL stuff, you could have one index.php page and have the rest of the contents (and I mean actually content-wise) in an SQL database, then you could have one table that has a list of the pages and for each page it has another column that would tell you who's allowed to seen it. Something like this:

----------------------
| id | name | level |
----------------------
| 1 | news**|****1** |
| 2 | admin |** 2****|
-----------------------
Level 1 being public, 2 being only you (you could have a login system or an IP-based system, but the latter would refrain you from logging in from anywhere you'd want).

As far as coding-wise goes, you can figure the rest out on your own. For content, you could have a news system, admin section with page editing, a login system for yourself so you can click an [Edit] button on the bottom of the page and have an Invision Board styled quick edit function for pages (I love that function), you could have a personal portfolio sorta thing, maybe some useful tools/tutorials.. I don't know. It's really what you want to make of it.

I don't know, these are just some suggestions.

Edit
This makes me want to recreate my Frostic Control Panel, which was a Control Panel for my home PC which I ran on a webserver on said PC. It didn't look too good, but it had some nifty Javascript stuff and allowed me to edit certain (with limits of course) files on my PC and stuff, and had a Windows Run command-like text box which would allow me to download torrents and stuff from distance. I think I might remake it one of these days.

Demerzel
03-14-2007, 01:24 PM
Edit
This makes me want to recreate my Frostic Control Panel, which was a Control Panel for my home PC which I ran on a webserver on said PC. It didn't look too good, but it had some nifty Javascript stuff and allowed me to edit certain (with limits of course) files on my PC and stuff, and had a Windows Run command-like text box which would allow me to download torrents and stuff from distance. I think I might remake it one of these days.
[/b]In my experience - NO

TweaK
03-14-2007, 02:41 PM
y not?

(haha)

Kaniaz
03-14-2007, 02:45 PM
Because Remote Desktop/OpenSSH can do that job AND MORE?

MSG
03-15-2007, 12:16 AM
And is far more secure?

TweaK
03-15-2007, 02:44 AM
Uh yeah, but I don't suppose you always have SSH/Remote Desktop access anywhere, do you?

Demerzel
03-15-2007, 11:13 AM
Uh yeah, but I don't suppose you always have SSH/Remote Desktop access anywhere, do you?
[/b]Generally you can have always have one or the other and sometimes both. :P

TweaK
03-15-2007, 11:50 AM
Yes, including locations such as school!

Kaniaz
03-15-2007, 02:12 PM
Yes

If I can SSL tunnel something, SO CAN YOU

Artelis
03-18-2007, 04:03 PM
Ok, I'd like to set up a news server with administration and comments. Point me in the direction of learn-ville.

Pyrofan1
03-18-2007, 04:19 PM
Ok, I'd like to set up a news server with administration and comments. Point me in the direction of learn-ville.
[/b]
I would look into sessions and database function such as mysql_connect, mysql_query and mysql_fetch_array (if your database is mysql)

Demerzel
03-18-2007, 05:17 PM
That's one of the first things I ever did with PHP. It was shit, it was great.

Pyrofan is pretty much spot on. Sessions are easy. You should call session_start as the first instruction. It intializes an array variable called $_SESSION which you can access from all the pages on the same server which call session_start. this means you can store a user id per visitor, update that when they log in and out, and then use it to fetch user-specific information from the database.

i know that wasnt the best explanation but i'm not really in the writing mood. :P

Artelis
03-19-2007, 12:31 PM
I've been looking through a lot of this nifty stuff and decided that I would either
A) give up from laziness
B) make it so shitty that it would pose security flaws.

Is there a standard pre-made package that could do the same functions?

Ynot
03-19-2007, 04:08 PM
I've been looking through a lot of this nifty stuff and decided that I would either
A) give up from laziness
B) make it so shitty that it would pose security flaws.[/b]
I think most PHP writers do both

make it so shitty that it would pose security flaws
then, when it gets to commenting, or any sort of documentation
give up from laziness

then, you are in a position to post the whole thing at PHP Classes
http://www.phpclasses.org/browse/

and laugh as people download it