Re: [PHP] PHP connection to external application
On Thu, 2008-06-12 at 21:20 +1000, hce wrote: > Hi, > > What is the best way for a PHP web application to connect to an > external application written by C in Linux OS? > > (1) Can PHP directly call external C functions, or similar solution? > > (2) Can PHP pass messages to message queue which external C program can > access? > > (3) Socket connection between the PHP and externam C program. > > Thank you. > If that C program can support SOAP calls ... then that will probably be the best route for you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect after pdf / file download
On Thu, 2008-06-12 at 16:27 +0530, Yashesh Bhatia wrote: > Aschwin: > > Hi i tried > > -- > //echo ''; > //echo 'window.location.href="3.html";'; > //echo ''; > header("Location: 3.html"); > exit; > -- > but that did not work :(. > > thanks for the tip. > > yashesh bhatia What about doing it the other way ... submitting the page to a script that calls on the pdf creation, yet doesnt leave this script - then proceed to redirect when that script (pdf) has been completed? S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] joins issues again
Hi all, I have the following SQL statement; SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID FROM sales LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid LEFT JOIN branch ON IGuser.branchID = branch.branchID LEFT JOIN company ON branch.companyID = '{$companyID}' WHERE maincompanyid = '{$mcid}' GROUP BY branch.branchID ORDER BY branch_name ASC However, i do not want those join records to be appended, only to return the count of records from sales. Can someone assist me with this? I have tried differance variants of joins and none of the results are correct. Sales tbl doesnt have the companyID, nor does IGuser Regards, Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql joins
I have three tables, namely; User - UID - Firstname - Surname - Tel - Cell - Email Tracker - UID - Points Winners - UID - Datetime (-00-00 00:00:00) I need to get the following information from the above tables (in my logical sense) All users from user with sum(points) as points and datetime > datetime + 14 days In English, the all users must be selected, excluding the ones that have won in the last 14 days and return all the information and the sum of points I suspect I would need to use joins here ... but have no clue how to do so ... I have read up a bit and can work out inner joins from three tables, but not coping with this problem above Can someone help me out with this please? Many thanks Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php cron to check and remove files
>Do you already have some code? Do you got stuck somewhere? No, i didnt even know where to start with the flow; but sitting on the toilet produces wonderfull ideas! I have the following in mind; list the entire directory into an array, using a foreach to check on the db if the file exists, then remove if not. I was TRYING to start by doing it the other way round I shouldnt have a problem now :) S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php cron to check and remove files
Hi, I need to be able to do the following procedure; retrieve all items from a mysql db table, then check to see if the files from that table exist on the server (images), if not, to "clean up" and remove the physical file - so that only the files from the db exist. This will run via cron Has anyone done something similar before, willing to assist me with a basic scope of actions to work on? Thanks in advance Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getenv ... i think
Hi all, http://steven.macintyre.name/myscript.phps is my code as it stands The purpose of the code is as follows; Its for a non-profit company - wanting to offer "support" banners for users who pay for them right ... as in donation. They want to be able to restrict those banners to a certain period "the bought period" and I want to restrict them to only access the banners from the specified URL when they signed up. IE ... if you signed up with http://www.yourlovelydomain.com i want to be able to limit the display of these banners depending on the hash and somehow - checking the domain its coming from Any ideas - am i on the right track ? If i take OUT the getenv if then, it works ... so i know that is where the problem is. S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] while-do +array
> Your subject line says "while-do" + array, following code contains > a > "do-while" loop. Apologies :) > We can't debug the script very well without a > sample > input since we don't know how many times the loop "should" run. To > debug > yourself, try using print_r() to see exactly what the following > line of > code produces: > > $options = explode(",", $armbase); > Array ( [0] => 4200_side_frame.jpg [1] => 4220_integral_frame.jpg [2] => flamingo_pu_armrest.jpg [3] => flexible_pu_armrest.jpg [4] => futura_standard_sleigh_base.jpg [5] => futura_universal_sleigh_base.jpg ) That's the output ... so the array is definitely ok ... s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] while-do +array
Hiya, I have the following code ... which only seems to result in one item ... which is incorrect ... can anyone spot my problem? if ($armbase != "") { $options = explode(",", $armbase); $text .= ''; $get_endRow = 0; $get_columns = 8; $get_hloopRow1 = 0; do { if($get_endRow == 0 && $get_hloopRow1++ != 0) { $text .= ''; $text .= ''; $text .= ""; $text .= ''; $get_endRow++; } if($get_endRow >= $get_columns) { $text .= ''; $get_endRow = 0; } } while(list($key,$value) = each($options)); if($get_endRow != 0) { while ($get_endRow < $get_columns) { $text .= ' '; $get_endRow++; } $text .= ''; } $text .= ''; } The purpose of the code is to create 8 colums and populate based on the total results returned from the while-do check Thanks in advance Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] duration of mp3 file
Shyte ... The files are VBR ... I will read up and when I find answer - will revert to list with it as well.. Ps. Everyone is a bunny to me :P S > -Original Message- > From: Jim Moseby [mailto:[EMAIL PROTECTED] > Sent: 11 July 2007 03:55 PM > To: 'Steven Macintyre'; php-general@lists.php.net > Subject: RE: [PHP] duration of mp3 file > > > > > Allow bunnies ... > > > > Any takers on this ... I JUST want the duration of the mp3 > > file - with a > > small function if possible ... I honestly don't want to use a > > class like > > http://www.phpclasses.org/browse/package/112.html > > > > The coding is terrible and SERIOUSLY over inflated for what I > want. > > > > Anyone know of a simple class / function ? > > > > S > > > > Apparently, you can read the header of the file to find the > bitrate, then > calculate the approximate play duration from that info and the > filesize. > Here is information on the mp3 file format: > > http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm > > ...and here is a discussion thread that provides the calculation > and other > links: > > http://www.hydrogenaudio.org/forums/lofiversion/index.php/t46563.ht > ml > > I've never done this, and apparently there is an issue with MP3s > that have > variable bitrates, but maybe this will get you started in the right > direction. > > HTH - JM <-- not anything like a bunny ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] duration of mp3 file
Allow bunnies ... Any takers on this ... I JUST want the duration of the mp3 file - with a small function if possible ... I honestly don't want to use a class like http://www.phpclasses.org/browse/package/112.html The coding is terrible and SERIOUSLY over inflated for what I want. Anyone know of a simple class / function ? S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] voucher manipulation
Alo, I have a client looking to do the following; There is a standard "voucher" design, in the format of JPG ... now ... they wish to create a voucher system where if you reach so many points etc you can claim a voucher (using the design) with a expiry date ... current + 30days and a unique voucher number. Now, I have looked at ImageCreateFromjpeg etc ... but ... cant figure out how to place the text on it within the specified areas. It will then be emailed to the user. Does anyone know of an idea out there already I can take a look at ... or some advice? Kind regards, Steven Macintyre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP4 and PHP5
"This tutorial shows how to install and configure Apache2 with PHP5 and PHP4 enabled at the same time. Because it is not possible to run both PHP5 and PHP4 as Apache modules, we must run one of them as CGI, the other one as Apache module." http://www.howtoforge.com/apache2_with_php5_and_php4 Thats via a google search ... never done it myself! S > -Original Message- > From: Martin Marques [mailto:[EMAIL PROTECTED] > Sent: 26 February 2007 03:50 PM > To: php-general@lists.php.net > Subject: [PHP] PHP4 and PHP5 > > Is it posible to run apache with PHP4 and PHP5 on different virtual > domains? > > -- > 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, > 0.18 > - > Lic. Martín Marqués | SELECT 'mmarques' || > Centro de Telemática| '@' || 'unl.edu.ar'; > Universidad Nacional| DBA, Programador, > del Litoral | Administrador > - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] NOT NULL query
SELECT * FROM table WHERE field_3 IS NOT NULL > -Original Message- > From: Ron Piggott [mailto:[EMAIL PROTECTED] > Sent: 26 February 2007 02:56 PM > To: PHP DB > Subject: [PHP-DB] NOT NULL query > > Is it possible to do a SELECT query where field_3 isn't null? What > would the syntax look like? Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array issues
Hi all, I am working on a project for someone and with the brief I received before - I created a record per action with the following information; Artist[tab]artist[tab]artist[tab] etc as a entry for "artists" Then I have the same for titles etc ... What I have been doing is creating the array's and combining them ... with artist as a key and song as a value... Now ... they are requesting that I have the an additional 3 fields ... how would I now accomplish this? Bear in mind its php 4 and I am using a combine_array generic from the www.php.net site in lieu of array_combine. I have paste a sample record below; INSERT INTO ` votes_records` (`id`, `date`, `who`, `title`, `description`, `image`, `email`, `artists`, `titles`, `votes`, `weeks`, `twoweekpos`, `oneweekpos`, `debut`) VALUES (22, '2007-02-26 12:29:15', 1, 'Test Again', '', '', '', 'Artist 1Artist 2', 'Song 1Song 2', '1', '51', '20', '10', '2005/02/092005/02/09'); The net effect that I need to get - is take that information and display it per item so people can vote. S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array within array
Hi all, I have an array ($articles) that contains content in this format Text More text I am currently calling the creation of the array as such; $articles = split("Section break", $mystring); <-- this works NOW ... I need to split each item in the articles array into its own array (newsarray) I have tried Foreach ($articles as $value) { $newsarray = split("http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file_get_contents
Hiya, I need to be able to read a file into a string - I have used the above command and it works ... now ... I need to read a file into a string - that requires a username and password to access the authentication is normal HTTP basic realm Any ideas? Kind Regards Steven Macintyre -- www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] readfile()
HI all I'm currently using this function to read a remove address to create a mailbox ... However - It ALWAYS displays the output of that file to the user screen ... all I wish to do is something like ... $status = Readfile(warra warra warra); If ($status === "MailBox Created") { Do more stuff } else { Tell user that there was a problem } How is this done ... At current - the "MailBox Created" and error message if there is always displays raw on the screen as if its outputting that buffer Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] convert w date to l format
Um ... can anyone point me to somewhere that it explains this ... I am trying to convert a "int" (1 through 7) to a day name (Monday through Friday) while in a loop with mysql results I have tried $day = date('w', $day); But this does not seem to work ... can anyone assist? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Some advice / points / help
Hi guys, Some intelligent minds needed again ... I have the following "schematic" to work to ... http//steven.macintyre.name/arb/showlineups.jpg I need to "fill" that with data from a mysql table ... The format of the table is as follows; CREATE TABLE `kayasite_schedule` ( `id` int(11) NOT NULL auto_increment, `tid` int(6) NOT NULL, `showname` mediumtext NOT NULL, `day` varchar(10) NOT NULL, `blurb` longtext NOT NULL, `show_start` time NOT NULL default '00:00:00', `show_end` time NOT NULL default '00:00:00', `who` varchar(25) NOT NULL default '', `uid` int(6) NOT NULL, `pic` varchar(60) NOT NULL default '', UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM Now, as you can see the time slot are the items "show_start", "show_end" (which I can do) the names are from the table (who) - can anyone start me off on the correct route to get this done. The layout does not have to be exactly like that - but - the days across top have to - so if there are gaps in "time slots" etc we can handle that This is way beyond my level of knowledge and have NO idea where to start. As always - your assistance appreciated!! Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Formatting time :/
Thanks Stut, Perfect! Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za > -Original Message- > From: Stut [mailto:[EMAIL PROTECTED] > Sent: 02 January 2007 02:59 PM > To: Steven Macintyre > Cc: php-general@lists.php.net > Subject: Re: [PHP] Formatting time :/ > > Steven Macintyre wrote: > > I am unable to find out how to do this ... or what the format is > "called" > > bar zulu format > > > > I have standard 00:00:00 time stored ... and wish to display it > as 00h00 ... > > has anyone done this with php ... can you point me to right page > etc ... > > > > What is that format called? > > http://php.net/date > > $time = date('H\hi', strtotime('00:00:00')); > > Or, if the input format is always the same, you could do it like > so... > > $time = str_replace(':', 'h', substr('00:00:00', 0, 5)); > > -Stut > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me
> When I send a mail using php using mail(), and using html tags in > message > body , these tags are being displayed as it is. > Please let me know if there's any way of how to tackle with this. I use phpmailer for all my email sending ... Never had a problem with it S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Formatting time :/
Hi all, I am unable to find out how to do this ... or what the format is "called" bar zulu format I have standard 00:00:00 time stored ... and wish to display it as 00h00 ... has anyone done this with php ... can you point me to right page etc ... What is that format called? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
> imagecopyresampled might help you... I use that and it works > without > problems. > Hi Peter, " I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc" I have tried your suggestion with the same results ... that is what I was using first :( S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD 2.0.28 + PHP 4.4.2 + pixelation :(
Hi All, I have done some searching via google and some answers say change copyimageresampled to copyimageresized etc I have tried all fixes ... to no avail I have one image here 1280 x 960 (150 dpi) 24 depth When using the following it pixelates ... function createthumb($name,$filename,$new_w,$new_h) { $system=explode(".",$name); $src_img=imagecreatefromjpeg($name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x > $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x < $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } Which I am of course calling with createthumb($add,'../pics/'.$largeval,350,263); Now ... afaik my new sizes are proportional to the big ones ... but it pixelates :( However, Using an image 1600 x 1200 (96 dpi) 24 depth it works and there is no pixilation Can someone perhaps assist now? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] random selection from each subfolder
Ok ... previous problem sorted ... now onto the next ... The client wants the following; A scroll bar with 3 random thumbs from each subdirectory in the /images/ folder I was thinking ... Going into each folder, getting files, pushing into an array - shuffling array, taking first three items and combine it to a "master" array and use that ... Good thinking? Better suggestions? Kind Regards, Steven Macintyre http://steven.macintyre.name -- http://www.friends4friends.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] um ... arrays
Hi ... I have the following; $files = array(); $curimage=0; if($handle = opendir($dirname)) { while(false !== ($file = readdir($handle))){ if(eregi($pattern, $file)){ $filedate=date ("M d, Y H:i:s", filemtime($file)); if(substr($file,-5)=='t.jpg') { echo 'leftrightslide[' . $curimage .']=\'\';' . "\n"; } $curimage++; } } closedir($handle); } shuffle($files); return($files); now ... why does files not get shuffled? Is that not the purpose of that function ? Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is the GD library and what can I do with it ?
Pete wrote: Hi, What is the GD library ? How can I install it. I have PHP integrated as a module. Judging by the discussion that people have here the GD library sounds interesting. How do I know if my shared host has it ? Thank you. phpinfo(); ?> Then see ... -- Regards, Steven Mac Intyre (Salk) Junglebean.net - web site creation and hosting zaphp.net - South African PHP communitee steven.macintyre.name - personal site Cell: +27 83 326 7119 Email: [EMAIL PROTECTED] Important note: This email is linked to a disclaimer, please email [EMAIL PROTECTED] to obtain a copy. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php