RE: [PHP] passing variables from forms to the same page repetatively
INPUT TYPE=HIDDEN NAME=name_of_variable VALUE=value_of_variable -Original Message- From: Tim Olsen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 2:12 AM To: [EMAIL PROTECTED] Subject: [PHP] passing variables from forms to the same page repetatively People, I have 4 forms in four seperate html pages included directly (no links to includes) in the same .php file, i have it so all the form actions is php.self, so when each form is submitted it goes on to display the next form in line, using if and else statements, of course. I want to be able to use variables created by the first form in the html part of the last form. What is the best way to do this? So far, I can only use variables on the next page (form) that is written out. After that those variables have no value. Is there some way to submit all variables present and assigned with the submission of each form? If I make the forms a seperate include file, instead of having them in-line, how does this change the ways variables are passed or submitted by each form? Thanks, - Tim _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] regex help
I think he means swap... -- Lasse Jack Dempsey [EMAIL PROTECTED] wrote in message 000601c10e81$03aca260$22ebd73f@2pqjp01">news:000601c10e81$03aca260$22ebd73f@2pqjp01... What exactly are you trying to do? Switch around in what way? Jack -Original Message- From: Alvin Tan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 12:43 AM To: [EMAIL PROTECTED] Subject: [PHP] regex help hi all, a little OT here, but need some quick help. I have a bunch of e-mails to convert into sql entries and I'm stuck here. I have: , John Doe, [EMAIL PROTECTED], .. I just need to know what's the regex to switch around the name and e-mail address. TIA, @lvin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passing variables from forms to the same page repetatively
On Tue, 17 Jul 2001 15:41, Tim Olsen wrote: People, I have 4 forms in four seperate html pages included directly (no links to includes) in the same .php file, i have it so all the form actions is php.self, so when each form is submitted it goes on to display the next form in line, using if and else statements, of course. I want to be able to use variables created by the first form in the html part of the last form. What is the best way to do this? So far, I can only use variables on the next page (form) that is written out. After that those variables have no value. Is there some way to submit all variables present and assigned with the submission of each form? If I make the forms a seperate include file, instead of having them in-line, how does this change the ways variables are passed or submitted by each form? Thanks, - Tim _ If I understand what you are saying: those variables don't exist until you SUBMIT the form. You can demonstrate this by looping through and displaying your POST or GET vars at the beginning of the form and see what happens when you first open the page, and when it calls itself. And re-reading, I think what you may want is hidden fields. You want part one to call part 2, and retain values from part 1, etc? Echo the values into hidden fields in each step of the process. INPUT TYPE=hidden NAME=whatever VALUE=?php echo $whatever ? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I always lie. In fact, I'm lying to you right now! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql_query problem (more suggestions)
Hi again, Just a long shot: since password() encrypts the password that's passed through it, how did the original password get in to db anyway? Was it encrypted too? Cause if the password in the db is plain text and the user submits a plain text in a form called $password, the password() function WILL encrypt the form input and there will be no matches. try removing the password() function in the sql query and substitute it for $password only. If there is a match, then we know we need to put in the db an INSERT statement with password().. @lvin At 01:57 PM 7/17/01, Brad Wright wrote: Jason, I have tried what yoiu suggested. result is the same. From: Jason Murray [EMAIL PROTECTED] Date: Tue, 17 Jul 2001 15:28:11 +1000 To: 'Brad Wright' [EMAIL PROTECTED], Alvin Tan [EMAIL PROTECTED], PHP General List [EMAIL PROTECTED] Subject: RE: [PHP] mysql_query problem (more suggestions) Unless i have actually defined a function 'password()', calling 'echo password('$password') will (...does, i just double checked) causes a Fatal Error 'Undefined Function'. Nice try tho :) the original mail said to echo $query, which will include some text in it that says password('ifovhfoiuf') ... you should then paste that entire query into your MySQL interpreter and see what the reaction is instead of trying to secondguess it :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Strange wierd problem
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Tom Malone) wrote: I am using sessions to track visitors to my site, and one of the things I'd like to do is add a time-stamp to each entry in my MySQL database. The problem is that, for some reason, the time-stamp part only seems to work part of the time. I know it can't be, but it almost seems arbitrary - i haven't been able to determine a pattern. Just a guess, but arbitrary sounds as though the timestamp format you're inserting may not be the right one for the datatype of the field it's being inserted into. And the format you're using is not recognizable to me as a standard format for a date, datetime, or timestamp field. $now = date(D M j, H:i); $sql = INSERT INTO $table_name (ndx, id, time, ip_address, browser, origin) VALUES (\\, \$id\, \$now\, \$ip_address\, \$browser\, \$origin\); $result = mysql_query($sql, $connection) or die(Couldn't update session logs. MySQL error: . mysql_error()); But rather than creating/adjusting the timestamp in PHP, why not use the MySQL built in function now() (for a date or datetime field) or NULL (for a timestamp field)? INSERT INTO $table_name (ndx, id, time, ip_address, browser, origin) VALUES (\\, \$id\, now(), \$ip_address\, \$browser\, \$origin\); or INSERT INTO $table_name (ndx, id, time, ip_address, browser, origin) VALUES (\\, \$id\, NULL, \$ip_address\, \$browser\, \$origin\); (BTW, time is a reserved word in MySQL since it is the name of a field type. I'm surprised MySQL isn't reporting a warning about that. Still, you should change that field's name to something else.) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] to use PHP under Netscape Enterprise Server 3.51
Hi! Please help me to use PHP under Netscape Enterprise Server 3.51 or Fast track 4.1 Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] test
Sorry people just testing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Output (Urgent!)
Why doesn't this work? Any ideas?! $resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; if ($resolution = '1024') { $resolution = 1024; } else { $resolution = 800; } echo $resolution; It always output 1024 Best regards Fredrik A. Takle Bergen, Norway -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] email counter
Hi, Brian White [mailto:[EMAIL PROTECTED]] wrote on Tuesday, July 17, 2001 5:52 AM To: Jack; [EMAIL PROTECTED] Subject: Re: [PHP] email counter How about changing link to a href=mymailer.php?[EMAIL PROTECTED] Big George /a Where mymailer.php is something like ?php /* Do whatever it is you need to do with $email */ header(Location: mailto:$email; ); ? Works, but changes the previous open window into a empty sheet and displays mailto:[EMAIL PROTECTED];, so the old page disappears (the user has to click the back button). I think this solution is not really good for common usage. Try to use javascript: script language=JavaScript x = window.open(mailto:?php echo $mailaddress ?, Site); /script It's easy to combine it with PHP to count the send mails. Joerg www.php.comzept.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] report generation with PHP
În 17 Jul 2001 19:47:23 +1200 Philip Murray a scris: What about using a Windows COM object? There should be one for Access and if not you can use the Word one and generate word documents Don't use Words for that... We've had to generate invoices to be snail-mailed, imagine if the address in the invoiced didn't matched the envelope's transparent area... (don't think a word document can handle 6000 invoices anyway) Marius Andreiana -- You don't have to go to jail for helping your neighbour http://www.gnu.org/philosophy/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strange Behavior... is it php bug? please help... i'm dying.!!!
Hi. I'm running Apache 1.3.19/php 4.06 under OpenBSD. I have 30 virtual domains... all plain html (or w/ little php), some date functions and mysql queries. But one of them has a lot of php. It's giving me a strange problem... Here is index.php ?php require_once(include/layout.inc); // HERE IS THE COMMONHEADER commonHeader(www.mydomain.com); ? BRBR ?php require_once(home.inc); //THIS IS JUST PLAIN TEXT. ? ?php //commonFooter(); // THIS is in include/layout.inc also. COMMENTED NOW. ? Simple (the commonHeader / commonFooter idea was taken from php.net itself) (open source eh?) ;) Now. This works fine from SOME PLACES, and I mean, from the internal network and from many places around the globe, but I've found that from certain places (no pattern found) it will just say, web site found waiting for reply. (I will paste the commonheader/footer contents below). There seems not to be any kind of pattern. From places where this doesn't work, other sites (from the 30) will work just fine, even w/php). I've found that removing what I will show you on commondeader function it will work. For testing purposes I Commented out commonFooter. Functions like print_link, print_image etc. are also on layout.inc (and they work, because if I comment out Commonheader/footer from index.php, the home.inc has some of these functions and the page will display correctly.) Here is commonHeader. If I REMOVE almost everything (unable to find a pattern either) it will work. But it doesnt work like this... as I've said it will say web site found waiting for reply (tested on IE 5.5 and Lynx from linux, but lynx from localhost works and my IE from windows98 works either!) ?php function commonHeader($title=,$dont_enclose=0,$headers_gone=0) { global $MYSITE, $MIRRORS, $COUNTRIES, $enclosed; global $SIDEBAR_DATA, $prevsearch; ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head title?php if ($title){ echo : $title; } else { echo www.mydomain.com;} ?/title link rel=stylesheet href=/style.css /head body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=#ff text=#00 link=#99 alink=#ff vlink=#99 a name=TOP/a table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#11 width=100% id=AutoNumber1 tr td width=40% style=border-bottom-style: solid; border-bottom-width: 1 a href=/?php print_image('logobig.jpg', 'mydomain.com'); ?/a td width=60% style=border-bottom-style: solid; border-bottom-width: 1 table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#11 width=100% id=AutoNumber2 tr height=30 td width=100% valign=center align=right font size=2 face=Courier NewBuenos Aires, ?php $today = date(F j, Y); echo $today;?/font/td /tr tr td width=100% VALIGN=bottom align=right ?php print_link('/cv.php','curriculum vitae',false,'class=small'); echo delim(); print_link('/projects.php', 'projects', false, 'class=small'); echo delim(); ? /td /tr /table /td /tr tr height=15 td width=100% bgcolor=#C0C0C0 colspan=2 style=border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1 nbsp;/td /tr /table !-- End Of Paste -- ?php } ? ANY ideas?? I am crazy about this... and have no idea what it could be. There are no firewalling rules on the box (all is open) and as I've told you... I can access from certain places.. (for example I go to a friend's dial up account and it works fine but other ppl tells me it's not working!) If commonheader is reduced to ?php function commonHeader($title=,$dont_enclose=0,$headers_gone=0) { ? html head title/title /head body hello /body /html WORKS!!! (although as I've told you I haven't found what exactly is happening) Any help would be appreciated... Thanks in advance. Regards, Martin Marconcini Life must be lived looking forward and can be understood only looking backward. Soren Kierkegaard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] variables.
ok, i still am a newbie to this and therefor ill ask this silly question. I have made a small test script which checks the inputted name and pass against my database and if it was successfull it typed out success! and if it wasnt successfull it types out wrong password! My problem is. everytime i reload the page it prints out the last result. I mean when i want to reload the page it should be empty. But it isnt. Does anyone know how i can do this? If you dont understand my question ill post the script here, i just thought i wouldent flame your mailboxes. //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] report generation with PHP
În 17 Jul 2001 09:56:23 +0200 Jörg Krause a scris: PHP has Java-Support build in, has anybody checked out this with a tool like FOP (calling Java program from PHP)? Is it stable, good for production environment? Yes, I'd like an answer to this too. Right now I can only call it with system calls from PHP, but with a native function would be much nicer (could show the progress too) Marius Andreiana -- You don't have to go to jail for helping your neighbour http://www.gnu.org/philosophy/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Hi all.
When i install PHP. Do i have to make anything special to activate the ldap function? //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Error compiling apache / php --with-t1lib
Hi, I'm having trouble compiling php with t1lib support. Actually, php compiles fine, it stops when compiling apache. ./configure make make install php works fine. ./configure apache works. But when I make apache, I get: gcc -DLINUX=22 -I/usr/src/network/php-4.0.0 -I/usr/src/network/php-4.0.0/Zend -I/usr/src/network/php-4.0.0/Zend -I/usr/src/network/php-4.0.0 -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci`\ -o httpd buildmark.o modules.o modules/standard/libstandard.a modules/php4/libphp4.a main/libmain.a ./os/unix/libos.a ap/libap.a lib/expat-lite/libexpat.a -Wl,-rpath,/usr/local/lib/lib -Wl,-rpath,/usr/local/pgsql/lib -rdynamic -L/usr/local/lib/lib -L/usr/local/pgsql/lib -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -lgdbm -ldl -lpq -ljpeg -lz -lpng -lgd -lresolv -lm -ldl -lcrypt -lnsl -lresolv -L/usr/local/lib/lib -ljpeg -lm -lcrypt modules/php4/libphp4.a(gd.o): In function `php_minit_gd': /usr/src/network/php-4.0.0/ext/gd/gd.c:205: undefined reference to `T1_SetBitmapPad' /usr/src/network/php-4.0.0/ext/gd/gd.c:206: undefined reference to `T1_InitLib' ... and lots of similar stuff (all undefined reference to `T1_[*]`), followed by: collect2: ld returned 1 exit status make[2]: *** [target_static] Error 1 make[2]: Leaving directory `/usr/src/network/apache_1.3.19/src' make[1]: *** [build-std] Error 2 make[1]: Leaving directory `/usr/src/network/apache_1.3.19' make: *** [build] Error 2 *** Can anyone tell me what's up? (Or down, rather...) Thanks in advance! Regards, Sverre Johan Toevik -- disclaimer I speak for myself only! /disclaimer to be yourself, in a world that tries, night and day, to make you just like everybody else - is to fight the greatest battle there ever is to fight, and never stop fighting -- e.e. cummings -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] report generation with PHP
În 17 Jul 2001 19:47:23 +1200 Philip Murray a scris: What about using a Windows COM object? There should be one for Access and if not you can use the Word one and generate word documents Don't use Words for that... We've had to generate invoices to be snail-mailed, I've also done the same thing. Approximately 400 invoices a day all from a backend administration website. However, we forked out a license to use the PDF library. imagine if the address in the invoiced didn't matched the envelope's transparent area... (don't think a word document can handle 6000 invoices anyway) Yes, well true. But, the point was there is the facility to use a COM object instead of some multi-server or java kludge. If you can find a COM object to do the task (Matt: you talked about using Access for your needs) then that'll probably be the easiest/fasted solution on Win32 (short of paying for PDF). On a side note, is there some Adobe license which prevents people writing Free for use PDF libraries? Or is it just by chance that the 2 that exist require you to purchase a license? Philip Murray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Output (Urgent!)
Hi Frederik Run this code. It does what you want it to. In your original code you compared two strings in the IF-statement. When the $resolution gotten from your JavaScript returned '800' it would have a lexical higher value than '1024' and thereby do exacely what you wanted it to - actually the code would always return \1024\ since your screen resolution would never return a string with a lexical lower value than '1024'. By multiplying the string '1024' by 1 you get the integervalue 1024 (that's a trick PHP offers ;) ) which you then compare to the integervalue 1024. That's the trick $resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; echo --.$resolution.--; if (($resolution*1) = 1024) { $resolution = 1024; } else { $resolution = 800; } echo **.$resolution.**; Venlig hilsen ha' en bra dag, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Information about FastTemplate, PHPlib and making big sites.
Hello, I'm quite new to this list so i guess you've had this subject hundereds of times before(?). Anyway - I'm looking for articles/information about PHPlib, FastTemplate and their clones. I'm also looking for information about how to do big/complex sites. OOP in php, filestructures etc. Right now I don't even know what a file containing classes should be named, i've seen such files with .php, .inc, .obj and .object as extension. Thanks! Best regards, Johannes Schill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Output (Urgent!)
This fixed it, but I don't like it! If you have any other suggestions, feel free to email me. SCRIPT LANGUAGE=JavaScript if (screen.width = 1024) { var resolution = (1024) } else { var resolution = (800) } /SCRIPT Best Regards Fredrik A. Takle Fredrik A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] displaying icons
Hi everybody! Please, have somebody any experience with displaying icons (type files *.ico) in web pages? When I have a pure html file that contain img src="abduction.ico", all is OK - the icon is shown. But when I create a html page with assistance PHP, the icon isn't shown. Please, could you help me?? Thank you! Best Regards, PETER. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Output (Urgent!)
$resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; if ($resolution = '1024') { $resolution = 1024; } else { $resolution = 800; } echo $resolution; It always output 1024 At a guess becasue your mixing and matching languages. If you got the input from a hidden field in a form (perhaps an entry page?) then it would be possible to get the data you want. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Output (Urgent!)
How you want to get a value from client side to php on the same page? Joseph Orv î?÷inklÏ ²ørÏkîskî [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Frederik Run this code. It does what you want it to. In your original code you compared two strings in the IF-statement. When the $resolution gotten from your JavaScript returned '800' it would have a lexical higher value than '1024' and thereby do exacely what you wanted it to - actually the code would always return \1024\ since your screen resolution would never return a string with a lexical lower value than '1024'. By multiplying the string '1024' by 1 you get the integervalue 1024 (that's a trick PHP offers ;) ) which you then compare to the integervalue 1024. That's the trick $resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; echo --.$resolution.--; if (($resolution*1) = 1024) { $resolution = 1024; } else { $resolution = 800; } echo **.$resolution.**; Venlig hilsen ha' en bra dag, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: Output (Urgent!)
all this is happening on the server. on the server $resolution is just a string so if ($resolution = '1024') compares the two strings (using ascii values) and finds that (60) is greater than 1(49). If you want the server to know the screen width of the client you'll need to dig into the header info sent with the request, or you may need to get javascript to send it back to you, I'm not too sure about this. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html -Original Message- From: Fredrik A. Takle [mailto:[EMAIL PROTECTED]] Sent: 17 July 2001 08:35 To: [EMAIL PROTECTED] Subject: Output (Urgent!) Why doesn't this work? Any ideas?! $resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; if ($resolution = '1024') { $resolution = 1024; } else { $resolution = 800; } echo $resolution; It always output 1024 Best regards Fredrik A. Takle Bergen, Norway -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Output (Urgent!)
How you want to get a value from client side to php on the same page? Well. Actually I didn't invent the code. I just correcteded it so it worked on my installation. I must admit I was amazed that it somehow worked, but it did. Kind regards, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Output (Urgent!)
How do you know it worked? :) -Original Message- From: Morten Winkler Jørgensen [mailto:[EMAIL PROTECTED]] Sent: 17 iulie 2001 12:54 To: [EMAIL PROTECTED] Subject: Re: [PHP] Output (Urgent!) How you want to get a value from client side to php on the same page? Well. Actually I didn't invent the code. I just correcteded it so it worked on my installation. I must admit I was amazed that it somehow worked, but it did. Kind regards, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: variables.
Hmm... It seems that you're variables are beeing reposted upon each page reload. yes, some code might help. Johan Vikerskog [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED].. . ok, i still am a newbie to this and therefor ill ask this silly question. I have made a small test script which checks the inputted name and pass against my database and if it was successfull it typed out success! and if it wasnt successfull it types out wrong password! My problem is. everytime i reload the page it prints out the last result. I mean when i want to reload the page it should be empty. But it isnt. Does anyone know how i can do this? If you dont understand my question ill post the script here, i just thought i wouldent flame your mailboxes. //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Output (Urgent!)
Well, Yes... you have to stick to JavaScript + JavaScript and not JavaScript + PHP! You can let PHP talk w/ JavaScript and not the reverse! SCRIPT LANGUAGE=JavaScript type=text if (screen.width = 1024) { var resolution = 1024; } else { var resolution = 800; } document.write(resolution); /SCRIPT btw, why don't you like it? Fredrik A. Takle [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This fixed it, but I don't like it! If you have any other suggestions, feel free to email me. SCRIPT LANGUAGE=JavaScript if (screen.width = 1024) { var resolution = (1024) } else { var resolution = (800) } /SCRIPT Best Regards Fredrik A. Takle Fredrik A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to add a new color to JPEG
Jennifer wrote: it seems to ignore the color that I specify and always came out grey. (Of course now if I use ImageColorClosest(), some colors work because they are in my image.) Any idea on how solutions? Oops. I didn't read far enough. I found the following in a separate thread. I experienced the same, but i use following workaround: Create a new Jpeg, Allocate your colours, and copy your original jpg into the new one. then you have all the colours you have allocated in your new pic... So now my question is, how do I copy one image into another? I see ImageCopy(), but it mentions copying a part of the image, so do I have to use GetImageSize to determine the size of the src image first? Jennifer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Adding elements to an array
$MyArray['BUYVAL'] = 1.23; -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: 17 iulie 2001 13:11 To: [EMAIL PROTECTED] Subject: [PHP] Adding elements to an array Hello, I have a requirement to add elements to an associate array dynamically based on some conditions. I initialize the array with the 1st associate array element $MyArray = array('DATETIME' = $DateTime); How do I add more elements to this associate array. I am using PHP 3 and array_merge and other functions for arrays are not supported in PHP3. I am trying the following: $MyArray[] = array(BUYVAL = 1.23); but if I try and get the value of $MyArray[BUYVAL], I get nothing. I am sure this must be simple, but I do not seem to be getting it right!! Regards, Sharat Hegde Phone: 6560360 Ext 4680 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Adding elements to an array
Try $MyArray = array('DATETIME' = $DateTime); $MyArray[BUYVAL ] = 1.23; Sharat Hegde [EMAIL PROTECTED] wrote in message 30402B4CB8C7D311A3C600C04F1513BC7E8976@bg2ipmail">news:30402B4CB8C7D311A3C600C04F1513BC7E8976@bg2ipmail... Hello, I have a requirement to add elements to an associate array dynamically based on some conditions. I initialize the array with the 1st associate array element $MyArray = array('DATETIME' = $DateTime); How do I add more elements to this associate array. I am using PHP 3 and array_merge and other functions for arrays are not supported in PHP3. I am trying the following: $MyArray[] = array(BUYVAL = 1.23); but if I try and get the value of $MyArray[BUYVAL], I get nothing. I am sure this must be simple, but I do not seem to be getting it right!! Regards, Sharat Hegde Phone: 6560360 Ext 4680 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Known bugs with HTTP upload on Windows NT?
Hmm... do you have write access on that directory? IUSR_xxx and IWAM_ users must be appropriate writes on that folder... Adam Whitehead [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All- I'm having trouble with a simple script that allows HTTP upload. It's a direct copy of the code available on the PHP web site. The script works fine on a UNIX machine running PHP 4.0.6 and a Windows 98 machine running 4.0.6. However when I test it on a Windows NT machine running PHP 4.0.6, as soon as the submit button is clicked it causes a page fault in php.exe. Is this a known issue? In php.ini, the temporary upload path is set to a correct location and no amount of tweaking this path makes any difference. The script looks like this: ?php if (is_uploaded_file($userfile)) { move_uploaded_file($userfile,H:\\www\\uploadtest.txt); echo Done.; } ? FORM ENCTYPE=multipart/form-data ACTION=uploadtest.php METHOD=post INPUT TYPE=hidden name=MAX_FILE_SIZE value=50 Send this file: INPUT NAME=userfile TYPE=file INPUT TYPE=submit VALUE=Send File /FORM Regards, Adam Whitehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] edit xml with php?
Hi! I am trying to edit this xml-file: I want to change one of the li-nodes. ?xml version=1.0? kund li naper/na enBylund/en gaSemin/ga /li li naAxel/na enTiman/en gaSemina/ga /li li naLars/na enBerg/en gaSeminar/ga /li /kund - I have tryed to read and explode on /li $fd = fopen($filename, r); $string = fread($fd, filesize($filename)); $fru = explode (/li, $string); for ($i=0;$fru[$i];++$i) { $newfru = ($fru[$i]./li); $newfru = str_replace(/kund.\r\n./li,/kund,$newfru); print $newfru; } How to replace one of the $fru[i], I have tryed inside the forloop but than it replaces all. Thanks in advance for any help. Regards Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Extracting from arrays - alphabetically
Hi, A simple problem for you guys (I think), I have 2 arrays - firstname and lastname, both have the same associative index - lastname, I have then performed asort on both to order them alphabetically. Now I just need to extract and display the array elements that have the associative index beginning with A or B or whatever is defined by $query - thus displaying only names where the lastname begins with A etc. How do I do this? Thanks for any help you can offer. Lar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] SQL in array() ?
Hey guys, I saw a post in here the other day that's prompted me to ask this question... Because I can't seem to get the solution mentioned to work. Maybe I'm missing something obvious... Anyway, here goes. I have a list of categories contained in one table, and a list of entries in another. So categories: id name 1 category1 2 category2 3 category3 At the moment, the entries table has a field which contains a field mentioning the category by id, so: entries id cat_id name 1 1 name1 2 1 name2 3 1 name3 The problem is this: I'd like to give some entries more than one category. I attempted to put the category id's into an array. So a row in the revised entries table now looks like this: entries id cat_id name 1 2 name1 2 1,3 name2 3 1 name3 And I'm trying to list from that table with code similar to this: ? $cat[0] = 1; $cat[1] = 3; $getcats = implode(,, $cat); $query = @mysql_query(SELECT * FROM entries WHERE cat_id IN($getcats)) or die (mysql_error()); // Get the results ? I get no errors when executing that code, but I don't get any results back, either.. even though I know there are entries in the table with the category id listed as 1,3 Any ideas? I'm having one of those days :) Cheers, James. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] REPOST: converting multiple URL values for the same variable into an array
Kurt, You might have some luck with adding [], I seem to remember that making arrays for form posts, so it might do gets too... http://myhost/playlist.pls?song[]=100song[]=101song[]=102 and if you always end up with an array using [], you might change the condition to count($song) 1 or something for: if ( is_array( $song ) ) { else { } Good Luck -Garth --- http://www.northern.ca On Mon, 16 Jul 2001 20:03:50 -0700 Kurt Lieber wrote: I posted this late on Sunday afternoon, so it may have been overlooked. I haven't figured it out yet, so I'm reposting in the hopes someone can help. Thanks. --- I'm modifying some code for ampache (ampache.kveton.com) and have run into a snag that I'm not sure I understand completely. Part of the code produces a URL similar to the following: http://myhost/playlist.pls?song=100song=101song=102 and $song then gets passed to this function: function get_song_path_from_id ( $song ) { GLOBAL $dbh, $db_name; $songs = ''; $count = 0; if ( is_array( $song ) ) { while ( list($k,$v) = each($song) ) { //does some cool stuff } } else { //does some other stuff } return ($songs); } So, am I correct in assuming that $song will never be considered an array? (basically, given the above code and URL, $song will always equal 102) I'm new to PHP, and since I didn't write the original code, I'm not sure if this is a bug, or something that I just don't fully understand. Assuming it is a bug, can anyone offer some suggestions on how to take the URL and parse it out and input the values into an array called $song? (get_song_path_from_id() is used by several other parts of the code, so any modifications to that code would need to leave the rest of the functionality intact) Thanks. --kurt P.S. If anyone is looking for a simple, easy-to-use (and set up) mp3 manager, I highly recommend ampache. It doesn't have a bunch of bells whistles (which I don't want) -- it simply provides a simple, effective way to manage playlists and play your mp3 songs from anywhere. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] edit xml with php?
I am trying to edit this xml-file: Have a look at: http://ww.phpxml.org/ Bye Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: REGEXP
This is wrong. It should be Content-Type: multipart/mixed; boundary=B42DA66C4EC07C9B572A58FC I don't know why it is not reading the whole string. It seems to treat the *boundary* part as another line. It _is_ another line; it just happens to starts with whitespace. check RFC822. No doubt. If you have the whole message in a string (psuedo-code): Huh.. Then the below should work. But the stupid header breaks :) list ($h,$msg) =split(\n\n, $mailmsg); $h=str_replace(\t, , $h); // tab - space $h=str_replace(\n , , $h); // nlspace - space // i.e. continuation of prior line $hdrs=split(\n, $h); ... Regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] SQL in array() ?
I'm not going to comment on array processing techniques, but I suggest you are into a situation where you have to rethink your database design from the point of view of performance and normalization. I don't know how many records you will eventually have, but the key to performance in SQL databases is the effective use of indexes, and queries which match. Even if you have an index on the cat_id field, a query like SELECT * FROM entries WHERE cat_id IN($getcats) forces the database engine into a sequential read of the cat_id field. So you can drop the cat_id field from entries and create a new table entry_cat which has two fields id cat_id Which gives you this query, although I'm a little uncertain about the bracketing of the condition. select entries.id, entries.name, entry.cat_id from entries, entry_cat where (entry_cat.id = 1 || entry_cat.id = 3) (And which, on reflection, may not yield better performance.) All this brings me to the question I should have asked up front. How often will you want to select multiple categories, and will it be done by range (2 , =3) or individual items ( 1 and 5 and 7 )? I don't think I've been terribly helpful - Miles At 12:14 PM 7/17/01 +0100, James Holloway wrote: Hey guys, I saw a post in here the other day that's prompted me to ask this question... Because I can't seem to get the solution mentioned to work. Maybe I'm missing something obvious... Anyway, here goes. I have a list of categories contained in one table, and a list of entries in another. So categories: id name 1 category1 2 category2 3 category3 At the moment, the entries table has a field which contains a field mentioning the category by id, so: entries id cat_id name 1 1 name1 2 1 name2 3 1 name3 The problem is this: I'd like to give some entries more than one category. I attempted to put the category id's into an array. So a row in the revised entries table now looks like this: entries id cat_id name 1 2 name1 2 1,3 name2 3 1 name3 And I'm trying to list from that table with code similar to this: ? $cat[0] = 1; $cat[1] = 3; $getcats = implode(,, $cat); $query = @mysql_query(SELECT * FROM entries WHERE cat_id IN($getcats)) or die (mysql_error()); // Get the results ? I get no errors when executing that code, but I don't get any results back, either.. even though I know there are entries in the table with the category id listed as 1,3 Any ideas? I'm having one of those days :) Cheers, James. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Custom Headers?
Can I send like custom headers? header (Resolution: 1024); and echo it in the phpscript? Can I do this or is it a silly question? Best Regards Fredrik A. Takle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mail() help
I am getting this error when using the trying to use the mail function. Any insite will help, I have been up for too long working on a few projects and my brain is damn near melted. mail() is not supported in this PHP build in so when I built PHP 4.06 I am assuming I missed a option, but just want to make sure before i head back and re-do things. Is there a simple option to turn on the mail support. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Credit card number checker?
What companies issue card numbers that are not 16 numbers? Are they non-US cards? I haven't ever seen a card that wasn't 16 numbers. A valid VISA card has between 13-16 digits. I believe AMERICAN EXPRESS only has 15 digits. -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- On Mon, 16 Jul 2001, Christopher Ostmo wrote: Ashley M. Kirchner pressed the little lettered thingies in this order... Christopher Ostmo wrote: By law, the numbers are supposed to be generated at random and not generated by any kind of algorithm or formula. CC# must pass the Luhn MOD 10 formula, so the generated numbers can't be (totally) random - they have to conform to the formula. I just responded to this separately... Basically, my earlier research on the issue must have been wrong. Also, not all credit cards have 16 numbers. Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com Innovative Application Ideas Meeting cutting edge dynamic web site needs since the dawn of Internet time (1995) For a good time, http://www.AppIdeas.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mail() help
as afr as i know it's a recompile with a path to sendmail ... great when it works though ! Steve Patrick W. Rateliff [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am getting this error when using the trying to use the mail function. Any insite will help, I have been up for too long working on a few projects and my brain is damn near melted. mail() is not supported in this PHP build in so when I built PHP 4.06 I am assuming I missed a option, but just want to make sure before i head back and re-do things. Is there a simple option to turn on the mail support. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] LDAP question PLEASE help me.
People! I am getting nuts here about this thing i am working on right now. I am trying to get make a ldap php script that get information about a user. I can connect to the ldap server and get response on how many entries that was found. But how do i print out something of use. I mean. How do i get all the information from the entrie? I mean i do a ldap search and get the answer from my script that 1 entrie was found. Now i want to print out that entry. his email first name, last name department etc etc But how do i do that? I am getting nuts. If you dont know it perhaps you know a GOOD how to that i can use? Please help me with this. Would be really usefull. This script works and returns the amount of entries. Now i want to display the information. echo h3LDAP query test/h3; echo Connecting ...; $ds=ldap_connect(localhost); // must be a valid LDAP server! echo connect result is .$ds.p; if ($ds) { echo Binding ...; $r=ldap_bind($ds); // this is an anonymous bind, typically // read-only access echo Bind result is .$r.p; echo Searching for (sn=S*) ...; // Search surname entry $sr=ldap_search($ds,o=My Company, c=US, sn=S*); echo Search result is .$sr.p; //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] running php scripts
hi, I was wondering if someone could help me with a small problem I'm having. I'm running a script that periodically dumps information from one server to a database on another. We're running suse 7.1 and apache on the server containing the information, and the problem is I don't know how to make linux run the php script, or how to set up crobtab with the php script in mind. anyone have any ideas? -petur -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] LDAP question PLEASE help me.
Use ldap_get_entries. See here: http://www.php.net/manual/en/function.ldap-get-entries.php Check the bottom of your code, I put something in there. On Tuesday 17 July 2001 07:27 am, Johan Vikerskog (ECS) wrote: People! echo h3LDAP query test/h3; echo Connecting ...; $ds=ldap_connect(localhost); // must be a valid LDAP server! echo connect result is .$ds.p; if ($ds) { echo Binding ...; $r=ldap_bind($ds); // this is an anonymous bind, typically // read-only access echo Bind result is .$r.p; echo Searching for (sn=S*) ...; // Search surname entry $sr=ldap_search($ds,o=My Company, c=US, sn=S*); echo Search result is .$sr.p; $result = ldap_get_entries($ds, $sr); print_r($result); // Let's just see what's in there. Hope that helps. Reuben D. Budiardja //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] running php scripts
We're running suse 7.1 and apache on the server containing the information, and the problem is I don't know how to make linux run the php script, or how to set up crobtab with the php script in mind. anyone have any ideas? You can use this Tutorial http://www.faqts.com/knowledge_base/view.phtml/aid/1005 I think it can help you :o) If your problem was how to execute the script you can etc. use Lynx (or wget)... if you use lynx use follow /path-to-lynx/lynx http://www.domain.com/scriptname.php -source Regards Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] echo vs printf
whereas to echo it you'd have to concatenate the string. false you don't have to concat strings with echo you can print vars the same way as print regards 16/07/01 17:48:43, Steve Brett [EMAIL PROTECTED] wrote: i seem to remember reading somewhere that print acts like (is) a function, presumably returning false if it cannot print to screen, whereas echo just dumps it. also you can drop vars in print like print you have $points points; whereas to echo it you'd have to concatenate the string. Steve Don Read [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On 16-Jul-01 brother wrote: Why should I use printf instead of echo and vice versa? printf print-formated $a=12.3456; echo $a, 'BR'; printf('%1.2fBR', $a); 12.3456BR 12.34BR As for today I use printf mostly but I don't know why. You prolly mean print; There may be some minor differences from echo, but i've never seen 'em. (i think they threw print in PHP to keep JAPHs happy). Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Problem about PHP
-Original Message- From: ChengWen_Yu [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 10:54 PM To: [EMAIL PROTECTED] Subject: [PHP] Problem about PHP I want to write a library for the PHP on Solaris. But I don't know how to do and where I should put this library than PHP could reach it. That's going to depend on what you mean by a library: If you want to write some functions in PHP and make them available to other scripts, then it's just a matter of placing that file somewhere in your include_path and calling it into your other scripts with include(), require(), auto_prepend_file, etc. You can find some information in the manual on defining functions in PHP at http://php.net/manual/en/functions.php If you want to actually extend the capabilities of PHP by adding new functions to the language, you'll want to start by reading README.EXT_SKEL in the directory where PHP is installed. That should, I think, give you most of the information you need to get started. --- Mark Roedel ([EMAIL PROTECTED]) | There cannot be a crisis next week. Systems Programmer / WebMaster | My schedule is already full. LeTourneau University | -- Henry Kissinger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] error on mail.....cjk
hello all. i configured my php 4.0.5 with the following command on a REDHAT linux 7.0. #./configure --with-apache=../apache_1.3.20 --with-mysql --enable-trackvar --with-ftp. Now i am trying to install/configure a NEWSLETTER php program and i have the following message : Warning: mail() is not supported in this PHP build in /usr/local/htdocs/test/newsletter/phpmynewsletter/include/cls.php3 on line 141 I want to point out that in this SERVER i have the following programs: php 4.0.5 qmail vmailmgr courier-imap apache 1.3.20 and in another server i have the following programs and i have no error with the same commands when i installed it: php 4.0.2 sendmail cyrus-imap apache 1.3.17 Sincerely _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Get filename in php command line
Hello, How do I get the filename or script name if I run it in php comamnd line? For example, if I run this bash$ php test.php I want to get something inside test.php that tells me the filename is test.php, but *without* the actual path. Thanks Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] regexp. king needed (is it possible ???)
? $s = 'somthing opentag1 .any content in between .. closetag1 somthing else'; $opentag = 'opentag1'; $closetag = 'closetag1'; $other_content = 'the other content'; $content = ereg_replace(.*$opentag, '', ereg_replace($closetag.*, '', $s)); $new_str = ereg_replace($opentag.*$closetag, $opentag $other_content $closetag, $s); // $content = ' .any content in between .. '; // $new_str = 'somthing opentag1 the other content closetag1 somthing else' ? $content = '?=$content?';br $new_str = '?=$new_str?' -Original Message- From: Jeroen Olthof [mailto:[EMAIL PROTECTED]] Sent: 17 iulie 2001 17:38 To: [EMAIL PROTECTED] Subject: [PHP] regexp. king needed (is it possible ???) ereg_replace($opentag([^*]*)$closetag, $this-OPENTAG.$loopHandle.$this-CLOSETAG, $template); how do I get al hold on the \\1 part of the replacement. basicly I want to replace opentag1 .any content in between .. closetag1 with opentag2 onewordonly closetag2 but still need the .any content in between .. is this possible in some way ??? kind regards Jeroen Olthof -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] running php scripts
thanx for the help man, the script is running and I get to keep my job ,) -petur Johan Holst Nielsen To: [EMAIL PROTECTED] johan@1way2pr cc: int.net Subject: Re: [PHP] running php scripts 17.07.2001 13:17 We're running suse 7.1 and apache on the server containing the information, and the problem is I don't know how to make linux run the php script, or how to set up crobtab with the php script in mind. anyone have any ideas? You can use this Tutorial http://www.faqts.com/knowledge_base/view.phtml/aid/1005 I think it can help you :o) If your problem was how to execute the script you can etc. use Lynx (or wget)... if you use lynx use follow /path-to-lynx/lynx http://www.domain.com/scriptname.php -source Regards Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Output (Urgent!)
You aren't getting the value to the PHP script... allow me to walk through what is actually happening $resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; echo --.$resolution.--; You have just set a variable to SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT and then echoed that string. so it looks like you have --1024-- or whatever your resolution is. if you view source though you see you really have --SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT-- and the client browser is just interpreting that JavaScript statement if (($resolution*1) = 1024) { $resolution = 1024; } else { $resolution = 800; } echo **.$resolution.**; The reason this isn't acting the way you expect is because you AREN'T saying if ((1024*1) = 1024 { You are actually saying if ((SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT*1) = 1024) { You are not actually passing anything from JavaScript to PHP... you are just tricking yourself =) Sheridan - Original Message - From: Morten Winkler Jørgensen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 4:54 AM Subject: Re: [PHP] Output (Urgent!) How you want to get a value from client side to php on the same page? Well. Actually I didn't invent the code. I just correcteded it so it worked on my installation. I must admit I was amazed that it somehow worked, but it did. Kind regards, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] regexp. king needed (is it possible ???)
thanks my king :) it works !!! Adrian Ciutureanu [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ? $s = 'somthing opentag1 .any content in between . closetag1 somthing else'; $opentag = 'opentag1'; $closetag = 'closetag1'; $other_content = 'the other content'; $content = ereg_replace(.*$opentag, '', ereg_replace($closetag.*, '', $s)); $new_str = ereg_replace($opentag.*$closetag, $opentag $other_content $closetag, $s); // $content = ' .any content in between .. '; // $new_str = 'somthing opentag1 the other content closetag1 somthing else' ? $content = '?=$content?';br $new_str = '?=$new_str?' -Original Message- From: Jeroen Olthof [mailto:[EMAIL PROTECTED]] Sent: 17 iulie 2001 17:38 To: [EMAIL PROTECTED] Subject: [PHP] regexp. king needed (is it possible ???) ereg_replace($opentag([^*]*)$closetag, $this-OPENTAG.$loopHandle.$this-CLOSETAG, $template); how do I get al hold on the \\1 part of the replacement. basicly I want to replace opentag1 .any content in between .. closetag1 with opentag2 onewordonly closetag2 but still need the .any content in between .. is this possible in some way ??? kind regards Jeroen Olthof -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Need help. LDAP
In the ldap script below i get the results when i use the decide function at the bottom. Anyone have a tip on how i can change this so i can push the results into variables instead? Thanks in advance //Johan ?php function printarray ($what, $display, $info, $i) { for ($j=0; $j (count($info[$i][$what]) -1); $j++) { $show = ereg_replace(\\$, BR, $info[$i][$what][$j]); echo $display: . $show . br; } } function decide ($what, $display, $info, $i) { if (gettype($info[$i][$what]) == array) { printarray($what, $display, $info, $i); } else { echo $display: . $info[$i][$what] . br; } } echo h3LDAP query test/h3; echo Connecting ...; $ds=ldap_connect(server); $dn = o=Name, c=SV; $filter=(|(uid=$user)); $justthese = array( ou, sn, givenname, mail , cn, department, uid); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); print $info[count]. entries returnedp; for ($i=0; $i$info[count]; $i++) { decide(cn, I am, $info, $i); decide(mail, Email address, $info, $i); decide(uid, Signum, $info, $i); decide(department, Avdelning, $info, $i); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] note to PHP developers
I have noticed on the list over the past two months, an increasing number of problems with the mail() function. Mostly, people having this problem don't have sendmail installed. It would seem that PHP's mail() function was written around sendmail. Is there a way to resolve this, with either configuration flags or by re-writing the mail() function install to look for alternative MTAs??? Just thought I would point it out. My solution: - OS RH 7.1 w/Sendmail install - installed PHP 4.x - removed Sendmail - installed Qmail - changed php.ini path - qmail path --- Michael Geier CDM Sports, Inc. - Systems Administrator email: [EMAIL PROTECTED] phone: 314.991.1511 x 6505 pager: 314.318.9414 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] wordwrap()
Maybe I'm not using it right, but I'm using the sample in the manual. Here's the code: ? $text = A very long wrd.; $newtext = wordwrap( $text, 8, \n, 1); echo $newtext\n; ? Here's the output: A very long wooo ord. Here's what the manual says the output should be: A very long wooo ord. Has anyone else had troubles with the wordwrap() function? Do I need to compile php with another flag to get this to work properly? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] note to PHP developers
On a side note, qmail has a wrapper that pretends to be sendmail. You can overwrite the /bin/mail with it and it will behave and accept mail just like sendmail, but send it through qmail-smtp. Nathan Cook [EMAIL PROTECTED] - Original Message - From: Michael Geier, CDM Systems Admin [EMAIL PROTECTED] To: PHP Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 9:20 AM Subject: [PHP] note to PHP developers I have noticed on the list over the past two months, an increasing number of problems with the mail() function. Mostly, people having this problem don't have sendmail installed. It would seem that PHP's mail() function was written around sendmail. Is there a way to resolve this, with either configuration flags or by re-writing the mail() function install to look for alternative MTAs??? Just thought I would point it out. My solution: - OS RH 7.1 w/Sendmail install - installed PHP 4.x - removed Sendmail - installed Qmail - changed php.ini path - qmail path --- Michael Geier CDM Sports, Inc. - Systems Administrator email: [EMAIL PROTECTED] phone: 314.991.1511 x 6505 pager: 314.318.9414 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get filename in php command line
$PHP_SELF returns the filename with the full path. from there, you can use split to split the string wherever a / occurs, then call count, to get the total number of values in the array, decrememnt the count by 1 (Arrays begin at 0) then, set a variable to store just the filename, like so: $fullpath = split('/',$PHP_SELF); $c = count($fullpath); $c--; $filename = $fullpath[$c]; There may be a better way to do it, but this works for me, and it's only 4 lines. :) JB - Original Message - From: Reuben D Budiardja [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 7:48 AM Subject: [PHP] Get filename in php command line Hello, How do I get the filename or script name if I run it in php comamnd line? For example, if I run this bash$ php test.php I want to get something inside test.php that tells me the filename is test.php, but *without* the actual path. Thanks Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] wordwrap()
i know this is a silly question, but you're not looking at it thru a web browser, are you? browsers are for HTML and markup code. the output on my computer is the same as the manual output: A very long wooo ord. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Subject: [PHP] wordwrap() Maybe I'm not using it right, but I'm using the sample in the manual. Here's the code: ? $text = A very long wrd.; $newtext = wordwrap( $text, 8, \n, 1); echo $newtext\n; ? Here's the output: A very long wooo ord. Here's what the manual says the output should be: A very long wooo ord. Has anyone else had troubles with the wordwrap() function? Do I need to compile php with another flag to get this to work properly? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Storing image/documents in database vs. filesystem
What's the pros and cons for storing uploaded images or documents (.doc, .pdf) in a database versus something like http://www.company.com/files/pic.jpg? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] wordwrap()
Well, that was easy. I never even thought to change the \n to br. Thanks for helping me over my mental block... Tyler - Original Message - From: scott [gts] [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 10:25 AM Subject: RE: [PHP] wordwrap() i know this is a silly question, but you're not looking at it thru a web browser, are you? browsers are for HTML and markup code. the output on my computer is the same as the manual output: A very long wooo ord. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Subject: [PHP] wordwrap() Maybe I'm not using it right, but I'm using the sample in the manual. Here's the code: ? $text = A very long wrd.; $newtext = wordwrap( $text, 8, \n, 1); echo $newtext\n; ? Here's the output: A very long wooo ord. Here's what the manual says the output should be: A very long wooo ord. Has anyone else had troubles with the wordwrap() function? Do I need to compile php with another flag to get this to work properly? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: wordwrap()
[EMAIL PROTECTED] (Tyler Longren) wrote: Maybe I'm not using it right, but I'm using the sample in the manual. Here's the code: ? $text = A very long wrd.; $newtext = wordwrap( $text, 8, \n, 1); echo $newtext\n; ? you should use $newtext = wordwrap( $text, 8, br, 1); instead of $newtext = wordwrap( $text, 8, \n, 1); because \n is not visiable printed in a browser but br is -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get filename in php command line
Seems that $PHP_SELF is not defined when it's run from the command line. Reuben D. Budiardja On Tuesday 17 July 2001 10:29 am, Jason Bell wrote: $PHP_SELF returns the filename with the full path. from there, you can use split to split the string wherever a / occurs, then call count, to get the total number of values in the array, decrememnt the count by 1 (Arrays begin at 0) then, set a variable to store just the filename, like so: $fullpath = split('/',$PHP_SELF); $c = count($fullpath); $c--; $filename = $fullpath[$c]; There may be a better way to do it, but this works for me, and it's only 4 lines. :) JB - Original Message - From: Reuben D Budiardja [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 7:48 AM Subject: [PHP] Get filename in php command line Hello, How do I get the filename or script name if I run it in php comamnd line? For example, if I run this bash$ php test.php I want to get something inside test.php that tells me the filename is test.php, but *without* the actual path. Thanks Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Get filename in php command line
Seems that $PHP_SELF is not defined when it's run from the command line. Try: __FILE__ Chris
[PHP] Getting the current URL (with arguments) as a variable, then removing another variable from that ?
Is there a way that I can get the current URL, like myfile.php?sub=web?page=web1 And then remove the ?sub=web from it, even if the value of ?sub is different ? Someone said something about $PHP_SELF but I dont know where to go from there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting the current URL (with arguments) as a variable, then removing another variable from that ?
myfile.php?sub=webpage=web1 shouldn't it be?!!?!? - Original Message - From: Justin Colson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 18, 2001 1:51 AM Subject: [PHP] Getting the current URL (with arguments) as a variable, then removing another variable from that ? Is there a way that I can get the current URL, like myfile.php?sub=web?page=web1 And then remove the ?sub=web from it, even if the value of ?sub is different ? Someone said something about $PHP_SELF but I dont know where to go from there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get filename in php command line
I had that before. OK, seems that my problem is not that simple. The thing is , I have something like this in my file test.php: require('my_api.inc'); echo This is test.php3; Now, in my_api.inc, I want to know that I run test.php3, when I do bash$ php test.php3 and the filename is test.php3 . __FILE__ will give my my_api.inc instead. I need it because my_api.inc do all sort of authenticating, session, etc. Any solutions? Thanks. Reuben D. Budiardja On Tuesday 17 July 2001 10:52 am, Boget, Chris wrote: Seems that $PHP_SELF is not defined when it's run from the command line. Try: __FILE__ Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Get filename in php command line
I had that before. OK, seems that my problem is not that simple. The thing is , I have something like this in my file test.php: require('my_api.inc'); echo This is test.php3; Now, in my_api.inc, I want to know that I run test.php3, when I do bash$ php test.php3 and the filename is test.php3 . __FILE__ will give my my_api.inc instead. I need it because my_api.inc do all sort of authenticating, session, etc. __FILE__ will give you the name of the file that uses that constant. So, based on the above, I believe that you are using __FILE__ only in my_api.inc (which is pretty much what you said, I'm just looking for verification). What you can do instead is this: in my_api.inc, have the following code: echo Currently Running file is: ; echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__; in test.php ? $CurrentRunningFile = __FILE__; include( my_api.inc ); echo This is test.php3br\n; ? Define $CurrentRunningFile on line one of all your files. Or something along those lines... Chris
Re: [PHP] note to PHP developers
Hi Michael! On Tue, 17 Jul 2001, Michael Geier, CDM Systems Admin wrote: I have noticed on the list over the past two months, an increasing number of problems with the mail() function. Mostly, people having this problem don't have sendmail installed. It would seem that PHP's mail() function was written around sendmail. Is there a way to resolve this, with either configuration flags or by re-writing the mail() function install to look for alternative MTAs??? Install FreeBSD it has mailwrapper ;) -- teodor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] md5 crypt question
I'd like to use php to do what I'm able to do in perl. use String::Random; use Crypt::PasswdMD5; $foo = new String::Random; $rand = $foo-randpattern(ss); print Type in your password: ; $password = STDIN; $hash = unix_md5_crypt($password,$rand); $salt = substr($hash,3,2); print SUBSTR: $salt\n; print HASH: $hash\n; print SALT: $rand\n; print Type in your password: ; $password_verify = STDIN; $hash_verify = unix_md5_crypt($password_verify,$salt); if ($hash eq $hash_verify) { print Good to go!\n; print HASH BEFORE: $hash\n; print HASH AFTER: $hash_verify\n; } else { print You fuckered it up!\n; print HASH BEFORE: $hash\n; print HASH AFTER: $hash_verify\n; } srv1:~$ ./crypt.pl Type in your password: password SUBSTR: Kd HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0 SALT: Kd Type in your password: password Good to go! HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0 HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0 I've looked at crypt() in php and it claims that if you pass it a salt that resembles $1$ format, it should generate an md5 type hash, but this doesn't seem to be the case for me. The crypt only looks at the first two characters of the salt, no matter what, so my salt never changes because it just seems $1. Thanks for explaining what I'm doing wrong. -jeremy -- salad. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] How to add a new color to JPEG
I don't know a way around the problem you're describing with your version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call ImageCreateTrueColor(), which eliminates the 256-color limitation with JPEG files-- solved my problem right away. -Original Message- From: Jennifer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 5:55 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to add a new color to JPEG -Original Message- From: SED [mailto:[EMAIL PROTECTED]] According to the manual, you can only get closest value of your desired color by letting the ImageColorClosest() find it. Therefore, if the image is totally black, you can not get the yellow color. I have not found a way to do this though I believe I have tried everything. And yet, I have not found any documents covering this other than PHP-manual. I didn't get this from reading the manual, but I struggled with this problem for days and finally gave up. I posted to some other forums when this one was done and found no answers. Now, I know it isn't just me and I know what the problem is, but I still don't know a solution. I am creating an image on the fly and I have no problem if I am just using a background color and adding text to it or if I use ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text on top of that or even a rectangle or anything on top, it seems to ignore the color that I specify and always came out grey. (Of course now if I use ImageColorClosest(), some colors work because they are in my image.) It doesn't matter what I output it as, only what I read it in as. And if I read it in as a png, the image quality is horrible which I also don't understand. It seems to have drastically reduced the number of colors used. My phphinfo says GD version 1.6.2 or higher I'm using PHP Version 4.0.1pl2 Here is my test page. http://216.122.251.174/test/test.php Here is the source for the graphic http://216.122.251.174/test/button.phps Any idea on how solutions? Jennifer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: wordwrap()
Hey Ty, I had the same problem. I read somewhere that you can use \r\n instead. \r returns home and \n adds a new line! It works fine here! Rehuël Tyler Longren [EMAIL PROTECTED] wrote in message 00aa01c10ed3$a3253ee0$[EMAIL PROTECTED]">news:00aa01c10ed3$a3253ee0$[EMAIL PROTECTED]... Maybe I'm not using it right, but I'm using the sample in the manual. Here's the code: ? $text = A very long wrd.; $newtext = wordwrap( $text, 8, \n, 1); echo $newtext\n; ? Here's the output: A very long wooo ord. Here's what the manual says the output should be: A very long wooo ord. Has anyone else had troubles with the wordwrap() function? Do I need to compile php with another flag to get this to work properly? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to add a new color to JPEG
has this problem check the annoted manual on php.net. i believe there is a work arround posted on imagecolorallocate() and i reposted the same thing under imagecreatefromjpeg. basically you create and image, allocate colors, and then copy your jpeg on it. Thank You, Jon Yaggie www.design-monster.com And they were singing . . . '100 little bugs in the code 100 bugs in the code fix one bug, compile it again 101 little bugs in the code 101 little bugs in the code . . .' And it continued until they reached 0 - Original Message - From: Matthew Loff [EMAIL PROTECTED] To: 'Jennifer' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, July 18, 2001 12:01 AM Subject: RE: [PHP] How to add a new color to JPEG I don't know a way around the problem you're describing with your version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call ImageCreateTrueColor(), which eliminates the 256-color limitation with JPEG files-- solved my problem right away. -Original Message- From: Jennifer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 5:55 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to add a new color to JPEG -Original Message- From: SED [mailto:[EMAIL PROTECTED]] According to the manual, you can only get closest value of your desired color by letting the ImageColorClosest() find it. Therefore, if the image is totally black, you can not get the yellow color. I have not found a way to do this though I believe I have tried everything. And yet, I have not found any documents covering this other than PHP-manual. I didn't get this from reading the manual, but I struggled with this problem for days and finally gave up. I posted to some other forums when this one was done and found no answers. Now, I know it isn't just me and I know what the problem is, but I still don't know a solution. I am creating an image on the fly and I have no problem if I am just using a background color and adding text to it or if I use ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text on top of that or even a rectangle or anything on top, it seems to ignore the color that I specify and always came out grey. (Of course now if I use ImageColorClosest(), some colors work because they are in my image.) It doesn't matter what I output it as, only what I read it in as. And if I read it in as a png, the image quality is horrible which I also don't understand. It seems to have drastically reduced the number of colors used. My phphinfo says GD version 1.6.2 or higher I'm using PHP Version 4.0.1pl2 Here is my test page. http://216.122.251.174/test/test.php Here is the source for the graphic http://216.122.251.174/test/button.phps Any idea on how solutions? Jennifer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Code running function
I know there's a function that takes a string argument and runs it as PHP code. i.e. function_name('echo $variable;'); I just can't remember what it is. Does any know? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: wordwrap()
[EMAIL PROTECTED] (Rehuel Lobato De Mesquita) wrote: Hey Ty, I had the same problem. I read somewhere that you can use \r\n instead. \r it's windows that uses \r\n so if you run your scripts on a windows machine it might be a good idea to split on them too. -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Code running function
eval(); ? -- Julio Nobrega. Because happiness is a warm gun Bang-bang shoot-shoot B R [EMAIL PROTECTED] wrote in message 005501c10ee3$e82b4740$c6655ad1@Test4">news:005501c10ee3$e82b4740$c6655ad1@Test4... I know there's a function that takes a string argument and runs it as PHP code. i.e. function_name('echo $variable;'); I just can't remember what it is. Does any know? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] library GD
I installed Apache 1.3 for windows and php4 (Easywindows). I take a sample of functions GD, but when the program execute don't appear nothing. What's the problem? Thanks Luiz Fernnado -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ldap
Previously, Johan Vikerskog (ECS) said: How do i list the email for that entry? Ill get one answer from this, now i want to print out the email adress for that entry. How do i do that? $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); print $info[count]. entries returnedp; This should do what you want; just stick it at the end of the code you already had in this email. for ($i = 0; $i $info['count']; $i++) { print $info[$i]['mail'][0] . 'br'; } That's assuming there is always only one value for mail in a given entry. -dan -- The main reason Santa is so jolly is because he knows where all the bad girls live. -George Carlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Send array from php to dll make in vb 6
I make a dll in Vb6 and it have a funcition that have a variable of type VARIANT like parameter. In the program php I call this dll and your method and send a array make in php. Occurs a error : Invoke Failed : Occured a exception, but if I pass a variable of type integer or string to other method of dll, it's OK. Thanks Luiz Fernando -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passing variables from forms to the same page repetatively
Yeah, I had thought about using hidden inputs, but hidden inputs are not really hidden. They still exist on the HTML page, and although not visible in the browser, are visible in the code. This may not be cool if you have sensitive information that is passed, also if you have a lot of variables to pass, thats just a lot of hidden inputs to pass. Is there no other way to accomplish this? No built in function? I guess it makes sense that there is not, b/c the form submits the form and only the form variables. Thanks. -Tim Original Message Follows From: David Robley [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Tim Olsen [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] passing variables from forms to the same page repetatively Date: Tue, 17 Jul 2001 16:13:41 +0930 On Tue, 17 Jul 2001 15:41, Tim Olsen wrote: People, I have 4 forms in four seperate html pages included directly (no links to includes) in the same .php file, i have it so all the form actions is php.self, so when each form is submitted it goes on to display the next form in line, using if and else statements, of course. I want to be able to use variables created by the first form in the html part of the last form. What is the best way to do this? So far, I can only use variables on the next page (form) that is written out. After that those variables have no value. Is there some way to submit all variables present and assigned with the submission of each form? If I make the forms a seperate include file, instead of having them in-line, how does this change the ways variables are passed or submitted by each form? Thanks, - Tim _ If I understand what you are saying: those variables don't exist until you SUBMIT the form. You can demonstrate this by looping through and displaying your POST or GET vars at the beginning of the form and see what happens when you first open the page, and when it calls itself. And re-reading, I think what you may want is hidden fields. You want part one to call part 2, and retain values from part 1, etc? Echo the values into hidden fields in each step of the process. INPUT TYPE=hidden NAME=whatever VALUE=?php echo $whatever ? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I always lie. In fact, I'm lying to you right now! _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] GEt Command
Does anyone have a simple script that will GET a web page and return the reply? Something like this: function getpage($host, $path, getstr) {$getstr="whatever\r\n"; $host=www.whatever.com; $hdr=sprintf("GET $getstr", $path); $hdr .="Content-type: application/x-www-form-urlencoded\r\n"; $hdr .="Accept: text/html\r\nAccept: text/plain\r\n"; $hdr .="User-Agent: Mozilla/1.0\r\n\r\n"; $fp = fsockopen($host , 80, $errno, $errstr, 45); if (!$fp) { echo "$host open error: $errstr $errno .\n"; return(0); } else { fputs($fp,$hdr.$poststr); return($fp); }} while (!feof($fp)) { $buff=fgets($fp, 1024); //dofoo($buff); echo "$buff";}fclose($fp); TIA! Clayton DukesCCNA, CCDA, CCDP, CCNP(c) 904.477.7825(h) 904.292.1881Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] GEt Command
$site = fopen( http://www.whatever.com/ http://www.whatever.com/, r); $contents = fread($site, 102400); fclose($site); -Original Message- From: Clayton Dukes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 2:08 PM To: [EMAIL PROTECTED] Subject: [PHP] GEt Command Does anyone have a simple script that will GET a web page and return the reply? Something like this: function getpage($host, $path, getstr) { $getstr=whatever\r\n; $host=www.whatever.com; $hdr=sprintf(GET $getstr, $path); $hdr .=Content-type: application/x-www-form-urlencoded\r\n; $hdr .=Accept: text/html\r\nAccept: text/plain\r\n; $hdr .=User-Agent: Mozilla/1.0\r\n\r\n; $fp = fsockopen($host , 80, $errno, $errstr, 45); if (!$fp) { echo $host open error: $errstr $errno .\n; return(0); } else { fputs($fp,$hdr.$poststr); return($fp); } } while (!feof($fp)) { $buff=fgets($fp, 1024); //dofoo($buff); echo $buff; } fclose($fp); TIA! Clayton Dukes CCNA, CCDA, CCDP, CCNP (c) 904.477.7825 (h) 904.292.1881 Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net
Re: [PHP] passing variables from forms to the same page repetatively
There are a thousand ways to pass data... some are just more kludgy than others =) In addition to using hidden fields You could put the data into a Database You could Write it to a file You could put it in a cookie You could use sessions etc, etc, ad nauseam Two things to point out, however. The first is that using Hidden fields is not really frowned down upon (at least not by anyone I know) and will probably lead to the least convoluted code. The second is that anything passed in a form (unless you are using SSL or something) is already insecure. If you have truly sensitive information you need to be looking into encryption, if not then why sweat the hidden fields? Sheridan - Original Message - From: Tim Olsen [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 1:07 PM Subject: Re: [PHP] passing variables from forms to the same page repetatively Yeah, I had thought about using hidden inputs, but hidden inputs are not really hidden. They still exist on the HTML page, and although not visible in the browser, are visible in the code. This may not be cool if you have sensitive information that is passed, also if you have a lot of variables to pass, thats just a lot of hidden inputs to pass. Is there no other way to accomplish this? No built in function? I guess it makes sense that there is not, b/c the form submits the form and only the form variables. Thanks. -Tim Original Message Follows From: David Robley [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Tim Olsen [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] passing variables from forms to the same page repetatively Date: Tue, 17 Jul 2001 16:13:41 +0930 On Tue, 17 Jul 2001 15:41, Tim Olsen wrote: People, I have 4 forms in four seperate html pages included directly (no links to includes) in the same .php file, i have it so all the form actions is php.self, so when each form is submitted it goes on to display the next form in line, using if and else statements, of course. I want to be able to use variables created by the first form in the html part of the last form. What is the best way to do this? So far, I can only use variables on the next page (form) that is written out. After that those variables have no value. Is there some way to submit all variables present and assigned with the submission of each form? If I make the forms a seperate include file, instead of having them in-line, how does this change the ways variables are passed or submitted by each form? Thanks, - Tim _ If I understand what you are saying: those variables don't exist until you SUBMIT the form. You can demonstrate this by looping through and displaying your POST or GET vars at the beginning of the form and see what happens when you first open the page, and when it calls itself. And re-reading, I think what you may want is hidden fields. You want part one to call part 2, and retain values from part 1, etc? Echo the values into hidden fields in each step of the process. INPUT TYPE=hidden NAME=whatever VALUE=?php echo $whatever ? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I always lie. In fact, I'm lying to you right now! _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GET Command
MessageHi, Here's what I'm trying to do: I want to test an IIS server for an invulnerability. This is done by sending a GET command to test for it. Here's a blurb from the security advisory that I am working with: ---snip--- A scan is performed over some region of the Internet, searching for web servers accepting TCP connections on port 80. A specially formed HTTP GET request is then sent over the accepted connection to the server: GET /scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+dir+c:\ ---snip--- How can I do a simple page where, the user inputs the url (www.whatever.com) And it runs this test, telling the user if it passes or fails, and returns the output? Btw, the security advisory comes from http://grc.com/dos/grcdos.htm which outlines some very interesting things happening with IRC based DoS attacks, in case your interested. Thanks! Clayton Dukes CCNA, CCDA, CCDP, CCNP (c) 904.477.7825 (h) 904.292.1881 Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net - Original Message - From: Matthew Loff To: 'Clayton Dukes' ; [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 2:11 PM Subject: RE: [PHP] GEt Command $site = fopen(http://www.whatever.com/, r); $contents = fread($site, 102400); fclose($site); -Original Message- From: Clayton Dukes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 2:08 PM To: [EMAIL PROTECTED] Subject: [PHP] GEt Command Does anyone have a simple script that will GET a web page and return the reply? Something like this: function getpage($host, $path, getstr) { $getstr=whatever\r\n; $host=www.whatever.com; $hdr=sprintf(GET $getstr, $path); $hdr .=Content-type: application/x-www-form-urlencoded\r\n; $hdr .=Accept: text/html\r\nAccept: text/plain\r\n; $hdr .=User-Agent: Mozilla/1.0\r\n\r\n; $fp = fsockopen($host , 80, $errno, $errstr, 45); if (!$fp) { echo $host open error: $errstr $errno .\n; return(0); } else { fputs($fp,$hdr.$poststr); return($fp); } } while (!feof($fp)) { $buff=fgets($fp, 1024); //dofoo($buff); echo $buff; } fclose($fp); TIA! Clayton Dukes CCNA, CCDA, CCDP, CCNP (c) 904.477.7825 (h) 904.292.1881 Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] 50 SEX Sites in ONE Affiliate Portal.................
Ask yourself these questions: Would a few thousand dollars extra each month make a difference? Can you spare a few hours each week to earn the extra dollars? If the answer is yes to these simple questions, and you have a PC with Internet access, then you can get involved with the 40 BILLION Dollar Adult Entertainment Industry. *** FREE Hosted Web Site *** *** FREE Help Promotional programs *** In fact - ALL you will EVER need to get involved in this business at the HIGHEST level IMMEDIATELY. For more information click on the following link: mailto: [EMAIL PROTECTED]?subject=More_Info If you do not wish to receive further mailings, please do NOT reply to this message. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Data from SQL to a string in a useable format
How can I pull my data from my SQL db, and store it as a string so that it can be used? Specificly, I'm working with images. When the images are stored in the database, the only pre-processing that is done is: $img = addslashes(fread(fopen($userfile, r), filesize($userfile))); (* note: $userfile is the file identifier from my upload form.) I want to pull the data out of the database and store it in a string, so that I can use imagecopyresampled to create a thumbnail, but I just can't seem to get it to work please help!! Thanks, Jason
[PHP] EO - New FREE web development engine
Hello, I'm contacting you because we have recently released a new web development platform, EO, that I would like for you to try out for use in building dynamic sites. EO is a portable, flexible yet robust system that you can use to quickly build interactive sites, plus it has features that protect you, the web developer. The Engine behind EO has been in development since 1996 and has been used to build simple to complex systems in many industries including retail, automotive, financial, marine and more. BEST OF ALL IT'S FREE! Please visit http://www.eodeveloper.com/eo/eo.exe/eofree?01 to find out more and download your FREE copy. Thank you! Team EO http://www.eodeveloper.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP- something i don't undestand
your query needs to be an actual query, such as a select statement... - Original Message - From: Yassel Omar Izquierdo Souchay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 1:28 PM Subject: [PHP] PHP- something i don't undestand Hi I'm having trouble with this part of code 9: $result = mysql_db_query(users, $query); 10: $r=mysql_fetch_array($result); The error message is : Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9. Please if somebody knows what it's wrong thanks Yassel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP- something tha i don't understand
8:$result = mysql_db_query(users, $query); 9:$r=mysql_fetch_array($result); 10: $count=$r[count]; And the error message is Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9 You need to validate that the query returned a value. Your query failed somewhere... Chris
[PHP] Cannot connect to db when running PHP as Cron
Hello, I have a php script that connect to database and retrieve something, or do something with the db. I can run the script from the command line, it works just fine. But when I run it as cron, it gives error cannot connect to the database. Here is the script looks like: ? // script name: ora_test.php $conn = ora_logon(username@db, password); $cur = ora_open($conn); if (ora_parse($cur, select something from table)) { ora_exec($cur); while(ora_fetch($cur)) { $something[] = ora_getcolumn($cur, 0); } print_r($something); $msg = ''; for ($i=0; $icount($something); $i++) $msg .= $something[$i] . ; mail (me@localhost, test, $msg); } ? Here is the crontab entry: */1 * * * * /usr/local/bin/php ora_test.php /tmp/cron_oralog The error message from cron_oralog files is: X-Powered-By: PHP/4.0.3pl1 Content-type: text/html Warning: Oracle: Connection Failed: Error while trying to retrieve text for error ORA-12154 in ora_test.php on line 3 Warning/b: Supplied argument is not a valid Oracle-Connection resource in bora_test.php/b on line b5/b br bWarning/b: Supplied argument is not a valid Oracle-Cursor resource in bora_test.php/b on line b7/bbr Any help on this would be greatly appreciated. Thanks. Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] 50 SEX Sites in ONE Affiliate Portal.................
Dolores pressed the little lettered thingies in this order... Ask yourself these questions: OK... Would a few thousand dollars extra each month make a difference? Yes! Can you spare a few hours each week to earn the extra dollars? Yes! If the answer is yes to these simple questions, and you have a PC with Internet access, then you can get involved with the 40 BILLION Dollar Adult Entertainment Industry. Ooooh. Adult entertainment! Like Casablanca and Schindler's List? *** FREE Hosted Web Site *** Free!?! Wow! What version of PHP? I assume that they offer PHP since they posted to this list. *** FREE Help Promotional programs *** In fact - ALL you will EVER need to get involved in this business at the HIGHEST level IMMEDIATELY. For more information click on the following link: mailto: [EMAIL PROTECTED]?subject=More_Info If you do not wish to receive further mailings, please do NOT reply to this message. But I do! I do! I LOVE Adult Entertainment. The Godfather and Shawshank Redemption are two of my favorite movies! Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com Innovative Application Ideas Meeting cutting edge dynamic web site needs since the dawn of Internet time (1995) Business Applications: http://www.AppIdeas.com/ Open Source Applications: http://open.AppIdeas.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get filename in php command line
On Tuesday 17 July 2001 11:14 am, Boget, Chris wrote: in my_api.inc, have the following code: echo Currently Running file is: ; echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__; in test.php ? $CurrentRunningFile = __FILE__; include( my_api.inc ); echo This is test.php3br\n; ? Define $CurrentRunningFile on line one of all your files. Or something along those lines... Chris Well, I thought about that too. The thing is, this is part of the bigger project to make our apps can be run from command line, and we already have tons of apps that currently running from web. Doing that for every single apps would be a pain. But apparently since there is no other way, at least at this point, it will have do for some apps. Thanks. Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php- something that i don't understand
Yassel Omar Izquierdo Souchay pressed the little lettered thingies in this order... Hey guys here is my code 4: mysql_connect() or die (Problemas conectandose a la base de datos); 5: $query=select * from info where FirstName='$FirstName' and 6: LastName='$LastName' and email='$email'; 7: $result = mysql_db_query(users, $query); *8: $r=mysql_fetch_array($result); 9: $count=$r[count]; and i follow redcieving this message Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 Change line 7 to this: $result = mysql_db_query(users, $query) or die(mysql_error()); What is the error after you do that? Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com Innovative Application Ideas Meeting cutting edge dynamic web site needs since the dawn of Internet time (1995) Business Applications: http://www.AppIdeas.com/ Open Source Applications: http://open.AppIdeas.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php- something that i don't understand
Pardon my ignorance if you can really do it this way (because I have never seen it done like this): In line 4, I wasn't aware that you could call mysql_connect() without any parameters. Can you? HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 [EMAIL PROTECTED] -Original Message- From: Yassel Omar Izquierdo Souchay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 4:38 PM To: [EMAIL PROTECTED] Subject:[PHP] php- something that i don't understand Hey guys here is my code 4: mysql_connect() or die (Problemas conectandose a la base de datos); 5: $query=select * from info where FirstName='$FirstName' and 6: LastName='$LastName' and email='$email'; 7: $result = mysql_db_query(users, $query); *8: $r=mysql_fetch_array($result); 9: $count=$r[count]; and i follow redcieving this message Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 thanks for your answers Yassel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fw: [PHP] php- something that i don't understand
Oops.. forgot to CC the group.. - Original Message - From: Jason Bell [EMAIL PROTECTED] To: Yassel Omar Izquierdo Souchay [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 12:42 PM Subject: Re: [PHP] php- something that i don't understand try this: mysql_connect(YOUR_DB_HOST,DB_USERNAME,DB_PASSWORD); mysql_select_db(DB); $query = select * from info where FirstName='$FirstName' and LastName='$LastName' and email='$email'; $result = mysql_query($query); - Original Message - From: Yassel Omar Izquierdo Souchay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 1:37 PM Subject: [PHP] php- something that i don't understand Hey guys here is my code 4: mysql_connect() or die (Problemas conectandose a la base de datos); 5: $query=select * from info where FirstName='$FirstName' and 6: LastName='$LastName' and email='$email'; 7: $result = mysql_db_query(users, $query); *8: $r=mysql_fetch_array($result); 9: $count=$r[count]; and i follow redcieving this message Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8 thanks for your answers Yassel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Need help with formatting time
try looking here: http://www.php.net/manual/en/function.mktime.php then here: http://www.php.net/manual/en/function.date.php -JB - Original Message - From: John Holcomb [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 12:53 PM Subject: [PHP] Need help with formatting time Hello and thank you. I'm trying to find a function(method) or existing code taht takes the number of minutes that have passed in a day and returns the time of the day. For example: 780 minutes == 1pm, 0 minutes == 12am, etc,etc. so I'm looking for code that when you enter the number of minutes, it returns the time of day. example: $some_time = foo(780); print($some_time); file://prints 1:00pm Thnaks again. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: echo vs printf
Steve Brett wrote: don't echo and printf do different jobs ? as i understand it echo will dump anything to screen, fprint will accept formatted text args like you owe me %d dollars,$owed_amount) or something like that. i kind of use print by itself (harking back to the old days of basic etc) but use echo quite a lot. only use printf when i have to put cash amounts in and stuff like that. Steve printf (); echo ; print (); They do the same but why? The question that drives us (nice quote!) is if we gain any speed to use one another or if it is too little to be measured. /brother (now cced to the list too =)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Need help with formatting time
John Holcomb pressed the little lettered thingies in this order... Hello and thank you. I'm trying to find a function(method) or existing code taht takes the number of minutes that have passed in a day and returns the time of the day. For example: 780 minutes == 1pm, 0 minutes == 12am, etc,etc. so I'm looking for code that when you enter the number of minutes, it returns the time of day. example: $some_time = foo(780); print($some_time); //prints 1:00pm Thnaks again. $minutes = 780; $some_time = date(g:i a,mktime(0,$minutes,0,01,01,2000)); echo $some_time; The combination of date() and mktime() can do just about anything with dates and times that you could ever possibly dream of doing (it can even do some nifty stuff with english ordinal suffixes that have nothing to do with dates or time). http://www.php.net/manual/en/function.date.php http://www.php.net/manual/en/function.mktime.php Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com Innovative Application Ideas Meeting cutting edge dynamic web site needs since the dawn of Internet time (1995) Business Applications: http://www.AppIdeas.com/ Open Source Applications: http://open.AppIdeas.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Need help with formatting time
That's rather simple: echo date(H:i:s,mktime(0,$minutes,0)); -Rasmus On Tue, 17 Jul 2001, John Holcomb wrote: Hello and thank you. I'm trying to find a function(method) or existing code taht takes the number of minutes that have passed in a day and returns the time of the day. For example: 780 minutes == 1pm, 0 minutes == 12am, etc,etc. so I'm looking for code that when you enter the number of minutes, it returns the time of day. example: $some_time = foo(780); print($some_time); //prints 1:00pm Thnaks again. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]