Jump to content

yami007

Members
  • Posts

    219
  • Joined

  • Last visited

Everything posted by yami007

  1. Sorry if this is not the right to place to look for PHP APIs. I want to set up a website allowing users to recharge their sim cards; I looked and didn't find anything good. Can anyone please point me to the right direction? What do I need exactly?
  2. Thanks, alright I solved it! here is my new code: <script> $(document).ready(function() { var country_list; $.ajax({ url: 'layouts/cities-list.php', data: 'debut', dataType: 'json', success: function(json) { $.each(json, function(index, value) { country_list = '<option value="'+index+'"'; if ( index == 144 ) country_list += ' selected="selected"'; country_list += '>'+value+'</option>'; $('#country').append(country_list); }); } }); }); </script>
  3. Yes there is an error, I forgot to do this: .append('<option value="'+ index +'"'); but that doesnt solve it. This is what it ouputs: <option select="" <="" value="1"></option> >Afghanistan <option select="" <="" value="193"></option> >Afrique du Sud <option select="" <="" value="2"></option> >Albanie <option select="" <="" value="3"></option> >Alg?rie <option select="" <="" value="81"></option> >Allemagne So there are still other errors. right?
  4. I'm really not so good with ajax, I just need this IF condition to work. <script> $(document).ready(function() { $.ajax({ url: 'layouts/cities-list.php', data: 'debut', dataType: 'json', success: function(json) { $.each(json, function(index, value) { $('#country').append('<option value="'+ index +); if (index == 144) { $('#country').append(' selected="selected"'); } $('#country').append('>'+ value +'</option>'); }); } }); }); </script> Thanks in advance!
  5. Why didnt you use float:left on the first table?
  6. I got it ! I can now access my server using the external ip address. Thank you!
  7. Thanks for your reply, requinix, I did assign a static ip to my computer.. Please tell me how to let the router forward to my server using the ports ?
  8. few months back when I used a modem to acces internet, I had the access to my local server using the dynamic address assigned to my PC, but when I started using a router, I no longer have access to my local server, i only redirects me to the router's server how can I fix this?
  9. I get it, thank you dont worry about the minutes
  10. You are right I wanted to do something like the latter...but I have minutes too, I want the array to be something like this Array ( [0] => Array ( [hour] => 8 [minute] => 0 ) [1] => Array ( [hour] => 8 [minute] => 45 ) ) anyway to do this ?
  11. I want to store all the hours 0,1,2,3... in my $time array but it returns the last value only and I dont understand why... <?php $time = array(); $hour = 0; for ( $i=0; $i<=7; $i++ ) { $time['hour'] = $hour; $hour++; } ?>
  12. Thanks for your time ! Let's assume a user typed "plan" Regardless of the database's fields, I want to sort them by the word given "plan". if "plan" is the first word of a sentence, it should go first even if another entry start with an a for example: "plan" should go first before "a plan" - plan - planning - a plan - the planning
  13. i want to sort the available words by the "searched word"...is there any way ? <?php $query = "SELECT * FROM ce_cour_chap WHERE nom LIKE'%$find%' ORDER BY nom"; $result = mysql_query($query); while($search = mysql_fetch_array( $result )) { echo $search['nom']." - ".$search["chid"]."<br/>"; } ?>
  14. hey thanks Guys...the error was in <? as Mikosiko said...and the Pikachu2000 mentioned too...for the latter i think i mistook 0 with o...I sort of do that everytime
  15. it's as simple as this: <div id="cours"> <div class="title"><h3>Semestre 1</h3></div> <div id="Sem1"> <?php $query = "SELECT * FROM ce_cours ";//ORDER BY nom"; $result = mysql_query($query) or die(mysql_error()); $row = 0; ?> <table border="0" width="95%" height="40%" cellpadding="0" cellspacing="0"> <tr> <? while( $cours = mysql_fetch_array($result) ){ $row++; ?> <td valign="top"> <h4><?php echo $cours['nom']; ?></h4> <?php $query2 = "SELECT * FROM ce_cour_chap WHERE cour_id=".$cours['cid']; $result2 = mysql_query($query2); while( $chapitre = mysql_fetch_array($result2) ){ ?> <a href="<?php echo $chapitre['chid']; ?>"><?php echo $chapitre['nom']; ?></a><br /> <? } ?> </td> <?php if ( $row%2==o ) { echo '</tr><tr>'; } } ?> </tr> </table> </div> </div> I just cant tell what's wrong here !
  16. it's in a WHILE while( $data = mysql_fetch_array($result) ) i called it => $data['id']...and it won't work, it just keeps bringing that error. Will this $var = false work ?
  17. I just moved my code from Appserv to EasyPHP and it gave me this error, it was working fine on Appserv...what's with easyPHP ??
  18. what's wrong about that? I always did this <?php if ( ...) { if () { } else { } } ?> and so on...
  19. how do i do that in a text file like "emails.txt" ? is there a way to do that? thank you !
  20. for example, i want to search for an the string "example@example.com" and erase it. thanks in advance !
  21. where can i start learning worpress customization ?? need your help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.