Jump to content

cavendano

Members
  • Posts

    27
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

cavendano's Achievements

Member

Member (2/5)

0

Reputation

  1. cant figure out why this is not looping!! any help would be appreciated! edit: right now im getting one result but thats it... <?php include 'function.php'; $page = (isset($_GET['page'])) ? $_GET['page'] : 0; $page = ($page < 1) ? 0 : $page; $srch = preg_replace( "/ /", "+", $_GET[search] ); $url1 = "http://websitename.net/search/en.html?q=".$srch."&page=".$page; $res = file_get_contents($url1); $i = 1; $hitung = 0; $res = strstr($res,'<tr class="top">'); if($res) { while($i <= 12) { $res = strstr($res, '<td><h2>'); $dodol = extstr3($res,'<a href="/file/','</span>'); $theId = preg_match('/(.*)\/(.*)\//', $dodol, $results); $theId = preg_match('/(.*)\//', $results[1], $results); $theId = preg_match('/\/(.*)/', $results[1], $results); //$dodol = strstr($dodol,$theId); $theId = $results[1]; $name = extstr3($dodol,'">','</a> <span>'); $res = strstr($res, '</table>'); $name = trim($name); $name = str_replace('(','',$name); $name = str_replace(')','',$name); $name = str_replace('&#039;','',$name); $name = str_replace('&','and',$name); $name = str_replace("'",'',$name); // Download URL $download = "http://www.websitename.net/{$theId}/download.jpg"; // Play URL $purl = $download; $link = "src=websitename&id=".$theId."&name=".$name."&url=".$purl; if ( $name && $link) { include( "the-template/list.inc.php" ); $hitung++; } ++$i; } $nextpage = $p + 1; $prevpage = $p - 1; $nextpage = "?source=".$source."&search={$srch}&page={$nextpage}"; $prevpage = "?source=".$source."&search={$srch}&page={$prevpage}"; echo "<table width=\"100%\" align=\"center\"><tr>"; if ( 1 < $p ) { echo "<td align=\"left\"><a href=\""; echo $prevpage; echo "\">"; echo $lang[Prev]; echo "</a></td>"; } if ( $hitung == 0 ) { echo "<center>".$lang['NoResultsMSG']."</center>"; } if ( $hitung != 12 ) { echo ""; } else { echo "<td align=\"right\"><a href=\""; echo $nextpage; echo "\">"; echo $lang[Next]; echo "</a></td>"; } echo "</tr></table>"; } //end if($res) else { echo "<center>".$lang['NoResultsMSG']."</center>"; } ?>
  2. not sure if anyone can guide me to finding something similar.. right now i have a php script that gets curl to download a file.... what i would want to do is when the user enters the file url a progress bar shows how long the download will take/percentage complete
  3. it is in plain text not hashed its just a simple admin panel
  4. im having difficulty with this....i cannot login with the admin panel any ideas? i edited out the url and have it echoing the results when it fails and it looks fine...any ideas? im not getting any mysql errors so its connecting fine. <?php session_start(); include "config.inc.php"; $username = $_POST['username']; // $password = $_POST['password']; // $db = mysql_connect($dbHost,$dbUser,$dbPass)or die(mysql_error()); // mysql_select_db($dbname,$db)or die(mysql_error()); $query = "SELECT user, pass FROM configuration WHERE user = '$username' AND pass = '$password'"; $result = mysql_query($query, $db); if(!$result){ echo "$query"; //header('Location: http://.com/admin/form.php'); exit(); } else { $_SESSION['loggedin'] = 1; header('Location: http://.com/admin/admin.php'); exit(); } ?>
  5. I cant seem to find the problem... currently the script im running is supposed to display the main directories , and when you click it it should display the subdirectories. for example: main1,main2,main3,main4 on one page and the hierarchy should be main1=>sub1, sub2 main2=>sub3, sub4 but what it is doing is main1,sub1,sub2,main2,main3,main4 all one page pretty much whats happening is that its listing all the directories on the same page... here is the php file. if this cant be fixed if you can let me know of a better alternative I am open to any suggestions <?php $cdir = dirname(__FILE__); $DirectoriesToScan = array(realpath($cdir)); $DirectoriesScanned = array(); while (count($DirectoriesToScan) > 0) { foreach ($DirectoriesToScan as $DirectoryKey => $startingdir) { if ($dir = @opendir($startingdir)) { while (($file = readdir($dir)) !== false) { if (($file != '.') && ($file != '..') && ($file != 'files')) { $RealPathName = realpath($startingdir.'/'.$file); if (is_dir($RealPathName)) { if (!in_array($RealPathName, $DirectoriesScanned) && !in_array($RealPathName, $DirectoriesToScan)) { $DirectoriesToScan[] = $RealPathName; $DirList[] = $RealPathName; } } } } closedir($dir); } $DirectoriesScanned[] = $startingdir; unset($DirectoriesToScan[$DirectoryKey]); } } $DirList = array_unique($DirList); sort($DirList); echo "<br><table align=center width=100%>\n"; $columns=3; $i = 0; foreach ($DirList as $dirname) { if ($i == $columns) { echo "</tr><tr>"; $i = 0; } elseif ($i == 0) { echo "<tr>"; } $i++; $dirnames = str_replace("$cdir/","",$dirname); $back_root = dirname(__FILE__) . '/..'; $back_root = str_replace("/..","",$back_root); $back_root = str_replace("$cdir/","",$back_root); $back_root = str_replace("$root/m/","",$back_root); $dirnames = str_replace(" ","_",$dirnames); $count = count($DirList); if (strpos($dirnames,"/")){ $list_name = explode("/",$dirnames); echo "<td> <span style=\"text-transform: uppercase\"><a href=\"?page=filter&location=$dirnames&section=$back_root\">$list_name[1]</font></a> </td>\n"; }else{ echo "<td> <span style=\"text-transform: uppercase\"><a href=\"?page=filter&location=$dirnames&section=$back_root\">$dirnames</font></a> </td>\n"; } } for ($x=$i; $x<$columns ; $x++) echo "<td></td>"; echo "</tr></table>\n"; ?>
  6. yeah its free I am not charging for the use... your carrier on the other hand will charge you for text msg fees and data usage... if you have unlimited text and data then dont sweat it.
  7. thanks papaface but what I was asking is if when the file is uploaded as eric'sfile.txt the script would rename it and call it ericsfile.txt instead...remove any special characters.
  8. I have an upload script that works great except for when a file with special characters is used. If eric'sfile.txt is uploaded it will do this eric\'sfile.txt is there a way to have it remove the special characters instead? //path to storage $storage = 'Files'; //path name of file for storage $uploadfile = "$storage/" . basename( $_FILES['Filedata']['name'] ); //if the file is moved successfully if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) { echo( '1 ' . $_FILES['Filedata']['name']); //file failed to move }else{ echo( '0'); }
  9. how can i block it without the restricting of downloads?
  10. I am developing a site that will allow for ringtones in three different formats to be created. Mp3, m4a, and qcp. Currently allows for creation of ringtones for Sprint, Verizon, At&t and T-mobile. I have tested out the Sprint side and it seems to work almost flawlessly I need help with the other carriers. Any feedback from any of the carriers would be appreciated. www.mobilereelz.com
  11. I have a script that requires the posting of file size it is odd but mp3 wont read the file size. It is odd but the filesize for mp3 doesnt work but m4a does...any ideas? $get_size_mp3 = filesize("$dir_test_mp3"); $get_size_mp4 = filesize("$dir_test_mp4"); $dir_test_mp4 = temp/$sname.m4a; $dir_test_mp3 = temp/$sname.mp3; so if i type echo $get_size_mp4 I get a value such as 1222 but if i type echo $get_size_mp3 I get a blank value any ideas would be great...
  12. all folders are getting their files deleted....if i upload a file into all three directories and run the script it deletes it.... the gcd, temp, and uploadedFiles folders lose all their files regardless of creation time
  13. This script was meant to delete a file after X days...in this case I wanted it to delete files that were older than 1 day except .htaccess. what the script is doing is deleting everything in the specified folders except htaccess even though the files are less than a day old. any suggestions? <?php function delete_old_files($dir, $time_limit = 0,$exclude=array()){ if(!$time_limit) $time_limit = 1*24*60*60; if ($df = opendir($dir)) { while (false !== ($file = readdir($df))) { if ($file != "." && $file != "..") { $last_modified = filemtime($file); if((time()-$last_modified > $time_limit) && !in_array($file , $exclude)){ unlink($dir."/".$file); } } } closedir($df); } }delete_old_files('gcd' , 10 , array('.htaccess')); delete_old_files('uploadedFiles' ); delete_old_files('temp' ); ?>
  14. maybe I just need to explain myself a little better. This is what happens a user uploads an mp3 file and is able to trim it and convert it to other formats online. User uploads MP3 -Trims Selection Chooses different format to convert to or can keep the same format just trimmed. - Creates Mp3, Mp4, Wav User hits create and page is supposed to post the new file with extension but what is happening is the file is created but the download link is wrong. So if user uploads mysong.mp3 and wants mysong.wav as the output the song mysong.wav is created on my server but the file that is echoed to download is mysong.mp3. I already tried getting fileext but it keeps posting the mp3 one as that was the initial upload
×
×
  • 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.