php-general Digest 29 Aug 2003 08:52:40 -0000 Issue 2265 Topics (messages 161078 through 161124):
Some cookies are being set, some aren't 161078 by: Thaddeus J. Quintin post v get 161079 by: andu 161082 by: Jim Lucas 161088 by: John W. Holmes 161097 by: David Otton 161102 by: andu Re: can pdf forms be used to submit data into db? 161080 by: Roedel, Mark Re: jpeg libraries. 161081 by: Curt Zirzow 161091 by: Tom Rogers Re: PHP Interview questions 161083 by: Matt Matijevich 161103 by: murugesan Array Push and Keys 161084 by: Mike Morton 161099 by: David Otton selecting based on a month in a date 161085 by: Creative Solutions New Media 161087 by: John W. Holmes Re: reboot pc with PHP 161086 by: David T-G Re: LWP::Parallel in PHP 161089 by: Evan Nemerson 161090 by: Robert Cummings 161094 by: David Otton 161095 by: jabber.raditha.com 161106 by: Evan Nemerson Creating files in public_html 161092 by: Lowell Allen Re: WYSIWYG online editor for Macintosh? 161093 by: Step Schwarz 161116 by: Adrian Teasdale Re: Loading advise (no problem) 161096 by: Bogdan Stancescu Re: Urgent help required for using Cron 161098 by: Safal Solutions 161119 by: Javier Tacon How to? 161100 by: Jay Fitzgerald 161101 by: John W. Holmes undefined variable 161104 by: merryE 161105 by: Chris Kay Beta 2 of plPHP is out 161107 by: Joshua D. Drake converting date into database date format(newbie) 161108 by: Anil Garg 161114 by: Binay Agarwal server/browser dependancies? 161109 by: VB 161115 by: Binay Agarwal Re: building php witk libiconv 161110 by: Alain Bonnefoy 161123 by: Tom Rogers problem with a mysql query with data from a form 161111 by: Vincent Fievet 161117 by: Binay Agarwal Crystal Reports and PHP 161112 by: daniel.electroteque.org Absolute URLs with Require & Include 161113 by: Seth Willits Re: GD & PHP 161118 by: Kae Verens register globals question 161120 by: Merlin 161121 by: Kae Verens Foring a file download *and* page reload 161122 by: Jean-Christian IMbeault PDF Problem 161124 by: Jack Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message --- I've got a problem with cookies failing.
Here's the setup- A staging server, RedHat Linux, with php 4.3 Main server, FreeBSD, also php 4.3
Running identical Apache setups and Identical php setups.
The staging server is only accessible behind our local firewall and does not run https. The Main server runs https and users are transferred to https while logging in.
For almost all users, the authentication works just fine. Two variables are set as cookie values and checked out, so it works great. However we've had report of some users not being able to log in. I haven't tracked down the problem, but the behaviour they're describing describes the cookies not being set.
I was able to reproduce this behavior on a version of the Konqueror web browser. It could log into our staging server, but not our main server. I thought, "maybe it's a problem with the secure login," so I made a non-secure login. Still didn't work. I created a separate cookie value, only for checking if cookies were being set properly. It was set and transferred without any problems, but the other two values were non existant when I checked out the cookie management list.
The user i heard from was running IE6, which works in every situation I could check, He opened up all of his security settings to allow everything, and it still didn't work.
What kind of things should I be checking out? I'm at a loss for what else to try at this point.
Thanks- Thaddeus Quintin
--- End Message ---
--- Begin Message ---When you POST a form to the server the server replies with a new page. if you click the Back button in the browser the server wants to re-POST the form. Short of using GET is there a way to prevent re-submitting the previous form? -- Regards, Andu Novac
--- End Message ---
--- Begin Message ---no Jim Lucas ----- Original Message ----- From: "andu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 28, 2003 1:49 PM Subject: [PHP] post v get > When you POST a form to the server the server replies with a new > page. if you click the Back button in the browser the server wants to > re-POST the form. Short of using GET is there a way to prevent > re-submitting the previous form? > > -- > Regards, Andu Novac > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
--- End Message ---
--- Begin Message --- andu wrote:
When you POST a form to the server the server replies with a new page. if you click the Back button in the browser the server wants to re-POST the form. Short of using GET is there a way to prevent re-submitting the previous form?
Of course. :)
One technique is to use a "middle-man" page that processes your POST data and inserts it into the database or file or whatever. Then you use header() to send the user to another page.
So the page that was "posted" to is never really seen by the user and the back button just goes back directly to the form. You can also go back to the redirected page without the browser asking to "re-post" the data...
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---On Thu, 28 Aug 2003 18:50:55 -0400, you wrote: >> When you POST a form to the server the server replies with a new >> page. if you click the Back button in the browser the server wants to >> re-POST the form. Short of using GET is there a way to prevent >> re-submitting the previous form? >One technique is to use a "middle-man" page that processes your POST >data and inserts it into the database or file or whatever. Then you use >header() to send the user to another page. Here's a quick fragment to illustrate the technique. It requires a file called "list.txt" to exist. <? if (isset ($item)) { $fp = fopen("list.txt", "a"); fputs ($fp, "<tr><td>$item</td></tr>\r\n"); header ("Location: $PHP_SELF"); exit(); } ?> <table border="1" cellspacing="2"> <? readfile("list.txt"); ?> </table> <br><br> <form method="post" action="<? echo ($PHP_SELF); ?>"> <p>Add Item: <input type="text" name="item"></p> <p><input type="submit" name="Add" value="Add"></p> </form>
--- End Message ---
--- Begin Message ---On Fri, 29 Aug 2003 02:06:55 +0100 David Otton <[EMAIL PROTECTED]> wrote: > On Thu, 28 Aug 2003 18:50:55 -0400, you wrote: > > >> When you POST a form to the server the server replies with a new > >> page. if you click the Back button in the browser the server wants > >to> re-POST the form. Short of using GET is there a way to prevent > >> re-submitting the previous form? > > >One technique is to use a "middle-man" page that processes your POST > >data and inserts it into the database or file or whatever. Then you > >use header() to send the user to another page. > > Here's a quick fragment to illustrate the technique. It requires a > file called "list.txt" to exist. > > <? > if (isset ($item)) { > $fp = fopen("list.txt", "a"); > fputs ($fp, "<tr><td>$item</td></tr>\r\n"); > header ("Location: $PHP_SELF"); > exit(); > } > ?> > <table border="1" cellspacing="2"> > <? > readfile("list.txt"); > ?> > </table> > <br><br> > <form method="post" action="<? echo ($PHP_SELF); ?>"> > <p>Add Item: <input type="text" name="item"></p> > <p><input type="submit" name="Add" value="Add"></p> > </form> > Thanks David. -- Regards, Andu Novac
--- End Message ---
--- Begin Message ---Guess I'm a little late to this party, but... If you're still looking for help with tying a PDF form to a database, drop me a note. I've got some code I developed for our online admissions application that I can probably be talked into sharing. -- Mark Roedel Web Programmer / Analyst LeTourneau University Longview, Texas USA -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 7:52 PM To: [EMAIL PROTECTED] Subject: [PHP] can pdf forms be used to submit data into db? hi guys and gals, aloha from hawaii, Not sure if this is the right place to ask, but i just need to know if it is technically possible to have a pdf form be filled out online and then once the user hits submit, php takes the data and puts it into a db or some sort of db technology and if the need arises to pull up that record once more, php fetches the data from the db and dynamically fills out the pdf form and presents it to the end user...can do? or anyone know who i can talk to about this... thanks and mahalo from hawaii <incentive> if anyone can help me or point me in the right direction, i MAY be inclined to send some macadamia nuts to the continental US </incentive> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---* Thus wrote Mike At Spy ([EMAIL PROTECTED]): > > It did install some jpeg stuff under /usr/local/bin, but I don't see > anything added to /usr/local/lib. > > After that, I re-compiled php with: > > --with-jpeg > > But nothing changed. > > I re-compiled again with: > > --with-jpeg=/usr/local/bin try --with-jpeg=/usr/local Curt -- "I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---Hi, Friday, August 29, 2003, 6:39:16 AM, you wrote: MAS> I got the jpeg libraries from: MAS> http://freshmeat.net/projects/libjpeg/?topic_id=105%2C809 MAS> And installed them; even did a make test to make sure everything was MAS> correct. MAS> It did install some jpeg stuff under /usr/local/bin, but I don't see MAS> anything added to /usr/local/lib. MAS> After that, I re-compiled php with: MAS> --with-jpeg MAS> But nothing changed. MAS> I re-compiled again with: MAS> --with-jpeg=/usr/local/bin MAS> And nothing changed. MAS> Anyone have any ideas as to what is going on? Or a suggestion as to what to MAS> look for? MAS> Thanks, MAS> -Mike You may also need to recompile gd -- regards, Tom
--- End Message ---
--- Begin Message ---<snip> Can you do it programmitically (with pseudo-code)? After all, we need to keep this on-topic :) </sip> not pseudo code and it could definatley be cleaned up or done better but her is my quick try at it echo "We are walking to up to a fork in the road.<br />"; $randval = rand(1, 500); $randval2 = rand(1, 500); $randval3 = rand(1, 500); if ( $randval&1 ) { $man1 = "truth"; $man2 = "lie"; } else { $man1 = "lie"; $man2 = "truth"; } if ( $randval3&1 ) { $road1 = "Utpoia"; $road2 = "Black Forest"; } else { $road1 = "Black Forest"; $road2 = "Utpoia"; } if ( $randval2&1 ) $manToAsk = "Man 1"; else $manToAsk = "Man 2"; if ($manToAsk == "Man 1") { echo "We are asking Man 1<br />Man 1, where would Man 2 point if I asked him to point to the road to Utopia?<br />"; if (man1() == "Road 1") { echo "Man 1 pointed to Road 1<br />"; $roadToTake = "Road 2"; } else { echo "Man 1 pointed to Road 2<br />"; $roadToTake = "Road 1"; } } else { echo "We are asking Man 2<br />Man 2, where would Man 1 point if I asked him to point to the road to Utopia?<br />"; if (man2() == "Road 1") { echo "Man 2 pointed to Road 1<br />"; $roadToTake = "Road 2"; } else { echo "Man 2 pointed to Road 2<br />"; $roadToTake = "Road 1"; } } echo "We are taking $roadToTake<br />Road 1 goes to $road1<br />Road 2 goes to $road2<br />Man 1 = $man1<br />Man 2 = $man2"; //echo "We took $roadToTake<br />We asked $manToAsk<br />Man 1 = $man1<br />Man 2 = $man2<br />Road 1 goes to $road1<br />Road 2 goes to $road2"; function man1() { global $man1,$man2,$road1,$road2; if ($man1 != "truth") { if ( $road1 == 'Black Forest' ) return 'Road 1'; else return 'Road 2'; } else { if ( $road1 == 'Black Forest' ) return 'Road 1'; else return 'Road 2'; } } function man2(){ global $man1,$man2,$road1,$road2; if ($man2 != "truth") { if ( $road1 == 'Black Forest' ) return 'Road 1'; else return 'Road 2'; } else { if ( $road1 == 'Black Forest' ) return 'Road 1'; else return 'Road 2'; } }
--- End Message ---
--- Begin Message ---In a group of 12 eggs only one is having weight less or more. Can we have a program to find the egg, provided we have to weigh only three times with a weighing machine with two pans,without using weights. -murugesan ----- Original Message ----- From: "Matt Matijevich" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 29, 2003 2:55 AM Subject: RE: [PHP] PHP Interview questions > <snip> > Can you do it programmitically (with pseudo-code)? After all, we need > to > keep this on-topic :) > </sip> > > > not pseudo code and it could definatley be cleaned up or done better > but her is my quick try at it > > echo "We are walking to up to a fork in the road.<br />"; > $randval = rand(1, 500); > $randval2 = rand(1, 500); > $randval3 = rand(1, 500); > > > if ( $randval&1 ) > { > $man1 = "truth"; > $man2 = "lie"; > > } > else > { > $man1 = "lie"; > $man2 = "truth"; > } > > > if ( $randval3&1 ) > { > $road1 = "Utpoia"; > $road2 = "Black Forest"; > > } > else > { > $road1 = "Black Forest"; > $road2 = "Utpoia"; > } > > if ( $randval2&1 ) $manToAsk = "Man 1"; > else $manToAsk = "Man 2"; > > > > if ($manToAsk == "Man 1") { > echo "We are asking Man 1<br />Man 1, where would Man 2 point if > I asked him to point to the road to Utopia?<br />"; > if (man1() == "Road 1") { > echo "Man 1 pointed to Road 1<br />"; > $roadToTake = "Road 2"; > } > else { > echo "Man 1 pointed to Road 2<br />"; > $roadToTake = "Road 1"; > } > } > else { > echo "We are asking Man 2<br />Man 2, where would Man 1 point if > I asked him to point to the road to Utopia?<br />"; > if (man2() == "Road 1") { > echo "Man 2 pointed to Road 1<br />"; > $roadToTake = "Road 2"; > } > else { > echo "Man 2 pointed to Road 2<br />"; > $roadToTake = "Road 1"; > } > } > > > echo "We are taking $roadToTake<br />Road 1 goes to $road1<br />Road 2 > goes to $road2<br />Man 1 = $man1<br />Man 2 = $man2"; > //echo "We took $roadToTake<br />We asked $manToAsk<br />Man 1 = > $man1<br />Man 2 = $man2<br />Road 1 goes to $road1<br />Road 2 goes to > $road2"; > > function man1() { > global $man1,$man2,$road1,$road2; > if ($man1 != "truth") { > if ( $road1 == 'Black Forest' ) return 'Road 1'; > else return 'Road 2'; > } > else { > if ( $road1 == 'Black Forest' ) return 'Road 1'; > else return 'Road 2'; > } > } > > function man2(){ > global $man1,$man2,$road1,$road2; > if ($man2 != "truth") { > if ( $road1 == 'Black Forest' ) return 'Road 1'; > else return 'Road 2'; > } > else { > if ( $road1 == 'Black Forest' ) return 'Road 1'; > else return 'Road 2'; > } > } > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- End Message ---
--- Begin Message ---I am trying to loop through some database results to build an array similar to: Array ( [33]=>Array ( [usa]=>52.00 [sa]=>553.00 ) ) And the problem that I am having is that array_push does not want to take keys when I am using it. My Code: $transactions=Array(); While($row=mysql_fetch_array($res) { array_push($transactions,$row[dealercode]=>Array()); $another_query=mysql_query("do another query here"); while($morerows=mysql_fetch_array($another_query)) { array_push($transactions[$row[dealercode],$morerows[country]=>$morerows[amou nt]; } } That *should* create the array above, but as I mentioned array_push does not seem to be taking the keys.... I just get a Parse error message for the line. (the first array_push) Is this is 'bug' (I hate to assume just because I cannot get it to work that it is a bug ;) ) or am I trying to do something that is better accomplished with another function? TIA. -- Cheers Mike Morton **************************************************** * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * **************************************************** "Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple." - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey
--- End Message ---
--- Begin Message ---On Thu, 28 Aug 2003 18:14:39 -0400, you wrote: >While($row=mysql_fetch_array($res) { >That *should* create the array above, but as I mentioned array_push does not >seem to be taking the keys.... I just get a Parse error message for the >line. (the first array_push) Ahem. Count the brackets? :) (On a style point, your code would be easier to read for bugs like this if you added some whitespace.)
--- End Message ---
--- Begin Message ---Hi, Asked this on the mySQL list but it seems to be more of a PHP syntax thing that a mySQL thing. In have the following line in PHP <?php $today = getdate();?> I have a mySQL table which contains dates formatted as dates(xxxx-xx-xx) I want to select all records based on a specific month. This is my select statement SELECT * FROM sti_tracking WHERE `date` = MONTHNAME('$today') = 'August' Cased in php it looks like so... <?php mysql_select_db($database_sti_tracking_DB, $sti_tracking_DB); $query_totalHitsMonth_RS_RS = "SELECT * FROM sti_tracking WHERE `date` = MONTHNAME('$today') = 'August'"; $totalHitsMonth_RS_RS = mysql_query($query_totalHitsMonth_RS_RS, $sti_tracking_DB) or die(mysql_error()); $row_totalHitsMonth_RS_RS = mysql_fetch_assoc($totalHitsMonth_RS_RS); $totalRows_totalHitsMonth_RS_RS = mysql_num_rows($totalHitsMonth_RS_RS); ?> but this isn't working....it's returning no records which is wrong. Anyone see a problem? Thx Tim Winters Manager, Creative Development Sampling Technologies Incorporated (STI) [EMAIL PROTECTED] [EMAIL PROTECTED] W: 902 450 5500 C: 902 430 8498
--- End Message ---
--- Begin Message --- Creative Solutions New Media wrote:Hi,
Asked this on the mySQL list but it seems to be more of a PHP syntax thing that a mySQL thing.
In have the following line in PHP
<?php $today = getdate();?>
I have a mySQL table which contains dates formatted as dates(xxxx-xx-xx)
I want to select all records based on a specific month.
This is my select statement
SELECT * FROM sti_tracking WHERE `date` = MONTHNAME('$today') = 'August'
Cased in php it looks like so...
<?php mysql_select_db($database_sti_tracking_DB, $sti_tracking_DB); $query_totalHitsMonth_RS_RS = "SELECT * FROM sti_tracking WHERE `date` = MONTHNAME('$today') = 'August'"; $totalHitsMonth_RS_RS = mysql_query($query_totalHitsMonth_RS_RS, $sti_tracking_DB) or die(mysql_error()); $row_totalHitsMonth_RS_RS = mysql_fetch_assoc($totalHitsMonth_RS_RS); $totalRows_totalHitsMonth_RS_RS = mysql_num_rows($totalHitsMonth_RS_RS); ?>
but this isn't working....it's returning no records which is wrong.
It's returning the correct results for your query. I'm surprised it's even running. getdate() returns an array, btw, so you're looking for ros that match this:
`date` = MONTHNAME('Array') = 'August'
You don't even need to call getdate(), just put
WHERE MONTHNAME(date) = 'August'
in your query.
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---Petre, et al -- ...and then Petre Agenbag said... % % Hi List Hi! % % I've gone through the list for previous questions and the only one that % seems to be a solution is to use sudo, however, I cannot seem to get it % right. ... % % Obviously these command(s) need to be run as root, so I looked at the % /etc/sudoers and added apache , BUT, in the error log it prompts for a % password. 1) Are you sure your web server is running as apache? If not, run something like passthru("/usr/bin/id") ; (or wherever your id program is) in a php page (easier than redirecting to a file :-) and see what it tells you. % % I tried to add the option NOPASSWD: ALL to the file, but it says there's % a syntax error. Your line should look about like admind ALL = (ALL) NOPASSWD: /path/to/reboot where "admind" is the name under which your web server runs. In fact, it should probably look more like admind hostname = (root) NOPASSWD: /path/to/reboot to allow admind to run reboot as root on machine "hostname". Have you read the man page for sudoers? Yes, it's a bit thick, but it absolutely covers everything you need to know :-) % % What am I missing? Since you haven't shown us your attempt, it's tough to answer that other than to note that you're at least missing showing what you tried! % % Any other ways of doing this? PS, I don't even want to consider Webmin, % it's way too complicated, I just want a handfull of predefined commands % to be run, nothing else) sudo is *definitely* your best approach. It really is. It's easy, too, I promise. % % Thanks HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgp00000.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---php.net/pcntl_fork On Thursday 28 August 2003 11:09 am, David Otton wrote: > On Thu, 28 Aug 2003 20:25:05 +0300, you wrote: > >I am looking for PHP analog of Perl LWP::Parallel. > >I need to fetch several URL(pages) from PHP at the same time. > >I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec. > >Totally it's about 10 seconds in average. > >I suppose if I fetched them parallel I would speed up the script 5 times. > >I am looking mostly for PHP solutions. > >(Hope they exist :) > > Think you're out of luck. Yes, it's a problem I've run up against more than > once. There's no thread support in PHP [4. Anyone know if it's in 5?]. > > I suppose you might be able to hack something together by spawning external > processes, but... might as well just do it all externally then. -- "The missionaries go forth to Christianize the savages- as if the savages weren't dangerous enough already." -Edward Abbey
--- End Message ---
--- Begin Message ---This isn't the best solution but it might help bring down the total time. Can you set up a shell script to retrieve the content from a URL (in PHP if you wish) and then from your web app spawn 5 processes, with destination temporary files for the data which you can then poll for completion (microsleep here and there :)? Cheers, Rob. On Thu, 2003-08-28 at 18:49, Evan Nemerson wrote: > php.net/pcntl_fork > > > > On Thursday 28 August 2003 11:09 am, David Otton wrote: > > On Thu, 28 Aug 2003 20:25:05 +0300, you wrote: > > >I am looking for PHP analog of Perl LWP::Parallel. > > >I need to fetch several URL(pages) from PHP at the same time. > > >I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec. > > >Totally it's about 10 seconds in average. > > >I suppose if I fetched them parallel I would speed up the script 5 times. > > >I am looking mostly for PHP solutions. > > >(Hope they exist :) > > > > Think you're out of luck. Yes, it's a problem I've run up against more than > > once. There's no thread support in PHP [4. Anyone know if it's in 5?]. > > > > I suppose you might be able to hack something together by spawning external > > processes, but... might as well just do it all externally then. > > -- > "The missionaries go forth to Christianize the savages- as if the savages > weren't dangerous enough already." > > -Edward Abbey > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------'
--- End Message ---
--- Begin Message ---On Thu, 28 Aug 2003 15:49:15 -0700, you wrote: >> Think you're out of luck. Yes, it's a problem I've run up against more than >> once. There's no thread support in PHP [4. Anyone know if it's in 5?]. >php.net/pcntl_fork Interesting - that's new. Unix-only and not in the default install. Not avaialble when PHP is installed as a mod, either, if I read the manual right. Which explains why it isn't in common use... Getting the data back from the child process is gonna be pretty messy (temp files I guess), but... hmm. Still, may be the best solution in some circumstances. For the sake of completeness, I did some searching this time and there appears to be experimental thread support in PECL.
--- End Message ---
--- Begin Message --- hi,
David is right, you will not find an equivalent. My advise is to mix PHP and perl. You can get a perl script to handle the URL retrieval stuff and pass handlign back to php when you are done. It's this approach that i took when creating the mega upload progress bar for php.
all the best
David Otton wrote:
On Thu, 28 Aug 2003 20:25:05 +0300, you wrote:
I am looking for PHP analog of Perl LWP::Parallel.
I need to fetch several URL(pages) from PHP at the same time.
I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec.
Totally it's about 10 seconds in average.
I suppose if I fetched them parallel I would speed up the script 5 times.
I am looking mostly for PHP solutions.
(Hope they exist :)
Think you're out of luck. Yes, it's a problem I've run up against more than once. There's no thread support in PHP [4. Anyone know if it's in 5?].
I suppose you might be able to hack something together by spawning external processes, but... might as well just do it all externally then.
-- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads.
--- End Message ---
--- Begin Message ---Just fork the web application. That would probably be a much better solution... On Thursday 28 August 2003 04:13 pm, Robert Cummings wrote: > This isn't the best solution but it might help bring down the total > time. Can you set up a shell script to retrieve the content from a URL > (in PHP if you wish) and then from your web app spawn 5 processes, with > destination temporary files for the data which you can then poll for > completion (microsleep here and there :)? > > Cheers, > Rob. > > On Thu, 2003-08-28 at 18:49, Evan Nemerson wrote: > > php.net/pcntl_fork > > > > On Thursday 28 August 2003 11:09 am, David Otton wrote: > > > On Thu, 28 Aug 2003 20:25:05 +0300, you wrote: > > > >I am looking for PHP analog of Perl LWP::Parallel. > > > >I need to fetch several URL(pages) from PHP at the same time. > > > >I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec. > > > >Totally it's about 10 seconds in average. > > > >I suppose if I fetched them parallel I would speed up the script 5 > > > > times. I am looking mostly for PHP solutions. > > > >(Hope they exist :) > > > > > > Think you're out of luck. Yes, it's a problem I've run up against more > > > than once. There's no thread support in PHP [4. Anyone know if it's in > > > 5?]. > > > > > > I suppose you might be able to hack something together by spawning > > > external processes, but... might as well just do it all externally > > > then. > > > > -- > > "The missionaries go forth to Christianize the savages- as if the savages > > weren't dangerous enough already." > > > > -Edward Abbey > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---My commercial host is changing policy so that PHP can't create files in public_html. This screws up my content management system, which generates static HTML pages which are hit a lot. Is this policy common? Is it a security risk for PHP to be able to create files in the main directory? (I have no problem creating files in subdirectories.) I've spent a couple days rewriting to use a PHP script called as a CGI to do the updates, and now they're telling me that that won't work when called from the CMS -- I've got to call it from a crontab, which I don't think will be acceptable. This is my third post concerning this (rephrased and refocused each time). Does anyone else need to create and update files in their main directories? Is this a security problem? Do I need to completely rewrite the CMS to use a subdirectory? -- Lowell Allen
--- End Message ---
--- Begin Message ---> Hi there. Slightly OT, but it's for a PHP project... We normally use a > plug-in WYSIWYG editor so that our clients can manage their content in a > word-like interface. Normally this works fine, but this time when we've > completed the site we've discovered they have an entire department that > is 100% Macintosh and this editor doesn't work. Has anyone come across > one of these that are cross-platform? Would really appreciate some > advice Hi Ade, I did some research on this a while back, though we decided not to pursue the project before we finally settled on one. What you want to do is look for one written in either Java or Flash -- if you search around Google you should be able to find some results. Here's a link you might find useful: http://www.bris.ac.uk/is/projects/cms/ttw/ttw.html Good luck and please let me know if you find a good one. -Step
--- End Message ---
--- Begin Message ---Step (and everyone else who has replied directly) thanks for the links. I'll do some research and will post my results. The client is using OS9 and OSX so I need to find something that works with both. It's looking like Java at this moment in time. Thanks again Ade > -----Original Message----- > From: Step Schwarz [mailto:[EMAIL PROTECTED] > Sent: 29 August 2003 01:42 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] WYSIWYG online editor for Macintosh? > > > > Hi there. Slightly OT, but it's for a PHP project... We > normally use > > a plug-in WYSIWYG editor so that our clients can manage > their content > > in a word-like interface. Normally this works fine, but this time > > when we've completed the site we've discovered they have an entire > > department that is 100% Macintosh and this editor doesn't > work. Has > > anyone come across one of these that are cross-platform? > Would really > > appreciate some advice > > Hi Ade, > > I did some research on this a while back, though we decided > not to pursue the project before we finally settled on one. > What you want to do is look for one written in either Java or > Flash -- if you search around Google you should be able to > find some results. > > Here's a link you might find useful: > http://www.bris.ac.uk/is/projects/cms/ttw/ttw.> html > > Good luck > and please let me know if you find a good one. > > -Step > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > >
--- End Message ---
--- Begin Message --- Hi Ryan,
Looks good from here, you should try a traceroute to that host, I think that's actually your problem... Or are you on a local network with that machine? Try the traceroute nevertheless, who knows how your hub is acting up... :)
Bogdan
Ryan A wrote:Hi, No problem, Just need a little advise on improving my page display time, let me explain:
I am using some ad software (written in php) which is giving me 5 ads (banners) to display on a page dynamically (eg: they rotate, banner code is given at the end of this mail) I have put all 5 banners on a page my themselfes, renamed the file to TestingAds.php and used a microtime function to see whats the script execution time like so:
<?php function mtime() { $time = explode(" ", microtime()); $micro = doubleval($time[0]); $sec = doubleval($time[1]); return $micro + $sec; } $start = mtime(); ?> html and banner code here <?php $end = mtime(); $total = $end - $start; echo "Total script execution time: $total"; ?>
I ran TestingAds.php 10 times and these are the numbers, you dont have to take an averige to see they are pretty good: 0.00024902820587158 0.00027501583099365 0.00025904178619385 0.00027906894683838 0.00043702125549316 0.00036203861236572 0.00045394897460938 0.00024497509002686 0.00025498867034912 0.00025796890258789
then i took those ads and placed them exactly where they have to go on my index.php page, then reloaded the page 10 times and got these numbers: 0.00018906593322754 0.00066602230072021 0.00055098533630371 0.00054502487182617 0.00054800510406494 0.00055789947509766 0.00054597854614258 0.00056195259094238 0.00056302547454834 0.00049996376037598
The numbers look pretty good (i think), but when i actually visit the page it takes a bit long to load...even though I am on a pretty fast connection, any idea why this is the case? my page takes around 20 seconds to load and there is a white screen till everything is loaded then BLAM its all done. What can i do so that my page loads faster or atleast shows the page to the visitor and then loads one ad after another so the visitor can see the page loading instead of just a white screen?
This is the banner code: <SCRIPT LANGUAGE="JavaScript" SRC="http://jumac.com/ads/ads.php?jscript;zone=tower"></SCRIPT><NOSCRIPT><IF RAME SRC="http://jumac.com/ads/ads.php?iframe;zone=tower" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=NO WIDTH=121 HEIGHT=601><A HREF="http://jumac.com/ads/ads.php?banner=NonSSI;page=01;zone=tower" TARGET="_blank"><IMG SRC="http://jumac.com/ads/ads.php?page=01;zone=tower" BORDER=0></A></IFRAME></NOSCRIPT>
here is the TestingAds page: http://bestwebhosters.com/TestingAds.php
I have not included the main page that i have already setup the ads because right now its still be touched up and nothing on the page works but if you still want to see it just write to me and tell me.
Thanks for your time. Cheers, -Ryan
--- End Message ---
--- Begin Message ---Dear Javier, We have done the following as per your suggestion 15 17 * * * /path/to/your/php/binary /path/to/your/script.php After editing and saving crontab file the following message pops up at the commond prompt - crontab:installing new crontab crontab:error renaming cron/tmp.1885 to cron/root rename: is a directory crontab: edit left in /tmp/crontab.1885 It did not work. Please suggest what to do next? Regards Siva -----Original Message----- From: Javier Tacon [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 5:17 PM To: Safal Solutions Subject: RE: [PHP] Urgent help required for using Cron For example, you want execute a script every day at 09:00 am: $ crontab -e And put this line: 0 9 * * * /path/to/your/php/binary /path/to/your/script.php Crontab only can say if the cron was executed correctly or not, but it doesn't say if your script in php has sent the mail correctly or not. For debug if the mail was successfully sent, develope the debug into your script. You can use a some mail classes that they have debug options (for example I use phpmailer v1.65). -----Mensaje original----- De: Safal Solutions [mailto:[EMAIL PROTECTED] Enviado el: jueves, 28 de agosto de 2003 13:32 Para: PHP General Asunto: [PHP] Urgent help required for using Cron Hi friends, I have to send mail to people automatically at specified time . Our environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a program in php to send the mail if some Condition is met. I want to activate this program at specified time using cron facility. So, How can we do that? Can any one help me?. I have another problem also. We want Cron to indicate ( through a message or a mail) to us that a given task is completed or not. In the present case Cron does a task of sending a mail to a user. After sending the mail we want Cron to indicate to us that the mail was successfully sent or not sent. This we want to know through a program because we want to use this as a part of automation of sending mails. Thanking you, Siva -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---It seems problems with permissions. Can you pass me the output from "ls -la /var/spool/cron/" May be exists a directory called root inside /var/spool/cron, so, if exists, you should delete it and try again. -----Mensaje original----- De: Safal Solutions [mailto:[EMAIL PROTECTED] Enviado el: viernes, 29 de agosto de 2003 3:37 Para: PHP General; Javier Tacon CC: Bimal Jain Asunto: RE: [PHP] Urgent help required for using Cron Dear Javier, We have done the following as per your suggestion 15 17 * * * /path/to/your/php/binary /path/to/your/script.php After editing and saving crontab file the following message pops up at the commond prompt - crontab:installing new crontab crontab:error renaming cron/tmp.1885 to cron/root rename: is a directory crontab: edit left in /tmp/crontab.1885 It did not work. Please suggest what to do next? Regards Siva -----Original Message----- From: Javier Tacon [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 5:17 PM To: Safal Solutions Subject: RE: [PHP] Urgent help required for using Cron For example, you want execute a script every day at 09:00 am: $ crontab -e And put this line: 0 9 * * * /path/to/your/php/binary /path/to/your/script.php Crontab only can say if the cron was executed correctly or not, but it doesn't say if your script in php has sent the mail correctly or not. For debug if the mail was successfully sent, develope the debug into your script. You can use a some mail classes that they have debug options (for example I use phpmailer v1.65). -----Mensaje original----- De: Safal Solutions [mailto:[EMAIL PROTECTED] Enviado el: jueves, 28 de agosto de 2003 13:32 Para: PHP General Asunto: [PHP] Urgent help required for using Cron Hi friends, I have to send mail to people automatically at specified time . Our environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a program in php to send the mail if some Condition is met. I want to activate this program at specified time using cron facility. So, How can we do that? Can any one help me?. I have another problem also. We want Cron to indicate ( through a message or a mail) to us that a given task is completed or not. In the present case Cron does a task of sending a mail to a user. After sending the mail we want Cron to indicate to us that the mail was successfully sent or not sent. This we want to know through a program because we want to use this as a part of automation of sending mails. Thanking you, Siva -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message --- I need to create a form for this example in php. I need to have an unlimited number of seats with radio buttons next to each seat for the user to be able to select. BUT, when the user visits this page, it needs to pull the seats taken from the db and cross them out, rendering them inoperable without the radio button...
http://www.lanhorizon.com/step17.php
is there a way to do this? the logic seems easy, but actually making it work is another story...
TIA
Jay
--- End Message ---
--- Begin Message --- Jay Fitzgerald wrote:
I need to create a form for this example in php. I need to have an unlimited number of seats with radio buttons next to each seat for the user to be able to select. BUT, when the user visits this page, it needs to pull the seats taken from the db and cross them out, rendering them inoperable without the radio button...
http://www.lanhorizon.com/step17.php
is there a way to do this? the logic seems easy, but actually making it work is another story...
This is pretty vague since we have no idea where you are. I'd approach it like this, though.
You know you have X seats. So you're going to first select all of the taken seats from the database (ordered by seat number) and fetch the first seat number. Then start looping from 1 to X. Within each loop, you check to see if the currently fetched seat number matches the seat number you're displaying. If it matches, then you display it crossed out and select the next row from the database. If it doesn't match, you display the seat number and the radio button.
Does that help?
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---Can anyone tell me what's wrong with my code? I tried to create a form in html and redirect it to php. but result said: Notice: Undefined variable: sender_name in c:\program files\apache group\apache\htdocs\do_feedback.php on line 2 and for all the variables ("sender_email", "like_site", and "text area"). I have been tring to use variable but it is always said "Undefined variable". Please help, Thanks. This is the code for form <FORM method="POST" action="do_feedback.php"> <p>your name: <INPUT type="text" NAME="sender_name" size=30></p> <p>your email: <INPUT type="text" NAME="sender_email" size=30></p> <p> Did you like the site? <INPUT type="radio" NAME="like_site" value="Yes" checked> yes <INPUT type="radio" NAME="like_site" value="No"> no </p> <p>Additional message:<br> <textarea name="message" cols=30 rows=5></textarea> </p> <INPUT type="submit" value="Send"> </FORM> Code for php: <? $_POST["msg"] = "Sender's Full Name:\t$sender_name\n"; $_POST["msg"] .="Sender's E-mail:\t$sender_email\n"; $_POST["msg"] .="Did you like the site?\t$like_site\n"; $_POST["msg"] .="Additional Message:\t$message\n\n"; $_POST["mailheaders"] = "From: yoyo.monash.edu.my\~nthonyak\M\n"; $_POST["mailheaders"] .="Reply-To: $sender_email\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); echo $_POST["sender_name"]; echo "<P align=center>We appreciate your feedback</P>"; ?>
--- End Message ---
--- Begin Message ---You seem confused with POST & GET, instead of using _POST to retrieve values from the form, you use $senders_name, and further down you set $_POST["msg"], which will only be used in the same php code on the same page Try $msg = "Sender's Full Name:\t" . $_POST['sender_name'] . "\n"; $msg .="Sender's E-mail:\t" . $_POST['sender_email'] . "\n"; $msg .="Did you like the site?\t" . $_POST['like_site'] . "\n"; $msg .="Additional Message:\t" . $_POST['message'] . "\n\n"; $mailheaders = "From: yoyo.monash.edu.my\~nthonyak\M\n"; $mailheaders .="Reply-To: " . $_POST['sender_email'] . "\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); -- Chris Kay (CK) Eleet Internet Services M: 0415 451 372 P: 02 4620 5076 F: 02 4620 7008 E: [EMAIL PROTECTED] -----Original Message----- From: merryE [mailto:[EMAIL PROTECTED] Sent: Friday, 29 August 2003 2:38 AM To: [EMAIL PROTECTED] Subject: [PHP] undefined variable Can anyone tell me what's wrong with my code? I tried to create a form in html and redirect it to php. but result said: Notice: Undefined variable: sender_name in c:\program files\apache group\apache\htdocs\do_feedback.php on line 2 and for all the variables ("sender_email", "like_site", and "text area"). I have been tring to use variable but it is always said "Undefined variable". Please help, Thanks. This is the code for form <FORM method="POST" action="do_feedback.php"> <p>your name: <INPUT type="text" NAME="sender_name" size=30></p> <p>your email: <INPUT type="text" NAME="sender_email" size=30></p> <p> Did you like the site? <INPUT type="radio" NAME="like_site" value="Yes" checked> yes <INPUT type="radio" NAME="like_site" value="No"> no </p> <p>Additional message:<br> <textarea name="message" cols=30 rows=5></textarea> </p> <INPUT type="submit" value="Send"> </FORM> Code for php: <? $_POST["msg"] = "Sender's Full Name:\t$sender_name\n"; $_POST["msg"] .="Sender's E-mail:\t$sender_email\n"; $_POST["msg"] .="Did you like the site?\t$like_site\n"; $_POST["msg"] .="Additional Message:\t$message\n\n"; $_POST["mailheaders"] = "From: yoyo.monash.edu.my\~nthonyak\M\n"; $_POST["mailheaders"] .="Reply-To: $sender_email\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); echo $_POST["sender_name"]; echo "<P align=center>We appreciate your feedback</P>"; ?>
--- End Message ---
--- Begin Message ---
I was going to send this to the php-db list but for some reason it bounced. Anyway here ya go:
Beta 2 of plPHP has been released. This version contains many bug fixes. For example, if you write bad plphp code and try to execute it, the code will no longer crash PostgreSQL. The URL is here: http://www.commandprompt.com/entry.lxp?lxpe=260 There are precompiled binaries for RedHat 9. There are general compilation instructions. Sincerley, Joshua Drake
<<inline: wink_n.gif>>
--- End Message ---
--- Begin Message ---Hi, I am a newbie to php. I am reading date in the format "08-Aug-03" from a text file. While writing this date into the myqsl database's date column it shows '00-00-0000'. Is there a function or some other way to convert "08-Aug-03" type of dates in to format which is acceptable by date field of the mysql database. Thanks and regards Anil.
--- End Message ---
--- Begin Message ---Hi! U can convert "8-Aug-03" into mysql date which requires yyyy-mm-dd format as below. <?php date("Y-m-d",strtotime("8-Aug-03")); ?> Hope this helps and let me know. Cheers Binay ----- Original Message ----- From: "Anil Garg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 29, 2003 11:01 AM Subject: [PHP] converting date into database date format(newbie) > Hi, > > I am a newbie to php. > > I am reading date in the format "08-Aug-03" from a text file. While writing > this date into the myqsl database's date column it shows '00-00-0000'. > Is there a function or some other way to convert "08-Aug-03" type of dates > in to format which is acceptable by date field of the mysql database. > > Thanks and regards > Anil. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
--- End Message ---
--- Begin Message --- Hi,
I am trying to come up with a form with more then one submit button, and am seeing some unexplainable results. Here is a small complete page to illustrate it:
============ cut here =============================== <html><head></head><body> <? if ( $HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST" ) { echo "action is " . $_POST["action"] . "<br>\n"; } else { ?> <form action="test.php" method="post"> <table> <tr><td> <BUTTON type="submit" name="action" value="Save">Save</button> </td><td> <BUTTON type="submit" name="action" value="Find">Find</button> </td></tr> </table></form> <?}?> </body></html> =======================cut here====================== so, here are two buttons, one called Save and another one called Find. The idea is that $_POST["action"] will be set to the value of the button pressed. I tried it with php 4.3.0 and 4.3.2.
The thing is that Mozilla 1.0.1 on Linux does behave this way: "action is Save" shows after hitting the 'Save' button, "action is Find" showa if the 'Find' button is pressed.
IE of different versions though show only "action is Find", no matter what button I press!
How is this at all possible - does the server's PHP code behave differently depensding on the client's browser type - I find it so hard to believe...
Any ideas/suggestions on how to have browser invariant multiple submit buttons would be highly appreciated.
--- End Message ---
--- Begin Message ---Hi! Use <input type='submit' name='action' value='Save'> <input type='submit' name='action' value='Find'> instead of <BUTTON type="submit" name="action" value="Find">Find</button> and so.... Hope this helps .. Cheers Binay ----- Original Message ----- From: "VB" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 29, 2003 11:36 AM Subject: [PHP] server/browser dependancies? > Hi, > > I am trying to come up with a form with more then one submit button, and > am seeing some unexplainable results. Here is a small complete page to > illustrate it: > > ============ cut here =============================== > <html><head></head><body> > <? > if ( $HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST" ) { > echo "action is " . $_POST["action"] . "<br>\n"; > } else { > ?> > <form action="test.php" method="post"> > <table> > <tr><td> > <BUTTON type="submit" name="action" value="Save">Save</button> > </td><td> > <BUTTON type="submit" name="action" value="Find">Find</button> > </td></tr> > </table></form> > <?}?> > </body></html> > =======================cut here====================== > so, here are two buttons, one called Save and another one called Find. > The idea is that $_POST["action"] will be set to the value of the button > pressed. I tried it with php 4.3.0 and 4.3.2. > > The thing is that Mozilla 1.0.1 on Linux does behave this way: > "action is Save" shows after hitting the 'Save' button, "action is Find" > showa if the 'Find' button is pressed. > > IE of different versions though show only "action is Find", no matter > what button I press! > > How is this at all possible - does the server's PHP code behave > differently depensding on the client's browser type - I find it so hard > to believe... > > Any ideas/suggestions on how to have browser invariant multiple submit > buttons would be highly appreciated. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
--- End Message ---
--- Begin Message ---Hi Tom, configure ... --with-iconv doesn't change anything, configure is ok but make ends with:
gcc: /usr//lib/.libs/libiconv.so: No such file or directory gcc: /opt//lib/.libs/libiconv.so: No such file or directory
I decided to create a link /opt/lib/.libs/libiconv.so -> /opt/lib/libiconv.so.2.2.0
Now, I still have the following message:
gcc: /usr//lib/.libs/libiconv.so: No such file or directory
I don't want to make links everywhere!
Regards, Alain.
Tom Rogers a écrit:Hi,
Friday, August 29, 2003, 12:52:11 AM, you wrote: AB> Hi,
AB> I don't know what to do with libiconv to build php4.3.3. AB> My libiconv-1.9 is installed in /opt
AB> if I invoke configure .... --with-iconv=/opt the script runs fine but I AB> get the following message at compile time:
AB> gcc: /usr//lib/.libs/libiconv.so: No such file or directory AB> gcc: /opt//lib/.libs/libiconv.so: No such file or directory
AB> What is strange is that /lib/.libs is a directory tree in the AB> libiconv-1.9 source directory.
AB> So, I tried to invoke configure .... AB> --with-iconv=/home/a.bonnefoy/portage/libiconv-1.9.
AB> But now configure complains asking me to reinstall libiconv.
AB> What to do???
AB> Thanks, AB> Alain.
What happens if you just use --with-iconv ?
--- End Message ---
--- Begin Message ---Hi, Friday, August 29, 2003, 4:09:14 PM, you wrote: AB> Hi Tom, AB> configure ... --with-iconv AB> doesn't change anything, configure is ok but make ends with: AB> gcc: /usr//lib/.libs/libiconv.so: No such file or directory AB> gcc: /opt//lib/.libs/libiconv.so: No such file or directory AB> I decided to create a link /opt/lib/.libs/libiconv.so -> AB> /opt/lib/libiconv.so.2.2.0 AB> Now, I still have the following message: AB> gcc: /usr//lib/.libs/libiconv.so: No such file or directory AB> I don't want to make links everywhere! AB> Regards, AB> Alain. AB> Tom Rogers a écrit: >> Hi, >> >> Friday, August 29, 2003, 12:52:11 AM, you wrote: >> AB> Hi, >> >> AB> I don't know what to do with libiconv to build php4.3.3. >> AB> My libiconv-1.9 is installed in /opt >> >> AB> if I invoke configure .... --with-iconv=/opt the script runs fine but I >> AB> get the following message at compile time: >> >> AB> gcc: /usr//lib/.libs/libiconv.so: No such file or directory >> AB> gcc: /opt//lib/.libs/libiconv.so: No such file or directory >> >> >> AB> What is strange is that /lib/.libs is a directory tree in the >> AB> libiconv-1.9 source directory. >> AB> So, I tried to invoke configure .... >> AB> --with-iconv=/home/a.bonnefoy/portage/libiconv-1.9. >> AB> But now configure complains asking me to reinstall libiconv. >> >> AB> What to do??? >> >> AB> Thanks, >> AB> Alain. >> >> >> What happens if you just use --with-iconv ? >> I just installed libiconv-1.9.1 and made with ./configure --prefix=/usr make make install then rebuilt php with --with-iconv=/usr and it built just fine Some bits of iconv seem to need gettext, do you have that installed? -- regards, Tom
--- End Message ---
--- Begin Message --------Message d'origine----- De : Vincent Fievet Envoyé : mercredi 27 août 2003 10:44 À : '[EMAIL PROTECTED]' Objet : problem with a mysql query with data from a form hi, i am a newbie to php and mysql, i run the easyphp kit ( php 4.2.0, Mysql 3.23.49 and phpmyadmin 2.2.6 ) i would like to use a select * from mytable where my variable like '%$mystring%' where $mystring come from a form <form action="show.php" method="post" name="form1" target="_blank"> <table align="left"> <tr> '%Mike % <td width="98"><h3>Communication Impliquant :</h3></td> <td width="144" valign="middle"> <font color="#FFFFCC"> <select name="det" size="5" id="det"> <option value="PC" selected>PC</option> <option value="echo">echo</option> ... <option value="H10 Tango">H10 Tango</option> </select> <select name="den" size="1" id="den"> <option value=" " selected> </option> <option value="1">1</option> ... <option value="10">10</option> </select> </font></td> <td width="153"> <input name="delibre" type="text" id="delibre" maxlength="20"></td> <td width="39"> <input type="submit" name="Submit" value="Ok"> </td> so ,after choosing "PC" in the form, in show.php i do a $sql="SELECT * FROM journal WHERE a like '% $det%' OR de like '%$det%' order by dateheure desc"; echo $sql; and what i get is : SELECT * FROM journal WHERE a like '%PC %' OR de like '%PC %' order by dateheure desc ( note the blank space at the end of PC ) whitch doesnt get any record since the word i am looking is "PC" and not "PC " i used a "like" because the request should be used to find record with "PC 1" "PC" "PC 9" "PC12" ... any ideas ? Thanx Vincent Fievet
--- End Message ---
--- Begin Message -------- Original Message ----- From: "Vincent Fievet" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 29, 2003 11:55 AM Subject: [PHP] problem with a mysql query with data from a form -----Message d'origine----- De : Vincent Fievet Envoyé : mercredi 27 août 2003 10:44 À : '[EMAIL PROTECTED]' Objet : problem with a mysql query with data from a form hi, i am a newbie to php and mysql, i run the easyphp kit ( php 4.2.0, Mysql 3.23.49 and phpmyadmin 2.2.6 ) i would like to use a select * from mytable where my variable like '%$mystring%' where $mystring come from a form <form action="show.php" method="post" name="form1" target="_blank"> <table align="left"> <tr> '%Mike % <td width="98"><h3>Communication Impliquant :</h3></td> <td width="144" valign="middle"> <font color="#FFFFCC"> <select name="det" size="5" id="det"> <option value="PC" selected>PC</option> <option value="echo">echo</option> ... <option value="H10 Tango">H10 Tango</option> </select> <select name="den" size="1" id="den"> <option value=" " selected> </option> <option value="1">1</option> ... <option value="10">10</option> </select> </font></td> <td width="153"> <input name="delibre" type="text" id="delibre" maxlength="20"></td> <td width="39"> <input type="submit" name="Submit" value="Ok"> </td> so ,after choosing "PC" in the form, in show.php i do a $sql="SELECT * FROM journal WHERE a like '% $det%' OR de like '%$det%' order by dateheure desc"; ++++++++++++++++++ should be $sql="SELECT * FROM journal WHERE a like '$det %' OR de like '$det %' order by dateheure desc"; No need of prefixing $det with % (blank space after $det.) ++++++++++++++++ echo $sql; and what i get is : SELECT * FROM journal WHERE a like '%PC %' OR de like '%PC %' order by dateheure desc ( note the blank space at the end of PC ) whitch doesnt get any record since the word i am looking is "PC" and not "PC " i used a "like" because the request should be used to find record with "PC 1" "PC" "PC 9" "PC12" ... any ideas ? Thanx Vincent Fievet
--- End Message ---
--- Begin Message ---Has anybody managed to intergrate Crystal Reports to work with unix and php ?
--- End Message ---
--- Begin Message --- Is there anyway to get an absolute URL to work with Require & Include? Why doesn't it work already? I did see the tip about using $_SERVER, but this slows down page-loading considerably.
Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
"Standing up for what you believe in is never a waste of time."
-- Seth Willits
------------------------------------------------------------------------ ---
--- End Message ---
--- Begin Message --- Mike At Spy wrote:Is there anything special I have to do to enable GD when using PHP 4.3.2?
I'm getting an error of:
Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/sites/site37/web/photos/functions.php on line 594
When I use the imagecreatefromjpeg() function. Is it not usable with gd? Should I be using imagecreatefromgd()?
not sure about this, but did you install PHP from source with --with-gd specified?
if not, was PHP installed with an RPM? if so, try uninstalling, then reinstalling it.
Kae
--- End Message ---
--- Begin Message --- Hello,
I am wondering if an application written to work with register globals set to off ($_GET[variable] etc.) would work with a system, where register globals is set to on?
If not, is there a way to make it work for boty configurations?
thanx for any help on that,
Merlin
--- End Message ---
--- Begin Message --- Merlin wrote:Hello,
I am wondering if an application written to work with register globals set to off ($_GET[variable] etc.) would work with a system, where register globals is set to on?
yes.
Kae
--- End Message ---
--- Begin Message --- I've asked about this before but could not get a working solution.
I have a database. Users put data in the DB :) I have a page with a list of accessible data "block". Each "block" has a button next to it.
When a user click a button what I would like is:
- I extract the data block from the DB
- I send the data to the browser as a file download so the user can save the data block to disk. (i.e. a save-file-as dialog comes up)
- I mark the data block as inaccessible
- I reload the page and present a new list. The data block the user as just selected is no longer in the list.
I have figure out how to force a file download using:
header("Content-disposition: attachment; filename=aFile"); header("Content-type: application");
The problem I have is that I need a way of send the user back to list page so I can regenerate a new listing. I can't use header("Location") because I've already started an output stream (the download).
Some suggested using this header:
header("Content-Type: multipart/mixed; boundary=\"-Boundary-12399\"");
But I could quite get it to work. The example code I have been trying to get to work make Netscape open a save-as dialog three times and on IE 6 just prints everything in the browser window. This is the code:
(suggested by Marek Kilimajer) <? header("Content-Type: multipart/mixed; boundary=\"-Boundary-12399\"");
print "---Boundary-12399\r\n"; print "Content-Type: text/html\r\n"; print "\r\n";
//HTML code goes here
print "\n"; print "---Boundary-12399\r\n"; print "Content-Type: application/octet-stream\r\n"; print "Content-Disposition: attachment; filename=foo.tar.gz\r\n\r\n"; readfile("./foo.tar.gz");
print "---Boundary-12399--\r\n"; print "\r\n"; ?>
I'm sure someone has done this before :) What is the "correct" way to achieve this effect? Is multipart content-type the way to go?
Thanks,
Jean-Christian Imbeault
--- End Message ---
--- Begin Message ---Dear all I want to convert a text file to pdf format and store it in somewhere in my harddisk. I had found out that there is a dll inside my php4.04 directory ("c:\php\extensions\php_pdf.dll") and from php.ini i had check that the extension_dir=c:\php\extensions; extension=php_pdf.dll had actived; now i obtained a simple script from the net, and tried to test it , but it return alot of errors! Here is the testing script : <?php dl("php_pdf.dll"); # $Id: hello.php,v 1.9 2003/03/14 17:07:56 rp Exp $ /* create a new PDFlib object */ $p = PDF_new(); /* open new PDF file; insert a file name to create the PDF on disk */ PDF_open_file($p, ""); PDF_set_info($p, "Creator", "hello.php"); PDF_set_info($p, "Author", "Rainer Schaaf"); PDF_set_info($p, "Title", "Hello world (PHP)!"); PDF_begin_page($p, 595, 842); /* start a new page */ $font = PDF_load_font($p, "Helvetica-Bold", "winansi", ""); PDF_setfont($p, $font, 24.0); PDF_set_text_pos($p, 50, 700); PDF_show($p, "Hello world!"); PDF_continue_text($p, "(says PHP)"); PDF_end_page($p); /* close page */ PDF_close($p); /* close PDF document */ $buf = PDF_get_buffer($p); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=hello.pdf"); print $buf; PDF_delete($p); /* delete the PDFlib object */ ?> and here is the error message i got when i ran the script : X-Powered-By: PHP/4.0.4pl1 Content-type: text/html Warning: Function registration failed - duplicate name - pdf_set_info in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2 Warning: Function registration failed - duplicate name - pdf_set_info_creator in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2 Warning: Function registration failed - duplicate name - pdf_set_info_title in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2 Warning: Function registration failed - duplicate name - pdf_set_info_subject in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2 Warning: pdf: Unable to register functions, unable to load in Unknown on line 0 Fatal error: Call to undefined function: pdf_new() in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 6 PHP Warning: Unable to load dynamic library 'c:\php\extensions/libpdf_php.dll' - The specified procedure could not be found. in Unknown on line 0 Can anyone seens this before? if so, could you please give me some hints how i can convert a text file to pdf file under windows environment? Thx alot Jack
--- End Message ---