Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-28-2006, 02:51 PM   PM User | #1
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
Need More php Experience

Hi ppl im looking for a bit of php experience ive read all the tutorials and made some simple scripts, plz reccomend some simplish scripts i should try and create!

thanks
Rafiki
rafiki is offline   Reply With Quote
Old 08-28-2006, 03:06 PM   PM User | #2
IvanJ
New Coder

 
Join Date: Aug 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
IvanJ is an unknown quantity at this point
There's the ever-popular login script. Also, I started out by connecting to a database and maintaining user-state (login session). Stuff like this never gets old. Also, you can look into the different methods of reading XML files.

I haven't had time to mess with it (plus i've moved into a .NET/Java approach) so I haven't spent much time with PHP in a while, but you can look into phpBB. It reeks of PHP.

Good luck.
IvanJ is offline   Reply With Quote
Old 08-28-2006, 05:09 PM   PM User | #3
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
Thanks ivan a little to advanced atm, im just looking for simple scripts that may or may not be used, but have some use and functionality and simpleish to script as a newbie php coder
rafiki is offline   Reply With Quote
Old 08-28-2006, 05:33 PM   PM User | #4
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Ok write a script to randomly display images from a directory.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 08-28-2006, 06:18 PM   PM User | #5
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
Thanks mate, its still a little advanced, so may need a lot of corrections

but would sumthin like this be worthy of trying?

PHP Code:
<?php 

//hopefully a image rotator
    
    
function rand(1,2,3);
    {
    if 
rand == 1;
    print 
"<img src="/1.gif">";
    if 
rand == 2;
    print 
"<img src="/2.gif">";
    if 
rand == 3;
    print 
"<img src="/3.gif">";
    }
    
?>
im not really expecting htis to work coz every other 1 i haev seen has been a lot longer coding wise ty anyways
rafiki is offline   Reply With Quote
Old 08-28-2006, 06:54 PM   PM User | #6
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
hmmm

PHP Code:
<?php 

//hopefully a image rotator
    
    
function rand(1,3);// rand(1,2,3); would cause an error, too many arguments, heres the proper way to use it: rand($min_number, $max_number);
    
{
    if (
rand == 1){ // the comparison has to be in brackets and then you have to open the curly brackets {
    
print "<img src=\"1.gif\">"// the " you were using closed the opening "... use a \ before to stop the php functions
    
}// close curly crackets
    
}
?>
Mwnciau is offline   Reply With Quote
Old 08-28-2006, 07:53 PM   PM User | #7
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
Thanks, you got any more ideas for scripts i could write for practice and to get slightly more advanced?
thanks
rafiki is offline   Reply With Quote
Old 08-28-2006, 08:04 PM   PM User | #8
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
What I would do is go through this forum, find a problem then try to fix it, then after look at the solution
Mwnciau is offline   Reply With Quote
Old 08-28-2006, 08:12 PM   PM User | #9
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
Quote:
Originally Posted by Mwnciau
What I would do is go through this forum, find a problem then try to fix it, then after look at the solution
i was thinking of that but then there are some very advanced scripts needing fixes on this site and i am not at that level of php coding yet!
although anything i feel i could try and fix whilst browsing this site i will give it ago, atm i'd rather say ... here is a scripts thats easy to write and a lot of people would be able to help you with...
thanks for idea though
Rafiki
rafiki is offline   Reply With Quote
Old 08-28-2006, 08:37 PM   PM User | #10
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,042
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
I sort of do the same thing ....

I'll throw in my solution to a question, and then get "spanked" by the seasoned
programmers. But I don't mind. I learn something new each time.

My coding is getting better and better. Some of the problems listed are
sort of beyond my abilities though. But that's what makes this forum so good.

The important thing is to check your ego at the door and accept criticism like
water on a duck's back. Expert programmers like to point out mistakes, but
that will be to your advantage ... take whatever information they give out.

Last edited by mlseim; 08-28-2006 at 08:40 PM..
mlseim is offline   Reply With Quote
Old 08-28-2006, 09:18 PM   PM User | #11
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
The other things I did when I was at your level of PHP is think of something that I know is possible in PHP and looked up the functions... Though if you look at the harder subjects on the forums some of them aren't actually that hard, and you kind of get used to them...

P.S What can you do with PHP at the moment? It will help with the suggestions.

Last edited by Mwnciau; 08-28-2006 at 09:26 PM..
Mwnciau is offline   Reply With Quote
Old 08-28-2006, 09:49 PM   PM User | #12
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
i'll give that a try but a few pages back (think it was 11) i seen this for thread for redirection
i thought of a jump_id or something like that....
PHP Code:
<?php
$id 
= array ( $id['1'] = "http://google.com"$id['2'] = "http://yahoo.co.uk"$id['3'] = "http://codingforums.com";)
if(
$id == 1
print 
"header( 'Location: $id['1']' ) ;"
?>
the outcome should be that
Code:
http://members.lycos.co.uk/jaysphp/redirect.php?id=1
would redirect u to the website "google.com" please leave ur views or corrections

thanks
rafiki
rafiki is offline   Reply With Quote
Old 08-28-2006, 10:06 PM   PM User | #13
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
Hmmm people would usually use this (easier):

PHP Code:
switch ($id){
case 
1:
header('Location: ' $link1);
case 
2//etc... 
or:
PHP Code:
header('Location: ' $link[$id]); 
(btw header is a php function so you dont echo it)
Mwnciau is offline   Reply With Quote
Old 08-29-2006, 01:18 AM   PM User | #14
rafiki
Senior Coder

 
rafiki's Avatar
 
Join Date: Aug 2006
Location: Floating around somewhere...
Posts: 2,034
Thanks: 18
Thanked 42 Times in 42 Posts
rafiki will become famous soon enough
Thanks for the help Mwnciau
can u think of any other scripts i should be able to write with my little knowledge?
rafiki is offline   Reply With Quote
Old 08-29-2006, 02:23 AM   PM User | #15
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
try this
Mwnciau is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 10:40 AM.


Advertisement
Log in to turn off these ads.