+ Reply to Thread
Results 1 to 3 of 3

Thread: PHP scripting issue.

  1. #1
    matt88e is offline x10Hosting Member matt88e is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    13

    PHP scripting issue.

    Ok here is the script

    Just make up an Value for Reset_0[1-4]
    Letters & Numbers. Numbers work fine. Its the Letters im having issues with. However if i echo the letter while running the WHILE command it seems to print the letters later on in the script in the output.

    $reset_0[0]==="aaa";
    $reset_0[1]==="bbb";
    $reset_0[2]=="111";
    $reset_0[3]=="222";

    $i = 0;
    while ($i <= 1:
    if($reset_0[$i]===a){$reset_1[$i]="933"; echo $reset_1[$i];}
    if($reset_0[$i]===A){$reset_1[$i]="588";}
    if($reset_0[$i]===b){$reset_1[$i]="811";}
    if($reset_0[$i]===B){$reset_1[$i]="433";}
    if( empty($reset_0[$i])){$reset_1[$i]="";}

    echo $reset_1[0];
    echo $reset_1[1];
    echo $reset_1[2];
    echo $reset_1[3];

    If anyone can help i'll be thankful

  2. #2
    TechAsh's Avatar
    TechAsh is offline Retired TechAsh is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    5,853

    Re: PHP scripting issue.

    From what I can see you've missed out the "endwhile;" statement, and you've forgotten to auto increase $i

    Try:
    PHP Code:
    $reset_0[0]==="aaa";
    $reset_0[1]==="bbb";
    $reset_0[2]=="111";
    $reset_0[3]=="222";

    $i 0;
    while (
    $i <= 18) :
    if(
    $reset_0[$i]===a){$reset_1[$i]="933"; echo $reset_1[$i];}
    if(
    $reset_0[$i]===A){$reset_1[$i]="588";}
    if(
    $reset_0[$i]===b){$reset_1[$i]="811";}
    if(
    $reset_0[$i]===B){$reset_1[$i]="433";}
    if( empty(
    $reset_0[$i])){$reset_1[$i]="";}
    $i++;
    endwhile;

    echo 
    $reset_1[0];
    echo 
    $reset_1[1];
    echo 
    $reset_1[2];
    echo 
    $reset_1[3]; 
    Last edited by TechAsh; 06-22-2008 at 02:58 AM.
    Useful Links:
    Terms of Service | Server News | Buy a Domain
    Free Domains: co.cc | Dot.tk -- Free File Storage: Dropbox -- Website Monitoring: Service Uptime


    My Websites:
    Earthtime Games & TechAsh's Blog

  3. #3
    matt88e is offline x10Hosting Member matt88e is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    13

    Re: PHP scripting issue.

    Not the problem but thank for filling in the rest of the info i had on my PHP script.

    so it still leaves me with the same problem. a or b input doesnt work later unless its echo'd within the while statement. & the increasing thing is there $i++.

    im using the while statement to cut down on Multi scripting the same If statements over a bigger Multi var thing.

+ Reply to Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. Free Development Web Software
    By Danfelbm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 03-01-2008, 07:01 PM
  4. Email Script Not Working. PHP Issue
    By mcnugget in forum Free Hosting
    Replies: 7
    Last Post: 10-29-2007, 02:04 AM
  5. PHP Easter Eggs
    By dragoneye_xp in forum Off Topic
    Replies: 3
    Last Post: 06-14-2006, 05:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers