cheechm
Members-
Posts
256 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
cheechm's Achievements
Regular Member (3/5)
0
Reputation
-
Admittedly my first question wasn't as clear. How might I go around drawing a single pixel line with a vertical gradient?
-
I've got some code that basically draws a wavefrom line by line (going horizontally). I was hoping to be able to get a vertical gradient, however I'm not too sure where to start. imageline( $img, // x1 (int) ($data_point / DETAIL), // y1: height of the image minus $v as a percentage of the height for the wave amplitude $height * $wav - $v, // x2 (int) ($data_point / DETAIL), // y2: same as y1, but from the bottom of the image $height * $wav - ($height - $v), imagecolorallocate($img, $r, $g, $B) ); The full code is available here: Github Another question I have: Is it possible to fill every part of the PNG image which isn't transparent with a solid colour? Thanks
-
Perfect. Thanks requinix. Thread solved!
-
Little help please!! $parameters['audio_clip[uploaded_data]'] = "@http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . "upload/" . $_FILES['test_file']['name'] .";type=". $_FILES['test_file']['type']; $parameters['audio_clip[uuid]'] = gen_uuid(); $parameters['audio_clip[title]'] = "Remote Upload Test"; $parameters['audio_clip[recorded_at]'] = ""; $parameters['audio_clip[tag_list]'] = "tag, podcast, test"; $parameters['audio_clip[category_id]'] = 60; $options = array(); $options['RequestContentType'] = "multipart/form-data"; $options['RequestBody'] = ''; $options['return_auth'] = 1; $auth = $client->CallAPI($url, $method, $parameters, $options, $response); $headers = array( "POST ".$auth['RequestURI']." HTTP/1.0", "Authorization: " . $auth['Headers']['Authorization'], "Accept: */*", "Host: " . $auth['Headers']['Host'], "Content-Type: multipart/form-data", "Content-Length" . $auth['Headers']['Content-Length'], "User-Agent: " . $auth['Headers']['User-Agent'] ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $exec = curl_exec($ch); curl_close($ch); echo "<pre>Output: "; print_r($exec); echo "</pre>"; Trying to upload a file via the API to audioboo.fm . The relevant documentation is here: https://github.com/Audioboo/api/blob/master/sections/audio_clips.md The reply I get from the server is raw attachment invalid/blank. Not sure what I'm doing wrong? I can manage simple PUT/GET requests and I know I'm authenticated properly, however I'm having trouble sending a file. (It is an MP3). Cheers
-
Excellent.. All fixed up! Thanks for quick repplies. Nick
-
Thanks but now this: UPDATE customers SET `number` = '07894512345' AND address = 'London' AND email = 'niaaaaak@live.com' AND name = 'Nick' AND postcode = 'WE1 3SW' AND company = 'Design' WHERE cid = 4 It sets number as 1? what!! Number = varchar(40) latin1_swedish_ci Thanks so far!
-
Hi, I am trying to insert a number starting with a zero into a MySQL table, however the 0 is always taken off. I tried all of the int types. What is wrong? $sql = "UPDATE customers SET telephone = '07798494825'; Thanks
-
Doesn't make a difference. Thanks anyway though.
-
Hi, So for instance I am on this page: http://mydomain.com/?id=1 it could also be: http://mydomain.com/?id=4&do=search So I was wondering, when I use my get_url() function: function get_url() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") { $pageURL .= "s"; } $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; } else { $_SERVER['REQUEST_URI'] = str_replace(array('&', '&'), array('&', '&'), $_SERVER['REQUEST_URI']); $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; } return $pageURL; } why does it form a link, for instance like: http://mydomain.com/?id=2&do=2&id=3 I don't want 2 places where id is set. It would eventually make the url clogged up. Also, I have to use that function because of the different variables that could be in the URL. Many thanks.
-
Nope doesn't seem to work. Thanks anyway.
-
Why doesn't this query work? SELECT q.qid, q.cid, q.status, c.name, c.company FROM quote AS q INNER JOIN customers AS c USING (cid) WHERE q.cid = 128 It shows every result from quote and customers instead of just the ones where quotes.cid = 128. Thanks
-
I saw it at another site without credit.
-
If I had an array like this: Array ( [subtitle] => Array ( [value] => Cool Test [name] => Subtitle [order] => 2 [section] => 1 [type] => 0 ) [domain] => Array ( [value] => localhost [name] => Domain Name [order] => 3 [section] => 0 [type] => 0 ) ) How would I sort the array by order?
-
Hi, How would I sort these two arrays against each other? Array ( [domain] => localhost [postcode] => SW10 [name] => Point [company_name] => Point [shipping_username] => Nick [api_key] => ******** [address] => London [subtitle] => Cool Test [phone] => 0777777 [limit] => 10 [delivery] => 1.50 [email_confirm] => 1 [online] => 1 [seed] => 0dAfghRqSTgx [install_path] => /server/lhs/ ) Array ( [name] => 1 [online] => 12 [postcode] => 8 [phone] => 6 [address] => 7 [delivery] => 11 [subtitle] => 2 [email_confirm] => 9 [domain] => 3 [install_path] => 4 [seed] => 0 [limit] => 10 [api_key] => 14 [shipping_username] => 13 [company_name] => 5 ) You'll see in the second array for instance that [name] => 1 and [subtitle] => 2.. How in the first array would I order it so that is went: [name] => Point [subtitle] => Cool Test ...etc? I tried array_multisort() but I don't think it is the right one? If it is I couldn't get it to work. Thanks