Jump to content

drisate

Members
  • Posts

    805
  • Joined

  • Last visited

Everything posted by drisate

  1. http://www.micahcarrick.com/04-19-2005/php-paypal-ipn-integration-class.html
  2. You can use $_GET or $_POST to retreve the stuff posted in a form. Theres a lot of good tutorials on it http://www.w3schools.com/php/php_forms.asp
  3. Just use <?php $password=md5(md5($_POST[password])); if ($password==$pass_in_db){ echo "The pass is teh same"; }else{ echo "The pass is not the same"; } ?> Double MD5 is perfect :-)
  4. Use the paypal IPN method ;-)
  5. Your gona have to give more information if you would like an awnser ... Post us the code. To redirect use the meta redirection and to get the form data use $_POST
  6. I am making a flash website and having a problem over a simple getURL ... The flash is here http://balancementdynamique.ca The problem is in the last menu option called "Nous Contacter" The mad is supose to be an external link. on (release) { getURL("http://maps.google.com/maps?f=q&hl=en&geocode=&q=G2E+5V9&ie=UTF8&ll=46.798811,-71.335623&spn=0.008094,0.022831&z=16&iwloc=addr&pw=2", "_self"); } But when i clique on it nothing happens ... did i miss something?
  7. It takes 2 sec to decompile a flash and retreve the mp3 ... thats why FFMpeg seems to be the secure solution.
  8. Ok great i am gona get that installed by the hosting company of this client. How can you use that module to make him read only the first 10 secondes of a mp3 file?
  9. Like i said i know i can use a flash player but anybody can decompile it and get the link to the MP3 or even get the MP3 it self ... thats not a secure way at all ... I know he can cut the music him self but thats the extra step he would like to avoid ... He would like thats toll to do everything out of 1 upload. If ever thats possible ...
  10. Hey guys ... I am currently making a website for a music distributor in Quebec ... He wants a website with an admin panel where he can add new albums and upload the music. He would like the program to automatically create a demo of 10 seconds ... but I don't think PHP has a build in function for that ... so I was wandering if anybody has a solution on how to do that ... Using flash could be great ... but the music would then be to easy to retrieve ... If it's not 100% secure he can't use it. Let see what the freaks has to say.
  11. Ah man ... why didint i think of that >.< (Shame) lol thanks bro
  12. I have a table with names and i would like to sort them by letters A B C D E F G H [...] When you clique on the letter it shows all the names in alphabetic order The The names looks like Patrick Simard So that would be in the P ... How to in 1 query Explode every letter and sho only the names that has the first = to p then sort them to alphabetical order?
  13. well works fine now :-) Thx for everything.
  14. ok Np thx ;-) Guess it's time for you guys to prune the database.
  15. Yeah i have the same problem every time I try to access the PHP Help board... Kind of ironic ... i need help to get help ... haha
  16. Thats what i did at first teng84 but then i started trying alternatives and thats how i anded up with the code i posted. Thanks redarrow i am gona try that and see what happens :-) But i think i will take a good night sleep first. Thx for the help guys!
  17. No freaks online today?
  18. I think the most of slow down comes from the loop querys $nb_query5 = mysql_query("SELECT * FROM jos_users WHERE username='$username'") or die (mysql_error()); $usertype_result = mysql_fetch_array($nb_query5); $usertype = $usertype_result[usertype]; $nb_query6 = mysql_query("SELECT * FROM vip WHERE site_username='$username'") or die (mysql_error()); $vip_result = mysql_fetch_array($nb_query6); $vip = $vip_result[status]; Any ideas? it gets very slow when it makes those 2 querys 90 times for all 90members online ...
  19. I just found $number_replies = $number_messages - $number_topics; to replace $nb_query4 = mysql_query("Select * FROM jos_sb_messages where parent!='0'") or die (mysql_error()); $number_replies = mysql_num_rows($nb_query4); But thats obviously not enought lol
  20. Hey guys i made a script that shows some sort of board stats with online member list and all.It works fine slows down the page load like hell ... I know the problems come from the querys ... but what ever i try the page keep being slow to load. When i take out all the querrys the page loads instantly. I have 2 sets of querys. The one at the bigining of this script and the one in the loop lower down. <?php $lm_query = mysql_query("Select * FROM jos_users order by id desc limit 0,1") or die (mysql_error()); $lm_result = mysql_fetch_array($lm_query); $lm = $lm_result[username]; $nb_query1 = mysql_query("Select * FROM jos_users") or die (mysql_error()); $number_user = mysql_num_rows($nb_query1); $nb_query2 = mysql_query("Select * FROM jos_sb_messages") or die (mysql_error()); $number_messages = mysql_num_rows($nb_query2); $nb_query3 = mysql_query("Select * FROM jos_sb_messages where parent='0'") or die (mysql_error()); $number_topics = mysql_num_rows($nb_query3); $nb_query4 = mysql_query("Select * FROM jos_sb_messages where parent!='0'") or die (mysql_error()); $number_replies = mysql_num_rows($nb_query4); echo"<br> <TABLE class=std0 height=1 cellSpacing=1 cellPadding=0 width=97% align=center bgColor=#a7a7a9 border=0> <TBODY> <TR> <TD class=title vAlign=top align=middle colSpan=2 height=1 cellpadding='0'><FONT face=Verdana size=1>Stats</FONT></TD></TR> <tr> <TD class=std1 vAlign=top align=left width='50%' bgColor=#f6f6f6 height=1> <TABLE id=AutoNumber3 style='BORDER-COLLAPSE: collapse' borderColor=#111111 cellSpacing=3 cellPadding=3 width='100%' border=0> <TBODY> <TR> <TD width='100%'><font face='Verdana' size='1'>Number of topics</font><FONT face=Verdana><FONT size=1>: <b>$number_topics</b><BR>Number of replies: </FONT></FONT><b><font face='Verdana' size='1'> $number_replies</font></b> <p style='margin-top: 0; margin-bottom: 0'><font face='Verdana' size='1'>Number of posted messages: <b>$number_messages</b></font></p> </TD></TR></TBODY></TABLE></TD> <TD class=std1 vAlign=top align=left width='50%' bgColor=#f6f6f6 height=1> <TABLE id=AutoNumber4 style='BORDER-COLLAPSE: collapse' borderColor=#111111 cellSpacing=3 cellPadding=3 width='100%' border=0> <TBODY> <TR> <TD width='100%'> <p style='margin-top: 0; margin-bottom: 0'><FONT face=Verdana><FONT size=1>Last registred member: </FONT>$lm</font></b></p> <p style='margin-top: 0; margin-bottom: 0'><font face='Verdana' size='1'>Number of members: </font><b><font face='Verdana' size='1'>$number_user</font></b></p> </TD></TR></TBODY></TABLE></TD> </tr> <TR style='FONT-SIZE: 10px; FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif'> <TD class=title vAlign=top align=middle colSpan=2 height=1 cellpadding='0'> <p style='margin-top: 0px; margin-bottom: 0px'><FONT face=Verdana size=1>Who's Online</FONT></TD></TR> <TR> <TD class=std1 vAlign=top align=left width='100%' bgColor=#f6f6f6 colSpan=2 height=1> <TABLE id=AutoNumber5 style='BORDER-COLLAPSE: collapse' borderColor=#111111 cellSpacing=3 cellPadding=3 width='100%' border=0> <TBODY> <TR> <TD width='100%'> <P align=center>"; // show online count if ($showmode==0 || $showmode==2) { $query = "SELECT guest, usertype" . "\n FROM #__session" ; $database->setQuery( $query ); $sessions = $database->loadObjectList(); // calculate number of guests and members $user_array = 0; $guest_array = 0; foreach( $sessions as $session ) { // if guest increase guest count by 1 if ( $session->guest == 1 && !$session->usertype ) { $guest_array++; } // if member increase member count by 1 if ( $session->guest == 0 ) { $user_array++; } } // check if any guest or member is on the site if ($guest_array != 0 || $user_array != 0) { echo'We have'; // guest count handling if ($guest_array == 1) { // 1 guest only echo" $guest_array guest "; } else if ($guest_array > 1) { // more than 1 guest echo" $guest_array guests "; } echo $output; // if there are guests and members online if ($guest_array != 0 && $user_array != 0) { echo'and'; } // member count handling if ($user_array == 1) { // 1 member only echo" $user_array member "; } else if ($user_array > 1) { // more than 1 member echo" $user_array members "; } echo'online.'; } } echo' </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD class=std1 vAlign=top align=left width="100%" bgColor=#f6f6f6 colSpan=2 height=1> <TABLE id=AutoNumber6 style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=3 cellPadding=3 width="100%" border=0> <TBODY> <TR> <TD width="100%"><p align="center" style="margin-top: 0; margin-bottom: 0">'; // show online member names $query = "SELECT DISTINCT a.username" ."\n FROM #__session AS a" ."\n WHERE a.guest = 0" ; $database->setQuery($query); $rows = $database->loadObjectList(); if ( count( $rows ) ) { // output $i="0"; foreach($rows as $row) { $vip=""; $username=$row->username; $nb_query5 = mysql_query("SELECT * FROM jos_users WHERE username='$username'") or die (mysql_error()); $usertype_result = mysql_fetch_array($nb_query5); $usertype = $usertype_result[usertype]; $nb_query6 = mysql_query("SELECT * FROM vip WHERE site_username='$username'") or die (mysql_error()); $vip_result = mysql_fetch_array($nb_query6); $vip = $vip_result[status]; if ($usertype=="" or $usertype=="Registred"){$usernamea='<i>'.$row->username.'</i>';} if ($vip=="1"){$usernamea='<b><font color="#008000">'.$row->username.'</font></b>';} if ($usertype=="Super Administrator"){$usernamea='<b><font color="#FF9900">'.$row->username.'</font></b>';} if ($usertype=="Manager"){$usernamea='<b><font color="#3399FF">'.$row->username.'</font></b>';} $string = "$usernamea, $string"; $i=$i+1; } } $string = substr($string, 0, -2); if ($string==""){$string = "No members online!";} echo $string; echo "</p></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"; ?>
  21. make up 3 crons pointing at a cron.php file then check the time and delete the file if (date("H")=="3"){ //it's 3 am delete the shit @unlink($path1); }elseif (date("H")=="13"){ //it's 1 pm delete the shit @unlink($path2); }elseif [...]
  22. Found it ... while ($i <= 2) lol
  23. use cron to auto delete based on time
  24. no idea why the code appeared like that but let me repost it <?php function list_categ() {$i=1; while ($i < 2){ if ($i==1){$where="and cat_img!=''";}else{$where="and cat_img=''";} if ($_GET[cat_]==""){$_GET[cat_]=0;} $command = mysql_query("Select * FROM categories where parent_cat_id='$_GET[cat_]' $where order by cat_name") or die (mysql_error()); while ($data = mysql_fetch_array($command)) { $tablo[]=$data; } if ($_GET[cat_]=="0" or $_GET[cat_]=="" or $i=="1"){$numcols=4;}else{$numcols=2;} $data = range(0,count($tablo) - 1); $numrows = ceil (count($data)/$numcols); echo '<table align="center" width="80%">'; for ($r=0; $r<$numrows; $r++) { echo '<tr>'; for ($c=0; $c<$numcols; $c++) { $cell = isset($data[$r + $c*$numrows]) ? $data[$r + $c*$numrows] : ' '; if ($tablo[$cell]['cat_img']!=""){ print ('<td> <table border="0" cellpadding="3" cellspacing="3" width="100%"> <tr> <td><center><a href="index.php?mod=6&cat_='.$tablo[$cell]['cat_id'].'"><img border="0" src="admin/image/categ/thumbs/'.$tablo[$cell]['cat_img'].'"></a></center></td> </tr> <tr> <td><center><a href="index.php?mod=6&cat_='.$tablo[$cell]['cat_id'].'">'.$tablo[$cell]['cat_name'].'</a></center></td> </tr> </table> </td>'); }else{ print ('<td><a href="index.php?mod=6&cat_='.$tablo[$cell]['cat_id'].'">'.$tablo[$cell]['cat_name'].'</a></td>'); } } echo '</tr>'; } echo '</table>'; if ($i==1){echo "<br><br>";} $i++; } } ?>
  25. Hey guys. I made a function that builds up a list of categories. A few have images and a few don't ... so for estetic reasons i made a loop that gets all the categories with images in loop 1 and all of them with out in loop 2 <?php function list_categ() {$i=1; while ($i < 2){ if ($i==1){$where="and cat_img!=''";}else{$where="and cat_img=''";} if ($_GET[cat_]==""){$_GET[cat_]=0;} $command = mysql_query("Select * FROM categories where parent_cat_id='$_GET[cat_]' $where order by cat_name") or die (mysql_error()); while ($data = mysql_fetch_array($command)) { $tablo[]=$data; } if ($_GET[cat_]=="0" or $_GET[cat_]=="" or ($i=="1")){$numcols=4;}else{$numcols=2;} $data = range(0,count($tablo) - 1); $numrows = ceil (count($data)/$numcols); echo '<table align="center" width="80%">'; for ($r=0; $r<$numrows; $r++) { echo '<tr>'; for ($c=0; $c<$numcols; $c++) { $cell = isset($data[$r + $c*$numrows]) ? $data[$r + $c*$numrows] : ' '; if ($tablo[$cell]['cat_img']!=""){ print ('<td> <table border="0" cellpadding="3" cellspacing="3" width="100%"> <tr> <td><center><a href="index.php?mod=6&cat_='.$tablo[$cell]['cat_id'].'"><img border="0" src="admin/image/categ/thumbs/'.$tablo[$cell]['cat_img'].'"></a></center></td> </tr> <tr> <td><center><a href="index.php?mod=6&cat_='.$tablo[$cell]['cat_id'].'">'.$tablo[$cell]['cat_name'].'</a></center></td> </tr> </table> </td>'); }else{ print ('<td><a href="index.php?mod=6&cat_='.$tablo[$cell]['cat_id'].'">'.$tablo[$cell]['cat_name'].'</a></td>'); } } echo '</tr>'; } echo '</table>'; if ($i==1){echo "<br><br>";} $i++; } } ?> What did i miss? page is at http://www.trans-f-air.com/EZA/index.php?mod=6&cat_=37
×
×
  • 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.