Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts

    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

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    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

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Ok write a script to randomly display images from a directory.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    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

  • #6
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    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
        
    }
    ?>

  • #7
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Thanks, you got any more ideas for scripts i could write for practice and to get slightly more advanced?
    thanks

  • #8
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    What I would do is go through this forum, find a problem then try to fix it, then after look at the solution

  • #9
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    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

  • #10
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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.

  • #11
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    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.

  • #12
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    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

  • #13
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    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)

  • #14
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Thanks for the help Mwnciau
    can u think of any other scripts i should be able to write with my little knowledge?

  • #15
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    try this


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •