Jump to content

atlanta

Members
  • Posts

    172
  • Joined

  • Last visited

    Never

Everything posted by atlanta

  1. Hi, I'm making a photo album scripts that doesnt use sql but uses file functions to grab images and create links. i need to be able to grab the most lastest image uploaded to ftp as the photo album header . in ftp i know it has last modified date etc.. is there any way of me grabbing this info so i can display the last image uploaded to ftp?
  2. Hey another quick question ok i got the the <tr> to show on every multiple of 4 but how do i make the </tr> show on every count of 4 with starting at 0?? if ($cnt == "0" || ($cnt % 4) == 0) { echo "<tr>"; } ?> <td> <a href="<?php echo $urlpath . $file; ?>" target="_blank" rel="lightbox[album]" title="<?=$exten[0]?>"> <img src="<?php echo $urlpath . $file; ?>" alt="<?=$exten[0]?>" width="158" height="168" /> </a> </td> <? if (function??) { echo "</tr>"; } ?>
  3. Thanks Guys i got it working !
  4. That didnt worked it echoed on every number..
  5. Hi all, I wanted to know what function i should use to make a if statement that will retrue if the number is a multiple of 4 for instance ex. if($number == "0" || multiple of 4 function) { echo "<tr>"; } Thanks In advance
  6. try <?php function changelink($change) { $find = "source"; $replace = htmlspecialchars($change); $change = '<a href="http://www.amazon.co.uk/dp/(source)?tag=speciainvita-21&camp=1406&creative=6394&linkCode=as1&creativeASIN=(source)" > test</a>'; $change2 = str_replace($find, $replace, $change); echo $change2; } changelink($row["source"]); ?>
  7. its because your using preg_replace and not using the correct syntax for it .
  8. Yea sessions would be the best way.... and if the site is member based have it where members can set the variable in the database and have the page check to see what language they want...
  9. You need to google .htaccess mod_rewrite rule to do that heres an example Add that line to .htaccess with your values in the page.php part RewriteEngine On RewriteRule ^([0-9]+) /page.php?member=$1 [L]
  10. atlanta

    Css Div Help

    Hey all , Started a design job since im pretty good at coding just needed to work on my website design side.... ok to start off i needed a little help on figureing out what to use divs. or table to get it done if you look at the attached picture you will see the layout format i need the comments to look like (on left).. could someone help me with the css values i need to use and div layout to accomplish that thanks... please let me know if u have any more questions. [attachment deleted by admin]
  11. I think you wanna look at zend or ioncube or php audit something along those lines
  12. Why dont you just check the input against the database values that would be much easier
  13. oh and md5 only generates a-f not a-z
  14. strtoupper(substr(md5(uniqid(mt_rand(), true)), 0, 6));
  15. Check this variable $paypal['item_name'] . echo it and see do u get anything. <input type="hidden" name="item_name" value="<?= $paypal['item_name']; ?>">
  16. Thanks alot SkunkBad.. imma try your solution and see which one works faster i used this one that someone suggessted <?php $data = file_get_contents('data.xml'); $pattern = '#<track(?:.*?)title="(.*?)" file="(.*?)"(?:.*?)?/>#'; if(preg_match_all ($pattern, $data, $matches)){ $count = count($matches[0])-1; for ($x = 0; $x <= $count; $x++) { echo '<b>Title:</b> '.$matches[1][$x].' - <b>File:</b> '.$matches[2][$x].'<br/>'; } } ?>
  17. Hi, Not to good with xml parsing so needed a little help. ok here we go.. i have this xml file <?xml version="1.0" encoding="iso-8859-1" ?> - <mixtape Title="Crack RNB Vol 3" Artist="Various Artists" Artwork="http://www.domain.com/images/" Tracks="21" Rating="4" Listens="6,422"> <track id="238969" position="1" title="T.i.+ft.+tiny+-+lately" file="01-TI-ft-Tiny---Lately.mp3" length="235.55" /> <track id="238970" position="2" title="Ntl+-+jump+jump" file="02-NTL---Jump-Jump.mp3" length="240.2" /> <track id="238971" position="3" title="Jordin+sparks+ft.+chris+brown+-+no+air" file="03-Jordin-Sparks-ft-Chris-Brown---No-Air.mp3" length="248.53" /> <track id="238972" position="4" title="Kyonte+-+99" file="04-Kyonte---99.mp3" length="215.64" /> <track id="238973" position="5" title="Ne-yo+-+dream" file="05-Ne-Yo---Dream.mp3" length="189.26" /> <track id="238974" position="6" title="One+chance+-+one+girl" file="06-One-Chance---One-Girl.mp3" length="231.97" /> <track id="238975" position="7" title="Chris+brown+-+dying" file="07-Chris-Brown---Dying.mp3" length="110.42" /> <track id="238976" position="8" title="Issa+ft.+trina+-+boss+lady" file="08-Issa-ft-Trina---Boss-Lady.mp3" length="244.85" /> <track id="238977" position="9" title="Lyfe+jennings+-+never+never+land" file="09-Lyfe-Jennings---Never-Never-Land.mp3" length="232.91" /> <track id="238978" position="10" title="Akon+ft.+40+glocc+-+borrow+u" file="10-Akon-ft-40-Glocc---Borrow-U.mp3" length="243.62" /> <track id="238979" position="11" title="Lil+mama+ft.+t-pain+%26+chris+brown+-+shawty+get+loose+%28official+remix%29" file="11-Lil-Mama-ft-T-Pain-amp-Chris-Brown---Shawty-Get.mp3" length="201.95" /> <track id="238980" position="12" title="Slim+%28of+112%29+ft.+pitbull+-+i+ain%27t+scared" file="12-Slim-of-112-ft-Pitbull---I-Aint-Scared.mp3" length="288.44" /> <track id="238981" position="13" title="Lil+eddie+ft.+defy+-+easier+to+stay" file="13-Lil-Eddie-ft-Defy---Easier-To-Stay.mp3" length="201.72" /> <track id="238982" position="14" title="Uness+-+taste+your+heartbeat" file="14-Uness---Taste-Your-Heartbeat.mp3" length="180.74" /> <track id="238983" position="15" title="Razah+-+club+hobbing" file="15-Razah---Club-Hobbing.mp3" length="219.56" /> <track id="238984" position="16" title="Cheri+dennis+-+flow+wit+me" file="16-Cheri-Dennis---Flow-Wit-Me.mp3" length="170.29" /> <track id="238985" position="17" title="Lisha+ft.+scola+%28of+dru+hill%29+-+i+got+you" file="17-Lisha-ft-Scola-of-Dru-Hill---I-Got-You.mp3" length="197.15" /> <track id="238986" position="18" title="Tiffany+evans+ft.+bow+wow+-+i%27m+grown" file="18-Tiffany-Evans-ft-Bow-Wow---Im-Grown.mp3" length="197.77" /> <track id="238987" position="19" title="Ray+l+-+all+i+want+is+her" file="19-Ray-L---All-I-Want-Is-Her.mp3" length="189.68" /> <track id="238988" position="20" title="Joelle+-+drop+her+off" file="20-Joelle---Drop-Her-Off.mp3" length="176.51" /> <track id="238989" position="21" title="Deepside+ft.+dre+-+feelin+like+a+pimp" file="21-Deepside-ft-Dre---Feelin-Like-A-Pimp.mp3" length="209.95" /> </mixtape> Ok i want the xml to parse each track line and extract the data from tite= and file=.. if anyone code point me towards a good tut or help me out a little thanks
  18. It would be the same for http $handle = fopen("http://user:password@example.com/somefile.php");
  19. You would enter <p><a href="index.php?page=aboutus">about us</a></p> just like that
  20. I know you can use a preg_match line but not sure on how to do it. any preg coders?
  21. Found this function in one of the scripts that i have that auto imports db files. you can try to disect it and see what you get <?php function mysql_restore($host, $name, $pass, $database, $file) { mysql_connect ($host, $name, $pass) or die ("Could not connect to the Database"); mysql_select_db($database) or die ("Could not choose a Database"); mysql_query("SET NAMES '".$this->charset."'"); if(preg_match("/^(.+?)\.sql(\.(bz2|gz))?$/", $file, $matches)) { if (isset($matches[3]) && $matches[3] == 'bz2') { $this->SET['comp_method'] = 2; } elseif (isset($matches[2]) &&$matches[3] == 'gz'){ $this->SET['comp_method'] = 1; } else{ $this->SET['comp_method'] = 0; } $this->SET['comp_level'] = ''; if (!file_exists($file)) die("File not found!"); } $fp = $this->fn_open($file, "r"); $this->file_cache = $sql = $table = $insert = ''; $is_skd = $query_len = $execute = $q =$t = $i = $aff_rows = 0; $limit = 300; $index = 4; $tabs = 0; $cache = ''; $info = array(); while(($str = $this->fn_read_str($fp)) !== false){ if (empty($str) || preg_match("/^(#|--)/", $str)) { if (!$is_skd && preg_match("/^#SKD101\|/", $str)) { $info = explode("|", $str); $is_skd = 1; } continue; } $query_len += strlen($str); if (!$insert && preg_match("/^(INSERT INTO `?([^` ]+)`? .*?VALUES)(.*)$/i", $str, $m)) { if ($table != $m[2]) { $table = $m[2]; $tabs++; $i = 0; } $insert = $m[1] . ' '; $sql .= $m[3]; $index++; $info[$index] = isset($info[$index]) ? $info[$index] : 0; $limit = round($info[$index] / 20); $limit = $limit < 300 ? 300 : $limit; if ($info[$index] > $limit){ $cache = ''; } } else{ $sql .= $str; if ($insert) { $i++; $t++; } } if (!$insert && preg_match("/^CREATE TABLE (IF NOT EXISTS )?`?([^` ]+)`?/i", $str, $m) && $table != $m[2]){ $table = $m[2]; $insert = ''; $tabs++; $cache .= "Table `{$table}`."; $i = 0; } if ($sql) { if (preg_match("/;$/", $str)) { $sql = rtrim($insert . $sql, ";"); $insert = ''; $execute = 1; } if ($query_len >= 65536 && preg_match("/,$/", $str)) { $sql = rtrim($insert . $sql, ","); $execute = 1; } if ($execute) { $q++; mysql_query($sql) or trigger_error ("Wrong Query.<BR>" . mysql_error(), E_USER_ERROR); if (preg_match("/^insert/i", $sql)) { $aff_rows += mysql_affected_rows(); } $sql = ''; $query_len = 0; $execute = 0; } } } mysql_close(); return true; } ?>
  22. Hi All, Had a few questions. ok what do you guys think of the best method for getting the file contents of a file and parsing it for a certain like of text and extracting it into a string heres an example.. <?php /** * @author * @copyright 2007 */ if($_POST['site']) { $file = stripslashes($_POST['site']); $getfile = file_get_contents($file); echo $getfile; } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="site"> <input type="submit" value="submit" ?> </form> <? } ?> Ok i want to parse $getfile for this line mp.addVariable('file', 'http://www.domain.com/static/player/playlist.get.php%3Fid%3D5541%7CTS'); and put the filename which is in the second '' brackets into a variable. Thanks
  23. Well its best for expose_php to be off . It being on allow malicious users to know which version of php you are using and in every request that PHP is being used. with this they can used vulnerabilities on you etc.
×
×
  • 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.