[Release] Pokemon-Area based browser game

Page 60 of 78 FirstFirst ... 1050525354555657585960616263646566676870 ... LastLast
Results 886 to 900 of 1163
  1. #886
    RaGEZONER || Webdevloper KiruHoshino is offline
    MemberRank
    Oct 2011 Join Date
    HungaryLocation
    648Posts

    Re: [Release] Pokemon-Area based browser game

    Not sure if he meant. And not everybody can be professional programmer.

  2. #887
    Michael Jackson ♥ Sphinx is offline
    MemberRank
    Aug 2010 Join Date
    In your bed :3Location
    906Posts

    Re: [Release] Pokemon-Area based browser game

    KiruHoshino, not that.
    It has nothing to do with the selectbox.

    On profiles, when i do <? echo $profiel['land']; ?> i will get as result the full name (Netherlands).
    I want to select te abbreviation from the database table `landen`.

    So i can make country flags
    Spoiler:

    <?
    $country_short = HOW TO GET THE ABBREVIATION FROM `landen` TABLE USING `land` FROM `gebruikers` TABLE;
    ?>

    <img src="http://forum.ragezone.com/images/flags/'.$country_short.'.png"> = <img src="http://forum.ragezone.com/images/flags/nl.png">

    ------------------

    if i would do

    <img src="http://forum.ragezone.com/images/flags/'.$profiel['land'].'.png"> = <img src="http://forum.ragezone.com/images/flags/Netherlands.png">
    it would give me the full name.


    Spoiler:




    Last edited by Sphinx; 25-12-13 at 05:52 AM.

  3. #888
    Account Upgraded | Title Enabled! Raftaar is offline
    MemberRank
    Apr 2013 Join Date
    274Posts

    Re: [Release] Pokemon-Area based browser game

    Just echo theabbrivation beside the country name in between the option tag

    - - - Updated - - -

    I am not a professional

    - - - Updated - - -

    Well U need to do is

    Select from landen where name = to the user's seletected country
    And name the variable something
    Thatts it and echo it

    - - - Updated - - -

    I will make one for u when I reach home

  4. #889
    Michael Jackson ♥ Sphinx is offline
    MemberRank
    Aug 2010 Join Date
    In your bed :3Location
    906Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Raftaar View Post
    Just echo theabbrivation beside the country name in between the option tag

    - - - Updated - - -

    I am not a professional

    - - - Updated - - -

    Well U need to do is

    Select from landen where name = to the user's seletected country
    And name the variable something
    Thatts it and echo it

    - - - Updated - - -

    I will make one for u when I reach home
    $country = mysql_query('SELECT `kort` FROM `landen` WHERE `en` = '.$profiel['land'].' '); something like that?

    `kort` = the abbrev
    `en` = fullname
    '.$profiel['land'].' gets the selected country from `gebruikers`
    Last edited by Sphinx; 25-12-13 at 06:05 AM.

  5. #890
    Account Upgraded | Title Enabled! Raftaar is offline
    MemberRank
    Apr 2013 Join Date
    274Posts

    Re: [Release] Pokemon-Area based browser game

    yeah !

    - - - Updated - - -

    then echo the country

  6. #891
    Michael Jackson ♥ Sphinx is offline
    MemberRank
    Aug 2010 Join Date
    In your bed :3Location
    906Posts

    Re: [Release] Pokemon-Area based browser game

    I want to share the country flag script! (Includes more than 240 country's +sql)
    [hide]
    Step 1:
    Spoiler:

    First go to your account-options.php and find:

    Code:
    <tr>
        <td height="25"><?php echo $txt['country']; ?></td>
        <td><select name="land" class="text_select">
        <?
        $landsql = mysql_query("SELECT `en` FROM `landen` ORDER BY `kort` ASC"); 
    
        if(isset($land)) $landd = $land;
        else $landd = $gebruiker['land'];
    
        while($land = mysql_fetch_array($landsql)){
          $selected = '';
          if($land['en'] == $landd)   $selected = 'selected';
            
          echo '<option value="'.$land['en'].'" '.$selected.'>'.$land[$lang['taalshort']].'</option>';
        }
        ?>
        </select></td>
      </tr>
    Replace it with:

    Code:
    <tr>
    <td height="25"><?php echo $txt['country']; ?></td>
        <td><select name="land" class="text_select">
        <?
        $landsql = mysql_query("SELECT `en`,`kort` FROM `landen` ORDER BY `".$lang['taalshort']."` ASC"); 
    
        if(isset($land)) $landd = $land;
        else $landd = $gebruiker['land'];
    
        while($land = mysql_fetch_array($landsql)){
          $selected = '';
          if($land['en'] == $landd)   $selected = 'selected';
            
          echo '<option value="'.$land['en'].'" '.$selected.'>'.$land[$lang['taalshort']].'</option>';
        }
        ?>
        </select></td>
    </tr>

    Step 2:
    Spoiler:

    Go to your profiles.php and put underneath the "$profiel = mysql_fetch_assoc(mysql_query" code the following:
    Code:
    $country = mysql_fetch_assoc(mysql_query("SELECT `kort` FROM `landen` WHERE `en` = '".$profiel['land']."' ")); 
    $land = strtolower($country['kort']);
    $flag = '<img src="http://forum.ragezone.com/images/flags/'.$land.'.png" alt="'.$profiel['land'].'" title="'.$profiel['land'].'">';
    Find in that same file:
    Code:
     <tr>
            <td height="20"><strong><?php echo $txt['country']; ?></strong></td>
            <td><img src="http://forum.ragezone.com/images/flags/<? echo $profiel['land']; ?>.png" title="<? echo $profiel['land']; ?>" /></td>
          </tr>
    Replace it with:
    Code:
     <tr>
            <td height="20"><strong><?php echo $txt['country']; ?></strong></td>
            <td><?php echo $flag; ?></td>
          </tr>


    Step 3:
    Spoiler:

    Go to your database and delete the whole `landen` table.
    And when that's done, import this SQL.
    https://www.mediafire.com/?wt9cz3zv2g3lzge


    Step 4:
    Spoiler:

    Add these flags to your images folder. (small icons)
    https://www.mediafire.com/?rnl72thcisucw8a
    [/hide]
    Btw, thx Raftaar for helping me a hand.

  7. #892
    Account Upgraded | Title Enabled! Raftaar is offline
    MemberRank
    Apr 2013 Join Date
    274Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Sphinx View Post
    I want to share the country flag script! (Includes more than 240 country's +sql)
    [hide]
    Step 1:
    Spoiler:

    First go to your account-options.php and find:

    Code:
    <tr>
        <td height="25"><?php echo $txt['country']; ?></td>
        <td><select name="land" class="text_select">
        <?
        $landsql = mysql_query("SELECT `en` FROM `landen` ORDER BY `kort` ASC"); 
    
        if(isset($land)) $landd = $land;
        else $landd = $gebruiker['land'];
    
        while($land = mysql_fetch_array($landsql)){
          $selected = '';
          if($land['en'] == $landd)   $selected = 'selected';
            
          echo '<option value="'.$land['en'].'" '.$selected.'>'.$land[$lang['taalshort']].'</option>';
        }
        ?>
        </select></td>
      </tr>
    Replace it with:

    Code:
    <tr>
    <td height="25"><?php echo $txt['country']; ?></td>
        <td><select name="land" class="text_select">
        <?
        $landsql = mysql_query("SELECT `en`,`kort` FROM `landen` ORDER BY `".$lang['taalshort']."` ASC"); 
    
        if(isset($land)) $landd = $land;
        else $landd = $gebruiker['land'];
    
        while($land = mysql_fetch_array($landsql)){
          $selected = '';
          if($land['en'] == $landd)   $selected = 'selected';
            
          echo '<option value="'.$land['en'].'" '.$selected.'>'.$land[$lang['taalshort']].'</option>';
        }
        ?>
        </select></td>
    </tr>

    Step 2:
    Spoiler:

    Go to your profiles.php and put underneath the "$profiel = mysql_fetch_assoc(mysql_query" code the following:
    Code:
    $country = mysql_fetch_assoc(mysql_query("SELECT `kort` FROM `landen` WHERE `en` = '".$profiel['land']."' ")); 
    $land = strtolower($country['kort']);
    $flag = '<img src="http://forum.ragezone.com/images/flags/'.$land.'.png" alt="'.$profiel['land'].'" title="'.$profiel['land'].'">';
    Find in that same file:
    Code:
     <tr>
            <td height="20"><strong><?php echo $txt['country']; ?></strong></td>
            <td><img src="http://forum.ragezone.com/images/flags/<? echo $profiel['land']; ?>.png" title="<? echo $profiel['land']; ?>" /></td>
          </tr>
    Replace it with:
    Code:
     <tr>
            <td height="20"><strong><?php echo $txt['country']; ?></strong></td>
            <td><?php echo $flag; ?></td>
          </tr>


    Step 3:
    Spoiler:

    Go to your database and delete the whole `landen` table.
    And when that's done, import this SQL.
    https://www.mediafire.com/?wt9cz3zv2g3lzge


    Step 4:
    Spoiler:

    Add these flags to your images folder. (small icons)
    https://www.mediafire.com/?rnl72thcisucw8a
    [/hide]
    Btw, thx Raftaar for helping me a hand.
    Nevermind it was a petty job
    :D
    Best of luck

    - - - Updated - - -

    Bug Report >

    Progress
    Added Limitations and usage
    ( Works when more than 5 items used ) ( if used one after another)
    otherwise the bug still works and we can use any item unlimited time

    Added Slow down time error but its not working properly
    need some help in it

    - - - Updated - - -

    Anyone ?

  8. #893
    Michael Jackson ♥ Sphinx is offline
    MemberRank
    Aug 2010 Join Date
    In your bed :3Location
    906Posts

    Re: [Release] Pokemon-Area based browser game

    Can someone help me :$
    I would love to filter all special characters in my textfields, I only want A-Za-z0-9 and know that its something with preg_replace but i don't know how to use that shit XD
    If its possible i would like that the website return a message when submitted (and doesnt update in db ofcourse).
    Please also tell me what i've to do with the input after i placed the preg_replace shit.

  9. #894
    Member Raggaer is offline
    MemberRank
    Jun 2013 Join Date
    96Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Sphinx View Post
    I want to share the country flag script! (Includes more than 240 country's +sql)
    [hide]
    Step 1:
    Spoiler:

    First go to your account-options.php and find:

    Code:
    <tr>
        <td height="25"><?php echo $txt['country']; ?></td>
        <td><select name="land" class="text_select">
        <?
        $landsql = mysql_query("SELECT `en` FROM `landen` ORDER BY `kort` ASC"); 
    
        if(isset($land)) $landd = $land;
        else $landd = $gebruiker['land'];
    
        while($land = mysql_fetch_array($landsql)){
          $selected = '';
          if($land['en'] == $landd)   $selected = 'selected';
            
          echo '<option value="'.$land['en'].'" '.$selected.'>'.$land[$lang['taalshort']].'</option>';
        }
        ?>
        </select></td>
      </tr>
    Replace it with:

    Code:
    <tr>
    <td height="25"><?php echo $txt['country']; ?></td>
        <td><select name="land" class="text_select">
        <?
        $landsql = mysql_query("SELECT `en`,`kort` FROM `landen` ORDER BY `".$lang['taalshort']."` ASC"); 
    
        if(isset($land)) $landd = $land;
        else $landd = $gebruiker['land'];
    
        while($land = mysql_fetch_array($landsql)){
          $selected = '';
          if($land['en'] == $landd)   $selected = 'selected';
            
          echo '<option value="'.$land['en'].'" '.$selected.'>'.$land[$lang['taalshort']].'</option>';
        }
        ?>
        </select></td>
    </tr>

    Step 2:
    Spoiler:

    Go to your profiles.php and put underneath the "$profiel = mysql_fetch_assoc(mysql_query" code the following:
    Code:
    $country = mysql_fetch_assoc(mysql_query("SELECT `kort` FROM `landen` WHERE `en` = '".$profiel['land']."' ")); 
    $land = strtolower($country['kort']);
    $flag = '<img src="http://forum.ragezone.com/images/flags/'.$land.'.png" alt="'.$profiel['land'].'" title="'.$profiel['land'].'">';
    Find in that same file:
    Code:
     <tr>
            <td height="20"><strong><?php echo $txt['country']; ?></strong></td>
            <td><img src="http://forum.ragezone.com/images/flags/<? echo $profiel['land']; ?>.png" title="<? echo $profiel['land']; ?>" /></td>
          </tr>
    Replace it with:
    Code:
     <tr>
            <td height="20"><strong><?php echo $txt['country']; ?></strong></td>
            <td><?php echo $flag; ?></td>
          </tr>


    Step 3:
    Spoiler:

    Go to your database and delete the whole `landen` table.
    And when that's done, import this SQL.
    https://www.mediafire.com/?wt9cz3zv2g3lzge


    Step 4:
    Spoiler:

    Add these flags to your images folder. (small icons)
    https://www.mediafire.com/?rnl72thcisucw8a
    [/hide]
    Btw, thx Raftaar for helping me a hand.
    I like how injectable that code looks.
    You should sanitize abit that select field
    Last edited by Raggaer; 27-12-13 at 03:31 AM.

  10. #895
    Account Upgraded | Title Enabled! Raftaar is offline
    MemberRank
    Apr 2013 Join Date
    274Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Sphinx View Post
    Can someone help me :$
    I would love to filter all special characters in my textfields, I only want A-Za-z0-9 and know that its something with preg_replace but i don't know how to use that shit XD
    If its possible i would like that the website return a message when submitted (and doesnt update in db ofcourse).

    Please also tell me what i've to do with the input after i placed the preg_replace shit.
    I would prefer U to read tutorials from w3schools .. And nice job .. Bit of pregrrplace can fix 5 bugs ;) 5 unknown bugs ;)

    - - - Updated - - -

    Quote Originally Posted by Raggaer View Post
    I like how injectable that code looks.
    You should sanitize abit that select field
    yep U R right

    And he should also change <? To <?php

  11. #896
    Michael Jackson ♥ Sphinx is offline
    MemberRank
    Aug 2010 Join Date
    In your bed :3Location
    906Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Sphinx View Post
    Can someone help me :$
    I would love to filter all special characters in my textfields, I only want A-Za-z0-9 and know that its something with preg_replace but i don't know how to use that shit XD
    If its possible i would like that the website return a message when submitted (and doesnt update in db ofcourse).
    Please also tell me what i've to do with the input after i placed the preg_replace shit.
    Anyone?

  12. #897
    Account Upgraded | Title Enabled! Raftaar is offline
    MemberRank
    Apr 2013 Join Date
    274Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Sphinx View Post
    Anyone?
    read tutorials from w3schools or other sites ...
    Format will be same .. If text is not equal then echo blah blah blah

  13. #898
    Holy mother jesus tractor Kratos147 is offline
    MemberRank
    Jan 2011 Join Date
    CroatiaLocation
    470Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Sphinx View Post
    Can someone help me :$
    I would love to filter all special characters in my textfields, I only want A-Za-z0-9 and know that its something with preg_replace but i don't know how to use that shit XD
    If its possible i would like that the website return a message when submitted (and doesnt update in db ofcourse).
    Please also tell me what i've to do with the input after i placed the preg_replace shit.
    why not use something like:

    Code:
    <html>
    	<head>
    		<title>Hello</title>
    	</head>
    	<script>
    	function validate(evt) {
    	  var theEvent = evt || window.event;
    	  var key = theEvent.keyCode || theEvent.which;
    	  key = String.fromCharCode( key );
    	  var regex = /[0-9a-zA-Z]|\./;
    	  if( !regex.test(key) ) {
    		theEvent.returnValue = false;
    		if(theEvent.preventDefault) theEvent.preventDefault();
    	  }
    	}
    	</script>
    	
    	<body>
    	<form method="post">
    		<input type='text' onkeypress='validate(event)' />
    	</form>
    	</body>
    </html>
    With this, you won't even have to process the special keys because users won't even be able to input them in the first place. It's a handy thing to use.

    as for your 2nd part of the post

    make sure you use if(isset($_POST['submit'])).
    inside there you can simply process the code and then add checks that do one thing at the time
    Then you can just add something like
    if(something went wrong) $error = "this thing went wrong"

    and at the end of processing you can have

    if(!isset($error)) process code, add to db, etc,
    else echo $error;


    dunno if this really made sense, but oh well.

    teehee, 369th post. :D

  14. #899
    Account Upgraded | Title Enabled! Raftaar is offline
    MemberRank
    Apr 2013 Join Date
    274Posts

    Re: [Release] Pokemon-Area based browser game

    Lol js and jQuery can be changed in inspect element .. Use PHP validation @Kratos147

  15. #900
    Holy mother jesus tractor Kratos147 is offline
    MemberRank
    Jan 2011 Join Date
    CroatiaLocation
    470Posts

    Re: [Release] Pokemon-Area based browser game

    Quote Originally Posted by Raftaar View Post
    Lol js and jQuery can be changed in inspect element .. Use PHP validation @Kratos147
    that's why I said that's only a handy thing, I didn't say it's perfect.

    one of PHP methods can easily be done with sub string function that will detect if illegal characters are there., how about that? ;)



Advertisement