Jump to content

lordphate

Members
  • Posts

    154
  • Joined

  • Last visited

    Never

Everything posted by lordphate

  1. I agree with RussellReal, that is what i do.
  2. yes, jQuery is ajax, i would have to second that, as there is no PHP in the test.php...
  3. Do you have a demo online so we know what is happening ?
  4. Okay the title may be confusing... I'm trying to download a file from a site [they offer the download for free]. however i get a 403 error when trying to use curl or fsocketopen. after ALOT of trial and error i found out that you must be actively on the site to be able to download the file.. Is there a way to do this using curl or fsocketopen? I'll post what i have right now $curl = curl_init($reffer); curl_setopt($curl, CURLOPT_URL,$reffer); curl_setopt($curl, CURLOPT_USERAGENT, $agent); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); $store = curl_exec ($curl); curl_setopt($curl, CURLOPT_URL,$values["video"]); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $flv = curl_exec($curl); print($flv);exit; fwrite($flash,$flv); fclose($flash); curl_close($curl);
  5. Can you paste your entire function, i don't see where the {$classID} is set, or how
  6. okay here is my newest code $host_details = parse_url($values["video"]); $host = $host_details["host"]; $fh = fsockopen($host, 80, $errno, 5); if($fh) { return "error"; } else { i know $values["video"] is set...
  7. you will need to only sear for the www.domain.com, not http:// as you will usually have a / in the end of referrers
  8. $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,$LOGINURL); curl_setopt($curl, CURLOPT_USERAGENT, $agent); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_REFERER, $reffer); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path); $store = curl_exec ($curl); $url = $values["video"]; $fh = fsockopen($url, 80, $errno, 300); if(!$fh) { return $errno; } else { $headers = get_headers($values["video"],1); print_r($headers);exit; } $hdr .= "POST ".$headers["0"]." HTTP/1.0\r\n"; $hdr .= "Host: $host\r\n"; $hdr .= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"; $hdr .= "Content-Type: application/x-www-form-urlencoded\r\n"; $hdr .= "Content-Length: ".strlen($uri)."\r\n"; $hdr .= "Connection: close\r\n\r\n"; and believe it or not i did google it, but everything was saying it was a bug in 5.0.5...
  9. Hey guys, I'm running php 5.2.8 [the newest] on centOS I'm getting : Fatal error: Only variables can be passed by reference in /home/deathbyb/public_html/modules/imports.php on line 58 I've never seen this error before, here's line 58 $fh = fsockopen($values["video"], 80, $errno, 300); Any suggestions ?
  10. Okay heres' an update on this. You are not required to login to download the file, the url to download the file is only shown while logged in...so something else is stopping me from downloading the file from curl. URL WAS HERE GET /flv/c4e79206ac774634e64ddf32d3d9c26e/496caee5/0810/18/48f991816be67/48f991816be67.flv HTTP/1.1 Host: HOST WAS HERE User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: __utma=41441447.536235636.1231387991.1231856911.1231859410.10; __utmz=41441447.1231387991.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utmc=41441447; __utmb=41441447 Range: bytes=658608- If-Range: "1105876484" HTTP/1.x 206 Partial Content Content-Type: video/x-flv Accept-Ranges: bytes Etag: "1105876484" Last-Modified: Sat, 18 Oct 2008 07:34:40 GMT Content-Range: bytes 658608-76447996/76447997 Content-Length: 75789389 Date: Tue, 13 Jan 2009 15:11:38 GMT Server: lighttpd/1.4.19 Any idea what i'm missing ? Heres my updated code: ///////////////////////////////////////////////////////// $LOGINURL = "http://www.DOMAIN.com/login.html"; $id = "username"; $password = "password"; $POSTFIELDS = 'username='.$id.'&password='.$password; $agent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"; $cookie_file_path = "cookies.txt"; $reffer = "http://www.DOMAIN.com"; $hash = build_unique_path(DOC_ROOT."/vid",".flv"); $dist_file = DOC_ROOT."/vid/".$hash.".flv"; $flash = fopen( $dist_file, 'wb' ); $scr = build_unique_path(DOC_ROOT."/scr",".jpg"); $screen = DOC_ROOT."/scr/".$scr."_1.jpg"; $jpeg = fopen( $screen, 'wb' ); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,$LOGINURL); curl_setopt($curl, CURLOPT_USERAGENT, $agent); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_REFERER, $reffer); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path); $store = curl_exec ($curl); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_REFERER, $reffer); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($curl, CURLOPT_USERAGENT, $agent); curl_setopt($curl, CURLOPT_URL, $values["video"]); $flv = curl_exec($curl); fwrite( $flash, $flv ); fclose( $flash ); curl_setopt($curl, CURLOPT_URL, $values["screenshot"]); $jpg = curl_exec($curl); curl_close($curl); fwrite( $jpeg, $jpg ); fclose( $jpeg );
  11. I do not think the cookies are saving to my server... Is my login curl script correct on fetching cookies ?
  12. It is a login html page. Not htpasswd I believe it has to do with cookies ?
  13. Hey Everyone, I am trying to download 2 files, a video and a screenshot from a website, it requires login, and without alogin you get 403 error. I am a member there, so i've tried to write this up function video_import_url() { $info = auth_member(); set_time_limit(0); include_once(DOC_ROOT."/functions/form_functions.php"); $values = form_handle_input("videos_import_url"); ///////////////////////////////////////////////////////// $LOGINURL = "http://www.DOMAIN.com/login.html"; $id = "Username"; $password = "Password"; $POSTFIELDS = 'username='.$id.'&password='.$password; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $cookie_file_path = "/home/USER/pubic_html/.cookies/"; $reffer = "http://www.DOMAIN.com/login.html"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,$LOGINURL); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($curl, CURLOPT_USERAGENT, $agent); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_REFERER, $reffer); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec ($curl); /////////////////////////////////////////////////////// $hash = build_unique_path(DOC_ROOT."/vid",".flv"); $dist_file = DOC_ROOT."/vid/".$hash.".flv"; $out = fopen( $dist_file, 'wb' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_URL, $values["video"]); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); $c = curl_exec($ch); curl_close($ch); fwrite( $out, $c ); fclose( $out ); ////////////////////////////////////////////////////// $scr = build_unique_path(DOC_ROOT."/scr",".jpg"); $screen = DOC_ROOT."/scr/".$scr."_1.jpg"; $out = fopen( $screen, 'wb' ); $ch = curl_init(); $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_URL, $values["screenshot"]); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); $c = curl_exec($ch); curl_close($ch); fwrite( $out, $c ); fclose( $out ); /////////////////////////////////////////////////////// curl_close ($curl); if(!file_exists($dist_file)) { echo $dist_file.' aka '.$values["title"].' did not download'; exit; } $duration = extract_duration_from_file( $dist_file ); $tags = explode(" ", $values["tags"]); $tags = handle_empties( $tags ); $vals["tags"] = "|".implode("|", $tags)."|"; $sql_query = "INSERT INTO videos (mem_id,title,description,category,tags,date,country,location,broadcast,comments,comment_voting,responses,ratings,embedding,vhash,shash,posted,approved,converted,screenshot) VALUES (:mem_id:,':title:',':description:',':category:',':tags:',':date:','223',':location:',':broadcast:',':comments:',':comment_voting:',':responses:',':ratings:','0',':hash:',':shash:',:time:,':approved:','1','1')"; $vals["mem_id"] = $info["mem_id"]; $vals["category"] = $values["category"]; $vals["title"] = $values["title"]; $vals["description"] = $values["description"]; $vals["approved"] = ( $GLOBALS["Videos"]->approve ) ? 0 : 1; $vals["time"] = time(); $vals["hash"] = $hash; $vals["shash"] = $scr; $GLOBALS["DB"]->values = $vals; $vid_id = $GLOBALS["DB"]->insert( $sql_query ); $GLOBALS["DB"]->clean(); load_page( "index.php?page=videos&section=upload_complete&vid_id=".$vid_id ); } Please note that the problem is not with $hash as it does create the file, but in the ".flv" file you edit it using notepad or something similar and you get <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>403 - Forbidden</title> </head> <body> <h1>403 - Forbidden</h1> </body> </html> any suggestions?
  14. Hi Everyone, this is what i have, for the most part it works out pretty well Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+) profiles/index.php?folder=$1&%{QUERY_STRING}$ [L] RewriteRule ^articles/^[a-z0-9_-]+/([0-9]+)\.html index.php?page=articles&art_id=$1&%{QUERY_STRING}$ [L,NC] RewriteRule (.*)-(.*)-(.*)-(.*)\.html index.php?page=$1&section=$2&category=$3&subcategory=$4&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)-(.*)\.html index.php?page=$1&section=$2&category=$3&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)\.html index.php?page=$1&section=$2&%{QUERY_STRING}$ [L] RewriteRule ^([^.]+).html index.php?page=$1&%{QUERY_STRING}$ [L] The only thing that doesn't work is the RewriteRule ^articles/^[a-z0-9_-]+/([0-9]+)\.html index.php?page=articles&art_id=$1&%{QUERY_STRING}$ [L,NC] Any ideas on this ? Thanks in advance!!
  15. Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/ profiles/index.php?folder=$1&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)-(.*)-(.*)\.html index.php?page=$1&section=$2&category=$3&subcategory=$4&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)-(.*)\.html index.php?page=$1&section=$2&category=$3&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)\.html index.php?page=$1&section=$2&%{QUERY_STRING}$ [L] RewriteRule (.*)\.html index.php?page=$1&%{QUERY_STRING}$ [L] If i have a regular .html page, it gives me a page not found error.
  16. Hey everyone, So i've got a set of rewrite rules Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/ profiles/index.php?folder=$1&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)-(.*)-(.*)\.html index.php?page=$1&section=$2&category=$3&subcategory=$4&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)-(.*)\.html index.php?page=$1&section=$2&category=$3&%{QUERY_STRING}$ [L] RewriteRule (.*)-(.*)\.html index.php?page=$1&section=$2&%{QUERY_STRING}$ [L] RewriteRule ^([^.]+)\.html index.php?page=$1&%{QUERY_STRING}$ [L] RewriteRule ^articles/[a-z0-9_-]+/([0-9]+)\.html$ index.php?page=articles&art_id=$1&%{QUERY_STRING}$ [L] However i can't get the last one to work... Any ideas ? I wanted it something like www.domain.com/articles/Why-The-Man-Walked-The-Moon/10.html (10 being the art_id)
  17. OKay i kinda have this working Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/ profiles/index.php?folder=$1&%{QUERY_STRING}$ RewriteRule ([^.]+)\.html index.php?page=$1&%{QUERY_STRING}$ RewriteRule ([^.]+)-([^.]+)\.htm index.php?page=$1&section=$2&%{QUERY_STRING}$ Works but i have to use / at the end of the profiles rewrite , i have to seperate the page=&section with .htm not .html because that won't work... ideas?
  18. From what i read you cannot convert jpeg to png..is this true, if not how do i do it ?
  19. Hey everyone I'm trying to make multiple modrewrite rules but as soon as i add more than one the others stop working... here's what i'm trying to do Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^.]+)\.html index.php?page=$1 RewriteRule ([^.]+)-([^.]+)\.html index.php?page=$1&section=$2 RewriteRule ^([^.]+) profiles/index.php?folder=$1 [L] If i remove the ?page=$1 and/or ?page=$1&section=$2 then profiles will work, but if i remove the profiles ?page=$1 will work but the ?page=$1&section=$2 never works Any one have a suggestions and i'll be adding alot more after this
  20. I need help in creating transparent sides to my photos if(!$path) $path = DOC_ROOT."/photos"; mt_srand((double) microtime() * 100000); $photo_name = hs_substr(md5(time().mt_rand(0,100)),0,15); $folder = substr($photo_name,0,2); if(!file_exists($path."/".$folder)) mkdir($path."/".$folder,PERMISSIONS); $folder.= "/".substr($photo_name,2,2); if(!file_exists($path."/".$folder)) mkdir($path."/".$folder,PERMISSIONS); $folder.= "/".substr($photo_name,4,2); if(!file_exists($path."/".$folder)) mkdir($path."/".$folder,PERMISSIONS); $photo["ex"] = $folder."/".$photo_name.".png"; $photo["med"] = $folder."/".$photo_name."_med.png"; $photo["small"] = $folder."/".$photo_name."_small.png"; if($upload) move_uploaded_file($tmpfile,$path."/".$photo["ex"]); else copy($tmpfile,$path."/".$photo["ex"]); chmod($path."/".$photo["ex"], 0644); list($ex_width,$ex_height) = getimagesize($path."/".$photo["ex"]); //landscape image or square if($ex_width >= $ex_height){ if($ex_width > $GLOBALS["settings"]["photo_ex_width"]){ $ds_width_ex = $GLOBALS["settings"]["photo_ex_width"]; $ratio_ex = $ex_width / $ds_width_ex; $ds_height_ex = $ex_height / $ratio_ex; $ds_height_ex = round($ds_height_ex); if($ds_height_ex > $GLOBALS["settings"]["photo_ex_height"]) $ds_height_ex = $GLOBALS["settings"]["photo_ex_height"]; }//if else{ $ds_width_ex = $ex_width; $ds_height_ex = $ex_height; }//else if($ex_width > $GLOBALS["settings"]["photo_med_width"]){ $ds_width_med = $GLOBALS["settings"]["photo_med_width"]; $ratio_med = $ex_width / $ds_width_med; $ds_height_med = $ex_height / $ratio_med; $ds_height_med = round($ds_height_med); if($ds_height_med > $GLOBALS["settings"]["photo_med_height"]) $ds_height_med = $GLOBALS["settings"]["photo_med_height"]; }//if else{ $ds_width_med = $ex_width; $ds_height_med = $ex_height; }//else if($ex_width > $GLOBALS["settings"]["photo_small_width"]){ $ds_width_small = $GLOBALS["settings"]["photo_small_width"]; $ratio_small = $ex_width / $ds_width_small; $ds_height_small = $ex_height / $ratio_small; $ds_height_small = round($ds_height_small); if($ds_height_small > $GLOBALS["settings"]["photo_small_height"]) $ds_height_small = $GLOBALS["settings"]["photo_small_height"]; }//if else{ $ds_width_small = $ex_width; $ds_height_small = $ex_height; }//else }//if //portrait image elseif($ex_width < $ex_height){ if($ex_height > $GLOBALS["settings"]["photo_ex_height"]){ $ds_height_ex = $GLOBALS["settings"]["photo_ex_height"]; $ratio_ex = $ex_height / $ds_height_ex; $ds_width_ex = $ex_width / $ratio_ex; $ds_width_ex = round($ds_width_ex); if($ds_width_ex > $GLOBALS["settings"]["photo_ex_width"]) $ds_width_ex = $GLOBALS["settings"]["photo_ex_width"]; }//if else{ $ds_width_ex = $ex_width; $ds_height_ex = $ex_height; }//else if($ex_height > $GLOBALS["settings"]["photo_med_height"]){ $ds_height_med = $GLOBALS["settings"]["photo_med_height"]; $ratio_med = $ex_height / $ds_height_med; $ds_width_med = $ex_width / $ratio_med; $ds_width_med = round($ds_width_med); if($ds_width_med > $GLOBALS["settings"]["photo_med_width"]) $ds_width_med = $GLOBALS["settings"]["photo_med_width"]; }//if else{ $ds_width_med = $ex_width; $ds_height_med = $ex_height; }//else if($ex_height > $GLOBALS["settings"]["photo_small_height"]){ $ds_height_small = $GLOBALS["settings"]["photo_small_height"]; $ratio_small = $ex_height / $ds_height_small; $ds_width_small = $ex_width / $ratio_small; $ds_width_small = round($ds_width_small); if($ds_width_small > $GLOBALS["settings"]["photo_small_width"]) $ds_width_small = $GLOBALS["settings"]["photo_small_width"]; }//if else{ $ds_width_small = $ex_width; $ds_height_small = $ex_height; }//else }//elseif $x_ex = round((($GLOBALS["settings"]["photo_ex_width"] - $ds_width_ex)/2)); if($x_ex == 0) $x_ex = 1; $y_ex = round((($GLOBALS["settings"]["photo_ex_height"] - $ds_height_ex)/2)); if($y_ex == 0) $y_ex = 1; $x_med = round((($GLOBALS["settings"]["photo_med_width"] - $ds_width_med)/2)); if($x_med == 0) $x_med = 1; $y_med = round((($GLOBALS["settings"]["photo_med_height"] - $ds_height_med)/2)); if($y_med == 0) $y_med = 1; $x_small = round((($GLOBALS["settings"]["photo_small_width"] - $ds_width_small)/2)); if($x_small == 0) $x_small = 1; $y_small = round((($GLOBALS["settings"]["photo_small_height"] - $ds_height_small)/2)); if($y_small == 0) $y_small = 1; if($extension == ".gif"){ $src = ImageCreateFromGif($path."/".$photo["ex"]); }//if elseif($extension == ".jpeg"){ $src = ImageCreateFromJpeg($path."/".$photo["ex"]); }//elseif $dst_ex = ImageCreateTrueColor($GLOBALS["settings"]["photo_ex_width"]+2,$GLOBALS["settings"]["photo_ex_height"]+2); $dst_med = ImageCreateTrueColor($GLOBALS["settings"]["photo_med_width"]+2,$GLOBALS["settings"]["photo_med_height"]+2); $dst_small = ImageCreateTrueColor($GLOBALS["settings"]["photo_small_width"]+2,$GLOBALS["settings"]["photo_small_height"]+2); $white_ex = imagecolorat($dst_ex,1,1); $white_med = imagecolorat($dst_med,1,1); $white_small = imagecolorat($dst_small,1,1); $white_ex = ImageColorTransparent($dst_ex,$white_ex); $white_med = ImageColorTransparent($dst_med,$white_med); $white_small = ImageColorTransparent($dst_small,$white_small); ImageFilledRectangle($dst_ex,1,1,$GLOBALS["settings"]["photo_ex_width"],$GLOBALS["settings"]["photo_ex_height"],$white_ex); ImageFilledRectangle($dst_med,1,1,$GLOBALS["settings"]["photo_med_width"],$GLOBALS["settings"]["photo_med_height"],$white_med); ImageFilledRectangle($dst_small,1,1,$GLOBALS["settings"]["photo_small_width"],$GLOBALS["settings"]["photo_small_height"],$white_small); ImageCopyResampled($dst_ex,$src,$x_ex,$y_ex,0,0,$ds_width_ex,$ds_height_ex,$ex_width,$ex_height); ImageCopyResampled($dst_med,$src,$x_med,$y_med,0,0,$ds_width_med,$ds_height_med,$ex_width,$ex_height); ImageCopyResampled($dst_small,$src,$x_small,$y_small,0,0,$ds_width_small,$ds_height_small,$ex_width,$ex_height); if($extension == ".gif"){ ImagePng($dst_ex,$path."/".$photo["ex"]); }//if elseif($extension == ".jpeg"){ ImagePng($dst_ex,$path."/".$photo["ex"],80); }//elseif ImagePng($dst_med,$path."/".$photo["med"],80); ImagePng($dst_small,$path."/".$photo["small"],80); ImageDestroy($src); ImageDestroy($dst_ex); ImageDestroy($dst_med); ImageDestroy($dst_small); return $photo; If you have any questions please don't hesitate to ask here is an example of what its doing right now
  21. Okay here's what i'm trying to do.. [code=php:0] function ranks($username){ $mysql = @mysql_connect("*","*","*",1) or die('Cannot Connect to $mysql'. mysql_error()); $db = @mysql_select_db("*",$mysql)or die(mysql_error()); $sql_query = "SELECT user_rank FROM phpbb_users WHERE username='".$username."'"; $rank = mysql_query($sql_query) or die('Cannot Get $rank'. mysql_error()); // $rank = extract_option("ranks",$rank); return $rank; }//ranks [/code] http://www.tradeprofessional.net/index.php?handler=search&action=perform&search_type=members&fname=&lname=&email=&handshakes=0&distance=0&country=223&state=3435&city=124807 This is what its doing the "Resource ID's"
  22. <?php // array containing data $array = array( "name" => "John", "surname" => "Doe", "email" => "j.doe@intelligence.gov" ); // build query... $sql = "INSERT INTO table"; // implode keys of $array... $sql .= " (`".implode("`, `", array_keys($array))."`)"; // implode values of $array... $sql .= " VALUES ('".implode("', '", $array)."') "; // execute query... $result = mysql_query($sql) or die(mysql_error()); ?> I found this on php.net and i'm trying to figure out how to UPDATE instead of inserting a new row. what would i need to do
  23. Trecool Yeah THATS not confusing at all But even with that, i need it to add the $photo_small to the contest table seperated by | Displaying the array isn't the problem its storing and deleting certain points in the array is the issue
  24. Arg, i just found out i need to use implode and explode. I'm looking it up on php.net but it's looking awfully confusing to me lol
  25. Okay I tried $sql_query = "SELECT photo_small FROM photos WHERE pho_id=".$pho_id; $photo_small .= $GLOBALS["DB"]->single($sql_query); but that doesn't work still replaces. I dont know if i explained what it is i'm doing This will be for a voting contest script. People will have a link under their photos saying "Add to voting" and thats when it's supposed to add it to the existing answers
×
×
  • 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.