Re: [PHP] php as cron
You have global variables $argc (count of arguments) and $argv (array containing arguments given on command line) lenar. ""Joseph Tate"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Have you tried 'php '? Now, I don't know how you would pass > parameters to it... > > > -Original Message- > > From: Johan Holst Nielsen [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, June 21, 2001 8:09 AM > > To: AJDIN BRANDIC > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] php as cron > > > > > > try etc. > > > > 00,30 * * * * lynx -dump http://path.to.php.script > /dev/null > > > > Regards > > > > Johan > > > > > > > > Hi > > > > > > I have PHP installed as Apache module but I want to run a cron job. I > > > have .php script that works OK when executed through browser > > but is there > > > any way I could execute it through a cron job. > > > > > > Ajdin > > > > > > > > > -- > > > 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 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] Apache config + PHP include paths
in your virtualhost definition use: php_value include_path "new include path" might be that instead of php_value you have to use php_admin_value, not sure. this is explained in "Chapter 3. Configuration" of php manual. lenar. ""Butler, Shaun"" <[EMAIL PROTECTED]> wrote in message 0106240506.10472@progeny">news:0106240506.10472@progeny... > is there a way to set up a different include path per virtual host in the > apache config or in the php.ini ? > > so www.blahblah.com would have /www/libs as the include path > > and > > www.moomoo.com would have /www/moo > > -- Shaun > > -- > 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] resource ID?
heh, that basically means that query was ok at least techincally. When you echo that $result and get nothing - then something went wrong. The right way to check if query was ok is: if(is_resource($result)) echo "Query OK"; or just: if($result) echo "Query OK"; lenar. "Kurth Bemis" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > i get this: > > Resource id #2 > > when i run this code.whats resource id 2 mean? i just want to know if > the query was ok or not > > $result = mysql_query("SELECT authcode FROM users WHERE email='$email'",$db); > echo $result; > > ~kurth > > > -- > 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] List of included file names
use get_included_files() and/or get_required_files() functions. lenar. "DAve Goodrich" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > -Original Message- > > From: Tim McGuire [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, June 19, 2001 2:30 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] List of included file names. > > > > > > Hi, > > > > I searched the archives for this. > > > > For debugging purposes, I want to see a list of the included files on a > > page in HTML comments. > > > > PHP_SELF and HTTP_SERVER_VARS["SCRIPT FILENAME"] only returns the name + > > path of the file calling the included files. > > > > I want each included file to contribute its name to the page. Is there > > any way to do that so that the HTML source looks like this: > > > > Dave Goodrich > Director of Interface Development > Reality Based Learning Company > 9521 NE Willows Road, Suite 100 > Redmond, WA 98052 > Toll Free 1-877-869-6603 ext. 237 > Fax (425) 558-5655 > [EMAIL PROTECTED] > http://www.rblc.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] redirect from aframe to the whole page!
This is not PHP related, but use '_top' as TARGET. lenar. ""kaab kaoutar"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi! > how cann i redirect from a frame to a page but in the whole page ! > i mean like href and adding the target! > Thanks > _ > 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 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] Posting form variables with http authentication
I think there is no very simple way to do this. But you can try to receive the form yourself and using for example curl extension, make connection to that another server, then resubmitting your form data along with necessary authentication headers. That should work. lenar. ""Gerard Onorato"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi everyone, > > This question is almost certainly an RTFM but I can't find it so I am going > to ask anyway. > > I have a form on my ssl which I need to submit to a perl handler on another > server. Problem is the company on the other side is requiring a http > authentication to submit the form. > > I can't think of any way to send the authentication headers along with the > form post. Perhaps I just don't know enough about that area. I was thinking > that perhaps I could build a handler page on my server to take the original > submission via post then send another post via PHP along with the headers > needed for authentication. > > Before I even try this I was wondering if someone out there had ever done > this or could point me in the right direction of some documentation in this > area. If it can't be done I would appreciate knowing that as well. > > Thanks! > > Gerard Onorato > > > -- > 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 no longer logging errors - found them!
""Jeff Armstrong"" <[EMAIL PROTECTED]> wrote in message 9gtgiv$g4$[EMAIL PROTECTED]">news:9gtgiv$g4$[EMAIL PROTECTED]... > Little Bo jeff has lost his logs, > and doesn't know where to find them! > Fix up the conf > and they will come home > dragging their hints behind them! > > I moved some php config values into httpd.conf so that I could > manage my virtual sites better (e.g. phpMyAdmin needs globals) > and assumed that the names and values would be the same as php.ini > so I had > php_value display_errors on > php_value log_errors on They don't work because since they are boolean values you need to use php_flag instead of php_value: php_flag display_errors on php_flag log_errors on > > This doesnt work! The following does work though: > php_value display_errors 1 > php_value log_errors 1 As they logically should. > > regards > Jeff lenar -- 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 statement for clearing a table
DELETE FROM tablename or TRUNCATE TABLE tablename lenar. ""Wilbert Enserink"" <[EMAIL PROTECTED]> wrote in message 001101c0fb15$5daa49e0$[EMAIL PROTECTED]">news:001101c0fb15$5daa49e0$[EMAIL PROTECTED]... > Hi all, > > anybody knows the mysql statement for clearing the contents of a table and > lieving the table itself intact? > > Wilbert > > - > Pas de Deux > Van Mierisstraat 25 > 2526 NM Den Haag > tel 070 4450855 > fax 070 4450852 > http://www.pdd.nl > [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: Re[2]: [PHP] php as cron
> I have had the same problem in some debian installations. > As far as I investigaed, it possibly has to deal with the TERM > parameter but finally I did solve the problem installing also a > copiled version of PHP an calling it like: > > * * * * * php /var/www/path/to/script.php This might be more useful: * * * * * php -q /var/www/path/to/script.php It surpresses those HTML headers that you propably don't want in shell mode. lenar. -- 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 4.07-dev + Apache 2.0.19-dev
Do you have: SetOutputFilter PHP SetInputFilter PHP or something similar in your httpd.conf? lenar. ""Gonyou, Austin"" <[EMAIL PROTECTED]> wrote in message 85063BBE668FD411944400D0B744267A481AD4@AUSMAIL">news:85063BBE668FD411944400D0B744267A481AD4@AUSMAIL... > Has anyone had any luck getting it to work? I can compile both Apache fine > and add php as a module no problem and Apache is happy. But it will not > parse any PHP content. Please help! > > -- > Austin Gonyou > Systems Architect, CCNA > Coremetrics, Inc. > Phone: 512-796-9023 > email: [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] filemtime function not working
because $LastMod == 0 .. I assume your timezone is GMT-6 ? This is because that file doesn't exist or you don't have permissions for it or something like that. lenar. "Carmen & Gene" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Can anyone out there explain why: > >// $path = "/path/to/some/php_file/or/$PHP_SELF/"; > print "This page last modified on "; > $LastMod = filemtime("/var/www/html/WebAps/phpRSVP2/rsvp.php"); > print date("l, F j, Y - g:ia",$LastMod) . "\n"; > ?> > > Returns : > This page last modified on Wednesday, December 31, 1969 - 6:00pm > after being run through the above date() params? > > Obviously, the file HAS been modified ever so slightly since that date > in history!! > > Thanks, > > Gene Kelley > > > > -- > 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] filemtime function not working
""lenar"" <[EMAIL PROTECTED]> wrote in message 9h5itc$hir$[EMAIL PROTECTED]">news:9h5itc$hir$[EMAIL PROTECTED]... > because $LastMod == 0 .. I assume your timezone is GMT-6 ? correction - it returns false in this case, which gets converted to 0 in date() which in turn returns seconds from unix epoch and can be different from place to place depending on your timezone settings. in this case gmdate() should return 'jan 1 1970 00:00'. lenar. > This is because that file doesn't exist or you don't have permissions for it or >something like that. > lenar. "Carmen & Gene" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Can anyone out there explain why: > >// $path = "/path/to/some/php_file/or/$PHP_SELF/"; > print "This page last modified on "; > $LastMod = filemtime("/var/www/html/WebAps/phpRSVP2/rsvp.php"); > print date("l, F j, Y - g:ia",$LastMod) . "\n"; > ?> > > Returns : > This page last modified on Wednesday, December 31, 1969 - 6:00pm > after being run through the above date() params? > > Obviously, the file HAS been modified ever so slightly since that date > in history!! > > Thanks, > > Gene Kelley > > > > -- > 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] Get the value of a
if you really have to you can do smth like this: but i don't see the point of it :) lenar. ""Augusto Cesar Castoldi"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I always use "InputImageName_x > 0" to know if a button was clicked. > > How can I get the value on my input type=image? > > Like: > > how can I get "002545645" with "$contatc"? > > thanks, > > Augusto > > > -- > 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 not working
php.exe he's using redhat ... so there might be a _very_good_ possibility that he doesn't have php.exe laying around. lenar. ""Jason Lustig"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >I've added the lines: > >AddType application/x-httpd-php .php > >AddType application/x-httpd-php-source .phps > >to my httpd.conf file > > Maybe try adding: > AddType application/x-httpd-php4 .php > > instead of: > AddType application/x-httpd-php .php > > It depends on how you did the Action stuff. If you did: > Action application/x-httpd-php4 "/php4/php.exe" > > then you should use: > AddType application/x-httpd-php4 .php > > but if you did: > Action application/x-httpd-php "/php4/php.exe" > > then you should use: > AddType application/x-httpd-php .php > > That might work, it might not. > > --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] Re: Avoiding repost
Put your "thank you" on another page. Then after processing your post data, instead outputting "thank you" do: header("Location: http://youthost/thankyoupage.php";); die(); That should do it. Lenar "Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I have a card system that will ask for the required information, and > one hits a 'Send' button to send the card. This will submit all the > information to a database and send the viewer to a 'Thank You' page. > The problem is, if they hit reload on that (Thank You) page, (and answer > 'yes' to the 'Repost Data' question), a second card will get submitted - > with the same information as the first. Needless to say, someone can > sit at that screen, and hit 'reload' several times and send the same > card over and over again, flooding the recipient's mailbox. > > How can I avoid this? > > -- > H | Hi, I'm currently out of my mind. Please leave a message. BP! > + > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > Director of Internet Operations / SysAdmin. 800.441.3873 x130 > Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6 > http://www.pcraft.com . . .. Boulder, CO 80303, U.S.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] html form question
> Funny you should ask - just done it myself: Why you use mysql_result function? This can be done a bit simpler way (and more effective): $event\n"; ?> Lenar > >$table="shoots"; > require ("connect.php4"); > $result=MYSQL_QUERY( "SELECT eventName FROM $table"); > $num_rows = mysql_num_rows($result); > > for ($i=0;$i<$num_rows;$i++) > { > echo ""; > echo mysql_result($result,$i,"eventName"); > echo ""; > } > > > MYSQL_CLOSE(); > ?> > > - seb -- 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] search array for value
> > How do I search an array? > > > > For example if I want to know if $array contains "1"... > > > > Regards, > > > > Matthew Delmarter > > > This is bad, use in_array() or array_search(). in_array() returns TRUE if element is found in array. array_search returns the key of matching element, FALSE otherwise. Lenar > for ($i = 0; $i < count($array); $i++) > { > if ($array[$i] == 1) { > //do something > exit; > } > } > -- 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: Using Array of classes as a class member variable?
Maybe: > First some basic questions: > (1) Can you create an unitialised array ? $an_array = array(); > (2) Can an unitinialised array be a class member variable ? > > My problem is this: > > I have a class called "user" - which represents one row in a mySQL table > (also called user) > class userBag { var $users = array(); function userBag($sql) { $result = somedb_query($sql); while($udata = somedb_fetch_object($result)) $this->users[] = $udata } } -- 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] parent and grandparent member functions
Hello, I hit a wall. No offense, but this OO stuff in PHP is somehat weird, but skip to the problem. I have for example three classes: class a { function make() { // some code } } class b extends a { function make() { // some code parent::make(); } } class c extends b { function make() { // some code parent::make(); } } now the class 'c' is instantiated and the member function 'make' is called. All works up to the point where 'b'::make calls parent::make(). It seems to call itself :(. I can understand this is logical behaviour since it's still an instance of class c, so parent:: is still b::, but how should I call that grandparent's make()??? This doesn't seem like a good OOP. For example delphi's 'inherited' works relative to the class it's used in and it is way more useful than php's way. is there any elegant soultion(s) to my problem? Lenar Lõhmus
Re: [PHP] parent and grandparent member functions
yes, you were right it works (when you said it works i tested your code out and it definetly works). but this made me more confused than i was before. i commented in the lines in my code that earlier didn't work (replaced them sometime with class names hard coded solution) and it still did _not_ work. ok, made copies of files in action and started to strip them down. First, my stripped down code that works: make("whatever"); ?> now, when i remove the definition of class 'a' to another file and include the file like this: file1.php: file2.php: make("whatever"); ?> then i get message 'Warning: Missing argument 1 for make()' ... the code is same ... but working differently.at least with my php 4.0.5. so i think this is a bug. that include in our system is neccessary so to the point it works correctly, i have to hardcode class names. and thank you scott pointing me out (and getting me confused :) ). lenar. "scott [gts]"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > it looks like your solution *is* elegant... i tried > out your code, becuase i was astonished that such a > simple thing allegedly wasn't working... and it > did work. > > below is the exact code i had in my text editor, > and it executed perfectly. > when i called $c->make(), it printed "A:: MAKE". > > ..am i misunderstanding your problem? > > > > class a { > function make() { > // some code > print "A:: MAKE"; > } > } > > class b extends a { > function make() { > // some code > parent::make(); > } > } > > class c extends b { > function make() { > // some code > parent::make(); > } > } > > > > $c = new c(); > $c->make(); > > ?> > > > > -Original Message- > > From: Lenar Lõhmus [mailto:[EMAIL PROTECTED]] > > Sent: 20 June 2001 09:01 > > To: [EMAIL PROTECTED] > > Subject: [PHP] parent and grandparent member functions > > > > > > Hello, > > > > I hit a wall. No offense, but this OO stuff in PHP is somehat weird, but > > skip to the problem. > > I have for example three classes: > > > > class a { > > function make() { > > // some code > > } > > } > > > > class b extends a { > > function make() { > > // some code > > parent::make(); > > } > > } > > > > class c extends b { > > function make() { > > // some code > > parent::make(); > > } > > } > > > > now the class 'c' is instantiated and the member function 'make' is called. > > All works up to the point where 'b'::make calls parent::make(). > > It seems to call itself :(. I can understand this is logical behaviour since > > it's still an instance of class c, > > so parent:: is still b::, but how should I call that grandparent's make()??? > > This doesn't seem like a good OOP. > > For example delphi's 'inherited' works relative to the class it's used in > > and it is way more useful than php's way. > > > > is there any elegant soultion(s) to my problem? > > > > Lenar Lõhmus > > > -- > 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] a DOT or a BLANK SPACE
as I remeber, dots should be replaced by underscores not spaces .. at least if your input type is image and it's name is img then you would get two variables: img_x and img_y instead of what html4 spec specifies: img.x and img.y. Evevn if they get replaced then does it happen with $HTTP_POST_VARS[] array? I see now purpose of those names being replaced for this array only when they are populated as global variables. And still .. are you sure your webbrowser doesn't do that before t even makes to php? Lenar ""Jaime Torres"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi. We HAVE TO use names like Num. or Home Address in for our input tags in > the forms. That is: > > > > > When I receive the info in my PHP file, after the form has been posted, the > variable name I get is: 'Num '. So, the dots are being replaced for a blank > space. I can't take for granted that any blank space is a dot since my > inputs names are using them. > > How can I identify between this two variable names? > > Thanks for your help! > > Regards, > Jaime > > > -- > 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] Code check please
UPDATE syntax for INSERT is allowed in MySQL, so that should not be the problem as far as you include all fields not having default value, timestamp type or auto_increment attribute in your statement. What's the error message if there is any? lenar ""Rich Cavanaugh"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You're using UPDATE syntax for your INSERT > > try: > > $sql = "INSERT INTO tabell (fornamn, efternamn, email) values ('{$fornamn}', > '{$efternamn}', '{$email}')"; > > Rich Cavanaugh > > -Original Message- > From: Andreas Skarin [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 20, 2001 12:00 PM > To: PHP General > Subject: [PHP] Code check please > > > I've tried to get this working for over an hour > now, and it still won't. I don't even get an error > message to help me find the problem so I was > hoping that someone could check my code for me. > > I'm fooling around with a basic form that is > supposed to send one's name, surname and e-mail > address to "receive.php". "receive.php" is then > supposed to take the information and add it to a > table called "tabell" in a database called > "databas", but it doesn't work. I think there > might be something wrong with my MySQL query. > > - - - - - - - - - - - FORM - - - - - - - - - - - - > - - > > > Förnamn: > size="25"> > Efternamn: > size="25"> > E-mailadress: > size="25"> > value="Log in"> > > > - - - - - - - - - - - - - - - - - - - - - - - - - > - - - > > - - - - - - - - - - - RECEIVE.PHP - - - - - - - - > - - - > > > // connection to MySQL > $connection = mysql_connect("localhost", > "username", "password"); > if (!$connection) { > echo ("Unable to connect to the database > server at this time." ); > exit(); > } > > //select database > if (! @mysql_select_db("databas") ) { > echo ("Unable to locate the database at > this time."); > exit(); > } > > // MySQL query > $sql = "INSERT INTO tabell SET" . > "fornamn ='$fornamn'," . > "efternamn='$efternamn'," . > "email='$email';"; > ?> > > - - - - - - - - - - - - - - - - - - - - - - - - - > - - - > > Thanks in advance! > > // Andreas > > > -- > 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] Parse PHP inside a variable
maybe function eval()? lenar. "Claus Heiko Niesen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello > > I'm having a variable that contains HTML with embedded PHP code. When I > echo it then the PHP code does not get executed. Is there a way I can > parse/print the content of my variable? > > Thanks >Claus > > > -- > 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] Trimming Array value
something like this: $val) $ar[$key] = is_array($val) ? recursive_rtrim($val) : rtrim($val); return $ar; } ?> lenar. ""Reuben D Budiardja"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a multi-dimensional array. I want to trim every values so that none of them have trailing space. What is the most efficient way to do that ? I don't necessaryly know the dimension of the array ahead of time, so the function need to be able to handle it recursively. 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] setcookie() woes
In my experience the understanding of SetCookie header differs form browser to browser so much that it's horrible. As far as I remember IE5.5 handled it correctly. IE5.0 didn't. Netscape I think did (not completely sure). In any case .. session-based cookies seem to work in all of them. just call setcookie($name, $value) and nothing more. If you can't live without permament cookies you have to somehow (via $USER_AGENT for example) differ the browsers and upon that use setcookie the way that specific browser expects (you still have to find out how each of them works and there are many more than just IE or Netscape and their fifferent versions). I remember for example that one browser needed domain name to work and other didn't want it all to work. Or something like that. Hope this helps. lenar. ps. I think setcookie() itself doesn't woe, just our great programmers at netsacpe and microsoft can't correctly read and understand that short and simple specification of cookies. "Chris" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > I have a login script that works on one of my machines but not > another, and I've determined the problem has to do with setcookie(). > One machine is using IE 5.50 and another is using 5.00, and I assume > therein lies the problem. > > I've tried to plow through the dozens (hundreds?) of followups on the > manual page for setcookie(). Most of the interesting ones seem to > involve using header("SetCookie . . .") instead of the setcookie() > function. I tried a few, including the > pass-every-parameter-to-setcookie-even-if-you're-not-really-using-them > workaround, to no avail. > > Is this a well known problem, with a well known solution? > > Thanks, > 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] > -- 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] html form question
On Thu, 26 Jul 2001, Seb Frost wrote: > OK so how would that look if I'd done SELECT * instead of SELECT eventName? > I'm guessing I have two nested while loops then? > > I'm guessing something like this.? Or is it not possible and I have to > go back to mysql_result? Nope, instead you can do smething like this: $colval\n"; ?> Lenar > > mysql_connect("db", $user, $password); > $result = mysql_query( "SELECT * FROM $table"); > > while(list($field) = mysql_fetch_column($result)) > { > while(list($value) = mysql_fetch_row($result)) > echo "$value\n"; > } > ?> > > - seb > > -Original Message- > From: Lenar [mailto:[EMAIL PROTECTED]] > Sent: 26 July 2001 13:16 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] html form question > > > > Funny you should ask - just done it myself: > > Why you use mysql_result function? > > This can be done a bit simpler way (and more effective): > > mysql_connect("db", $user, $password); > $result = mysql_query( "SELECT eventName FROM $table"); > while(list($event) = mysql_fetch_row($result)) > echo "$event\n"; > ?> > > Lenar > > > > > > $table="shoots"; > > require ("connect.php4"); > > $result=MYSQL_QUERY( "SELECT eventName FROM $table"); > > $num_rows = mysql_num_rows($result); > > > > for ($i=0;$i<$num_rows;$i++) > > { > > echo ""; > > echo mysql_result($result,$i,"eventName"); > > echo ""; > > } > > > > > > MYSQL_CLOSE(); > > ?> > > > > - seb > > > > -- > 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] SQL Join query
Raditha Dissanayake wrote: > try postgres instead http://www.postgresql.org/ It's the most helpful comment I've seen for a long time. You know, it won't work in Postgre too probably. If you like Postgre - use it and don't force others to use it (for wrong reasons nevertheless). Everyone should pick his/her own tools... Anyway, instead of writing this: SELECT pics.*, pic_comments.*, count(*) AS num_comments FROM pics, pic_comments WHERE pics.category = 1 AND pics.id = pic_comments.pic_id GROUP BY pic_comments.pic_id; Write this: SELECT pics.*, pic_comments.*, count(*) AS num_comments FROM pics LEFT JOIN pic_comments ON (pic_comments.pic_id = pics.id) WHERE pics.category = 1 GROUP BY pics.pic_id; Lenar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL Join query
Mattias Thorslund wrote: > Though, (regardless of SQL database platform) in a case like this, it > MAY be both more straightforward and efficient to use two separate > queries for the pictures and comments, given the one-to-many cardinality > between them. The above statement causes redundant data to be returned > - it duplicates the pics record for each new comment. If there are many > large columns in the pics table and many comments to each record there's > a lot of redundant data in a query like that. No, I think you are wrong. There was GROUP BY pics.id so it won't return duplicate data. And probable overhead is eliminated too I think - DBserver will optimize and will join data from pic_comments only once for each unique pics.id. Lenar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php