|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 27 Jan 2004 17:24:49 -0000 Issue 2555
php-general-digest-help
lists.php.net
Date: Tue Jan 27 2004 - 11:24:49 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 27 Jan 2004 17:24:49 -0000 Issue 2555
Topics (messages 175854 through 175949):
Re: Can we make .exe programs with php?
175854 by: Shawn McKenzie
175880 by: Jay Blanchard
Re: content management
175855 by: Al
Re: unexpected include parse error
175856 by: Paul Furman
175857 by: R'twick Niceorgaw
175888 by: Ford, Mike [LSS]
175889 by: Ford, Mike [LSS]
Stupid newbie question = Why don't I need a ; after this line?
175858 by: Paul
175866 by: Jason Wong
175867 by: Tom Rogers
175932 by: Paul
175938 by: -{ Rene Brehmer }-
help with mysql
175859 by: Tom Flood
175860 by: Renan G. Galang
175877 by: Krit Kanrat
175904 by: Tom Flood
175905 by: Martin Luethi
test
175861 by: daitken.terex-mining.com.au
Re: How to prevent duplicated values?
175862 by: BAO RuiXian
Mail Transaction Failed
175863 by: chuck.horde.org
175864 by: chuck.horde.org
175868 by: Tom Rogers
Free Web Site Link Exchange Software
175865 by: Scott Dudley
Re: Detect language date(F)
175869 by: Martin Luethi
Auto update feature from PHP app - like antivirus definitions
175870 by: Terence
175871 by: Vincent DUPONT
su idn't working from within php
175872 by: Nitin Mehta
175879 by: Marek Kilimajer
175919 by: Nitin Mehta
175924 by: Marek Kilimajer
175929 by: Jas
String value modified on replace
175873 by: Sheni R. Meledath
Size of session?
175874 by: motorpsychkill
175878 by: Marek Kilimajer
Re: php document management systems
175875 by: David Robley
Re: PCRE vs. POSIX-extended for regular expressions
175876 by: Adam i Agnieszka Gasiorowski FNORD
Let openbasedir limited folks use system-wide includes
175881 by: MIKE YRABEDRA
175885 by: Jason Wong
tourico holidays
175882 by: Diana Castillo
Re: Verify cCPIGgLq for robleyd
ozemail.com.au
175883 by: David Robley
Re: Seems Simple enough
175884 by: Ford, Mike [LSS]
Re: can't figure out this mysql error
175886 by: Jason Wong
Re: Repost - Form/Session Problem with sample code = Probably easy question - Thanks for any help!
175887 by: Jason Wong
PDF and dynamic PNG
175890 by: Dominik Heeb
ILQWPNMPY
175891 by: rasmus.lerdorf.on.ca
>>Remove Dynamic String between StringA and StringB
175892 by: Jack Bauer
175896 by: Martin Luethi
MS SQL / PHP
175893 by: Enda Nagle
175907 by: Marek Kilimajer
175908 by: Enda Nagle
175912 by: Marek Kilimajer
175923 by: Enda Nagle
order by
175894 by: christian tischler
175895 by: Stuart
175901 by: Thomas Svenson
175906 by: Marek Kilimajer
Writing CRON jobs!
175897 by: Hamid Hossain
175898 by: Jay Blanchard
175899 by: Stuart
175933 by: Ray
175949 by: Brian V Bonini
Googlebot
175900 by: Hartley, Matt
175903 by: Stuart
175913 by: Raditha Dissanayake
175917 by: Frank Tudor
175918 by: Ben Ramsey
175921 by: Stuart
Re: Using templates (Code & User Interface)
175902 by: Skrol29
Tip For The Day
175909 by: Jay Blanchard
Re: Remove Dynamic String between StringA and StringB
175910 by: memoimyself.yahoo.com.br
Script timeout?
175911 by: Ben Ramsey
175914 by: memoimyself.yahoo.com.br
175915 by: Ben Ramsey
175916 by: Marek Kilimajer
175920 by: Marek Kilimajer
175922 by: Ben Ramsey
175927 by: jon roig
Random questions from database
175925 by: Alex Hogan
175946 by: memoimyself.yahoo.com.br
handling .zip and .sit files
175926 by: Joey Manley
How to echo something if not exist?
175928 by: Radwan Aladdin
175935 by: "Miguel J. Jiménez"
Design Languages for site design
175930 by: Daniel Brown
175942 by: Brent Baisley
Using unset with $_SESSION
175931 by: trlists.clayst.com
175934 by: Stuart
175936 by: trlists.clayst.com
175937 by: Stuart
175939 by: trlists.clayst.com
Unix-Apache: running apache as different user
175940 by: Eli Hen
175945 by: BAO RuiXian
Re: newbie issues with control structures & HTML form
175941 by: Stuart
PEAR / PHP / IIS Inetinfo consuming more and more memory
175943 by: Vincent DUPONT
sending mail with attachment problems
175944 by: tony
175948 by: memoimyself.yahoo.com.br
COM objects
175947 by: C C
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Depending upon why you want an executable, if its to run on a client machine
as an app then check out php-gtk.
-Shawn
"Dvdmandt" <dvdmandt
telia.com> wrote in message
news:20040125005512.32463.qmail
pb1.pair.com...
> A while ago there was someone who announced a link to some program that
> allowed you to make exe's (yes, it works)... Although, it's 100%
uncompiled
> (not even to bytecodes), so the only thing you gain is that it'll be
easier
> to run... :p
>
> Also checkout this: http://binaryphp.sf.net
> --
> // DvDmanDT
> MSN: dvdmandt¤hotmail.com
> Mail: dvdmandt¤telia.com
> "Pehepe Php" <pehepe
hotmail.com> skrev i meddelandet
> news:BAY13-F58GYtupulDWL0001f75e
hotmail.com...
> > Can we make .exe programs with php? for example we can do it with
delphi,
> > vbasic.but can we do with php?
> >
> > _________________________________________________________________
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
attached mail follows:
[snip]
Depending upon why you want an executable, if its to run on a client
machine
as an app then check out php-gtk.
[/snip]
There is also a thing called PriadoBlender, haven't really tried it
though.
attached mail follows:
"Justin French" <justin
indent.com.au> wrote in message
news:EC4737DE-5088-11D8-86FA-000A9579CE3A
indent.com.au...
> On Tuesday, January 27, 2004, at 04:23 PM, Al wrote:
>
> > This is one of the most frequently asked questions about the LAMP
> > platform.
> > A fantastic site that offers a comparison of all the different open
> > source
> > CMS systems out there and lets you test drive them all is
> > http://www.opensourcecms.com/ . I highly recommend it.
>
> But chances are you'll try them all out, and still decide that there's
> nothing to suit your needs (without being a bloated mess) and decide to
> roll your own :)
>
> Justin
So true. Everytime I sit down to choose a CMS for a project I usually go
through the following steps:
1) Write down spec and design for the CMS ... which is usually simple and
mundane except for one slightly unusual requirement.
2) Do some initial research and become excited by the dozens of open source
CMS systems promising to cut my development time by 80%.
3) Realise that none of the simple CMS platforms can handle my one unusual
requirement. Consider hacking it in, but realise just how much I hate having
to work with other people's code ... espcially on big apps like CMSs with
steep learning curves. Go back and do some more research.
4) Find a mothership CMS (e.g. ezpublish) that can handle my one unusual
requirement, and could probably iron my shirts as well, but I run away when
I realise I'll only use 3% of it's functionality but have to maintain and
serve up CPU cycles for 100% of its code.
5) Start writing my own CMS.
Al
attached mail follows:
Shawn McKenzie wrote:
> I've noticed in both of your posts that you aren't terminating the line
> before the include with a ;
Yup, thanks!
Then I fixed my global problem without bugging you guys too.
Final result:
#call.php
$dirstr= "./";
include 'scandir.php';
scandir('$dirstr');
#scandir.php
function scandir($dirstr) {
global $dirstr; #I HAD TO ADD THIS LINE ALSO
$files = array();
$fh = opendir($dirstr);
while (false !== ($filename = readdir($fh))) {
array_push($files, $filename);
}
closedir($fh);
return $files;
}
> FYI...
> If you use / then you don't have to escape it like // only the \.
> Also, instead of ".\\" you can use '.\'
Ah ha! that explains my confusion :-)
attached mail follows:
Hi Paul,
Quoting Paul Furman <paul
edgehill.net>:
> <?php
> $dirstr= "./"
probably because you are missing a ; at the end?
> include 'scandir.php';
> scandir('$dirstr');
you should also change this to
scandir($dirstr);
> ?>
>
> parse error, unexpected T_INCLUDE in [the above file]
>
> if I comment out the
> $dirstr= "./"
> above that error goes away and the scandir.php include runs (that's a
> php5 function that needs to be defined manually in PHP 4.3.4)
>
>
HTH
R'twick
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
attached mail follows:
On 27 January 2004 05:50, Paul Furman wrote:
> Shawn McKenzie wrote:
> > I've noticed in both of your posts that you aren't terminating the
> > line before the include with a ;
>
> Yup, thanks!
>
> Then I fixed my global problem without bugging you guys too.
Actually, no you didn't -- you just bypassed it.
> Final result:
>
>
> #call.php
> $dirstr= "./";
> include 'scandir.php';
> scandir('$dirstr');
Becasue single-quoted strings don't do variable interpolation, you are
actually passing the literal string '$dirstr' to the function -- no the
*value* of $dirstr, which is what you want. If you needed to use quotes
here, they should be double ones -- but, actually, you don't need quotes at
all: since what you really you want is the value of $dirstr, this will do
the trick:
scandir($dirstr);
> #scandir.php
> function scandir($dirstr) {
Well, now this $dirstr will be set to '$dirstr', which clearly isn't a valid
directory path!
> global $dirstr; #I HAD TO ADD THIS LINE ALSO
But you've now bypassed that by equivalencing it to the global version of
$dirstr, which, of course, still contains './', so the rest of the function
works. Once you take the quotes off the function call above, you also won't
need this global statement.
> $files = array();
> $fh = opendir($dirstr);
> while (false !== ($filename = readdir($fh))) {
> array_push($files, $filename);
> }
> closedir($fh);
> return $files;
> }
>
> > FYI...
> > If you use / then you don't have to escape it like // only the \.
> > Also, instead of ".\\" you can use '.\'
Actually, no you can't, because in single quoted strings \' is the sequence
to insert a single quote! So you still ahve ti use '.\\'.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On 27 January 2004 05:18, Shawn McKenzie wrote:
> >
> > PS I'm on my windows apache server but the forward slash seems to
> > work in php & that keeps it portable. I tried it both ways.
Yes -- PHP internally translates between / and \ on Windows, precisely for portability reasons. Thus, you can write your code using / and port it easily between Windows and *n*x systems -- this is a boon if, like me, you do development work on a Windows server but have a *n*x server for your live site.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Thanks for any advice.
Can anyone tell me why I do not get any errors with ( no ; after _id'] )
<?php echo $row_otherlawyer['lawyer_id']?>
<?php echo "NO ERROR";?>
attached mail follows:
On Tuesday 27 January 2004 14:18, Paul wrote:
> Can anyone tell me why I do not get any errors with ( no ; after _id'] )
>
> <?php echo $row_otherlawyer['lawyer_id']?>
>
> <?php echo "NO ERROR";?>
manual > Basic syntax
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Are there those in the land of the brave
Who can tell me how I should behave
When I am disgraced
Because I erased
A file I intended to save?
*/
attached mail follows:
Hi,
Tuesday, January 27, 2004, 4:18:03 PM, you wrote:
P> Thanks for any advice.
P> Can anyone tell me why I do not get any errors with ( no ; after _id'] )
P> <?php echo $row_otherlawyer['lawyer_id']?>
P> <?php echo "NO ERROR";?>
From the manual (which is given away free:)
The closing tag for the block will include the immediately trailing newline if one is present.
Also, the closing tag automatically implies a semicolon;
you do not need to have a semicolon terminating the last line of a PHP block.
Closing tag of a PHP block at the end of a file is optional.
--
regards,
Tom
attached mail follows:
Thanks guys. Duhhh. I was taught to always put ;'s and any dev software that
writes it's own code does the same. I also remember adding them because I
was getting error's at some point, perhaps PHP3.
Is it considered better practice to use them? Otherwise I've been wasting
keystrokes. I only noticed this when I was going over some code.
"Paul" <pfine
of-law.com> wrote in message
news:20040127061350.9319.qmail
pb1.pair.com...
> Thanks for any advice.
>
> Can anyone tell me why I do not get any errors with ( no ; after _id'] )
>
> <?php echo $row_otherlawyer['lawyer_id']?>
>
> <?php echo "NO ERROR";?>
attached mail follows:
I always use them ... but it's mainly 'cause if I ever need to expand the
code, I won't have to remember to add them ... it's for the same reason I
always use the braces '{ ... }' even though the short form would work just
as well in many cases ...
I tend to expand my code alot with time (as I make it more advanced), and
recycle it across multiple projects ... it's simply easier if all the
thingies are there already, as it produces far less errors when copy/pasting
from file to file
Rene
Fate would have it, that on Tue, 27 Jan 2004 09:56:02 -0600, Paul wrote:
>Thanks guys. Duhhh. I was taught to always put ;'s and any dev software that
>writes it's own code does the same. I also remember adding them because I
>was getting error's at some point, perhaps PHP3.
>
>Is it considered better practice to use them? Otherwise I've been wasting
>keystrokes. I only noticed this when I was going over some code.
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
attached mail follows:
Hello,
I am just beginning my learning of php and its uses with mysql. I wrote a
small program to add information into a mysql database. However my script
returns the following error:
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/ephi/mysql.php on line 16
what is the problem here? How can I fix it?
I truly appreciate any help given.
Tom Flood
tflood91
msn.com
attached mail follows:
could you send the line 16 the parser was pointing out?
It could be you have the wrong number of parameters for the call to
mysql_connect(), or your PHP wasn't compiled with mysql functionality
enabled. (This is doubtful since mysql functionality is ON by default).
----- Original Message -----
From: "Tom Flood" <tflood91
msn.com>
To: <php-general
lists.php.net>
Sent: Tuesday, January 27, 2004 2:27 PM
Subject: [PHP] help with mysql
> Hello,
>
> I am just beginning my learning of php and its uses with mysql. I wrote a
> small program to add information into a mysql database. However my script
> returns the following error:
>
> Fatal error: Call to undefined function: mysql_connect() in
> /var/www/html/ephi/mysql.php on line 16
>
> what is the problem here? How can I fix it?
>
> I truly appreciate any help given.
>
> Tom Flood
> tflood91
msn.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi,
Are you sure that you already enable mysql function on your web server ?
Krit Kanrat
"Tom Flood" <tflood91
msn.com> wrote in message
news:20040127061014.99658.qmail
pb1.pair.com...
> Hello,
>
> I am just beginning my learning of php and its uses with mysql. I wrote a
> small program to add information into a mysql database. However my script
> returns the following error:
>
> Fatal error: Call to undefined function: mysql_connect() in
> /var/www/html/ephi/mysql.php on line 16
>
> what is the problem here? How can I fix it?
>
> I truly appreciate any help given.
>
> Tom Flood
> tflood91
msn.com
attached mail follows:
Thank you both, here is the entire code :
1<html>
2<head>
3<title>Untitled Document</title>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5</head>
6
7<body>
8<?php
9 $name = $_GET["name"];
10 $address = $_GET["address"];
11$city = $_GET["city"];
12print "Name is $name<br>\n";
13print "Address is $address<br>\n";
14print "City is $city<br>\n";
15
16mysql_connect("tflood", "thomas91");
17
18$result = mysql_query(
19 "insert into ephi.info
20 (name, address, city) values
21 ('$name', '$address', '$city')"
22);
23if ($result) {
24 print <<<EOT
25
26 <h1> Thank you. </h1>
27 Your signup is highly appreciated. To show our appreciation, we will
send you something that you, in turn, will appreciate. <p>
28 Remember our motto: Once a Sinfonian, Always a Sinfonian, Long Live
Sinfonia!
29EOT;
30 }
31 else {
32 print "Something went wrong dunbass";
33 }
34 mysql_close();
35?>
36</body></html>
As far as mysql working on the machine, it is. I am able to use the mysql
command to loginto the server and query my databases. And I have the MySQL
Command Center installed and am able to see the databases on my computer
just fine.
Thank you for your help.
Tom
"Krit Kanrat" <guy
microthai.com> wrote in message
news:20040127084245.89510.qmail
pb1.pair.com...
> Hi,
>
> Are you sure that you already enable mysql function on your web server ?
>
> Krit Kanrat
>
> "Tom Flood" <tflood91
msn.com> wrote in message
> news:20040127061014.99658.qmail
pb1.pair.com...
> > Hello,
> >
> > I am just beginning my learning of php and its uses with mysql. I wrote
a
> > small program to add information into a mysql database. However my
script
> > returns the following error:
> >
> > Fatal error: Call to undefined function: mysql_connect() in
> > /var/www/html/ephi/mysql.php on line 16
> >
> > what is the problem here? How can I fix it?
> >
> > I truly appreciate any help given.
> >
> > Tom Flood
> > tflood91
msn.com
attached mail follows:
line 16: mysql_connect("tflood", "thomas91");
I think you mean: mysql_connect("localhost", "tflood", "thomas91");
otherwise mysql_connect takes "tflood" as Server and "thomas91" as
Username (if so, its better to replace passwords with ***** before
posting)
-> http://ch.php.net/mysql_connect
after connecting you need to choose a database, e.g.
line 17: mysql_select_db("databasename");
also make sure that the mysql-extension is installed and loaded.
to check this, create a textfile "phpinfo.php" with this content:
<?
phpinfo();
?>
check the output for information about mysql
g. tinu
Tue, 27 Jan 2004 08:51:52 -0500 Tom Flood <tflood91
msn.com>:
> Thank you both, here is the entire code :
>
> 1<html>
> 2<head>
> 3<title>Untitled Document</title>
> 4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> 5</head>
> 6
> 7<body>
> 8<?php
> 9 $name = $_GET["name"];
> 10 $address = $_GET["address"];
> 11$city = $_GET["city"];
> 12print "Name is $name<br>\n";
> 13print "Address is $address<br>\n";
> 14print "City is $city<br>\n";
> 15
> 16mysql_connect("tflood", "thomas91");
> 17
> 18$result = mysql_query(
> 19 "insert into ephi.info
> 20 (name, address, city) values
> 21 ('$name', '$address', '$city')"
> 22);
> 23if ($result) {
> 24 print <<<EOT
> 25
> 26 <h1> Thank you. </h1>
> 27 Your signup is highly appreciated. To show our appreciation, we will
> send you something that you, in turn, will appreciate. <p>
> 28 Remember our motto: Once a Sinfonian, Always a Sinfonian, Long Live
> Sinfonia!
> 29EOT;
> 30 }
> 31 else {
> 32 print "Something went wrong dunbass";
> 33 }
> 34 mysql_close();
> 35?>
> 36</body></html>
>
>
>
>
> As far as mysql working on the machine, it is. I am able to use the mysql
> command to loginto the server and query my databases. And I have the MySQL
> Command Center installed and am able to see the databases on my computer
> just fine.
>
>
> Thank you for your help.
>
> Tom
>
> "Krit Kanrat" <guy
microthai.com> wrote in message
> news:20040127084245.89510.qmail
pb1.pair.com...
>> Hi,
>>
>> Are you sure that you already enable mysql function on your web server ?
>>
>> Krit Kanrat
>>
>> "Tom Flood" <tflood91
msn.com> wrote in message
>> news:20040127061014.99658.qmail
pb1.pair.com...
>> > Hello,
>> >
>> > I am just beginning my learning of php and its uses with mysql. I wrote
> a
>> > small program to add information into a mysql database. However my
> script
>> > returns the following error:
>> >
>> > Fatal error: Call to undefined function: mysql_connect() in
>> > /var/www/html/ephi/mysql.php on line 16
>> >
>> > what is the problem here? How can I fix it?
>> >
>> > I truly appreciate any help given.
>> >
>> > Tom Flood
>> > tflood91
msn.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The message cannot be represented in 7-bit ASCII encoding and has been sent as a binary attachment.
attached mail follows:
Thomas Svenson wrote:
>BAO RuiXian wrote:
>
>
>>Make it field UNIQUE.
>>
>>
>
>That's the easy method, but usually not very smart. It only causes MySQL to
>
>
Well, if there is an easy method, why we bother to use a more
complicacted way?
>generate an error which you then have to take care of in your application.
>
>
We need to take care of various errors any way whenever we are dealing
with databases.
>Much better to have an index on the Username column and then use a select to
>check if the name exist. If it doesn't it is OK to insert. Much easier to
>handle in PHP.
>
>
Quite to the opposite, if the database can handle it, why bother to
write one's own with something adding more burden to the database
(select statement), more process on the php code (check each item of the
select result) and possibly less error-proof in your php checking code?
>Personally I avoid using such things as UNIQUE or NOT_NULL (unless the
>column have a default value) on columns, just because it is more complex to
>handle the MySQL errors than write your own code to check it in PHP.
>
>
Can't get it. If there is a existing method, why not use it. The
home-brew one is always low in aspects. I don't understand why you think
checking errors is complext, which has to be done in all your codes,
even a trivial one.
>/T
>
>
Best
Bao
attached mail follows:
The message contains Unicode characters and has been sent as a binary attachment.
attached mail follows:
The message contains Unicode characters and has been sent as a binary attachment.
attached mail follows:
Hi,
Tuesday, January 27, 2004, 4:32:46 PM, you wrote:
cho> The message contains Unicode characters and has been sent as a binary attachment.
Be careful this crap is a virus
--
regards,
Tom
attached mail follows:
I've been looking this evening for a free PHP reciprocal link exchange
package. I'm prepared to roll my own if I can't find what I'm after but
there's so many of us hacking code these days that I can't imagine that
someone's not already done so. Can anyone recommend such a package? I'm
looking for the following features (in no particular order):
mySql back-end
admin interface
user interface for others to submit link
ability to allow link to be automatically added or approval required
reciprocal link check - spider, etc. submitters site
dead link clean-up/removal
allow definition of multiple categories
flexibility
...
I'm not looking to create a link farm but rather to add content to my
wife's web site. She often receives requests from others related to her
field to add reciprocal links.
Many thanks.
--
Regards,
Scott Dudley
attached mail follows:
my example should also work with fr or fr-ca
what do you get with: echo $_SERVER["HTTP_ACCEPT_LANGUAGE"]; ?
the locale-string depends on your webserver. under linux you have to build
them first (e.g.: locale-gen)
take a look at the user-notes under
http://ch2.php.net/manual/de/function.setlocale.php
g. martin luethi
Mon, 26 Jan 2004 14:36:04 -0500 John Taylor-Johnston
<taylorjo
collegesherbrooke.qc.ca>:
> I see what you are doing, But don't see where to create fr or fr-ca,
> for my example?
> John
>
> Martin Luethi wrote:
>
>> the variable $_SERVER["HTTP_ACCEPT_LANGUAGE"] contains the Accept-Language-
>> Header from the browser
>> -> http://ch2.php.net/reserved.variables
>>
>> with setlocale() you can set locale-informations
>> -> http://ch2.php.net/function.setlocale
>>
>> finally strftime() formats a date with the current locale-informations
>> -> http://ch2.php.net/manual/en/function.strftime.php
>>
>> sample script:
>> <?
>> if (preg_match("/^([a-z]{2}).([a-z]{2})$/i",
>> $_SERVER["HTTP_ACCEPT_LANGUAGE"],
>> $m='')) { // e.g. de-ch
>> $locales[] = strtolower($m[1])."_".strtoupper($m[2]); // e.g. de_CH
>> $locales[] = strtolower($m[1]); // e.g. de
>> setlocale(LC_TIME, $locales);
>> } else if (preg_match("/^([a-z]{2})$/i", $_SERVER["HTTP_ACCEPT_LANGUAGE"],
>> $m='')) { // e.g. de
>> $locales[] = strtolower($m[1])."_".strtoupper($m[1]); // e.g. de_DE
>> $locales[] = strtolower($m[1]); // e.g. de
>> setlocale(LC_TIME, $locales);
>> }
>> echo strftime("%B", strtotime("+1 month"));
>> ?>
>>
>> g. martin luethi
>>
>> Mon, 26 Jan 2004 03:29:16 -0500 John Taylor-Johnston
>> <taylorjo
collegesherbrooke.qc.ca>:
>>
>> > Thanks!! :) Getting tired at this hour.
>> >
>> > Is there a way to detect the language of the browser and echo the
>> > name of the month in that language?
>> >
>> >> <?= date("F", strtotime("+1 month")); ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
Has anyone ever tried to produce an auto-update feature for your PHP
application?
Say a client downloads version 1, and a month later version 1.1 is
available, which makes
changes to a few scripts say, add_user.php, modify_user.php and
display_users.php
Does anyone have a method or way in which these scripts (say the source is
available from the
project homepage via a URL - something like
http://theproject/updates/version1.1/add_user.php.gz) can
be downloaded and replace the current one on the client's server? Just
theory or a finger
to point me in a general direction would be great.
Hope this makes sense.
Thanks
Terence
attached mail follows:
Maybe a PEAR package do do the trick. Have a look at PEAR_PackageFileManager on http://pear.php.net/package/PEAR_PackageFileManager
I never used it, but plan to do.
I you use it, please keep me informed
Maybe you could have something more trivial if you just need to download a single file.
Vincent
-----Original Message-----
From: Terence [mailto:terence
sunway.edu.my]
Sent: mardi 27 janvier 2004 9:17
To: php-general
lists.php.net
Subject: [PHP] Auto update feature from PHP app - like antivirus
definitions
Hi,
Has anyone ever tried to produce an auto-update feature for your PHP
application?
Say a client downloads version 1, and a month later version 1.1 is
available, which makes
changes to a few scripts say, add_user.php, modify_user.php and
display_users.php
Does anyone have a method or way in which these scripts (say the source is
available from the
project homepage via a URL - something like
http://theproject/updates/version1.1/add_user.php.gz) can
be downloaded and replace the current one on the client's server? Just
theory or a finger
to point me in a general direction would be great.
Hope this makes sense.
Thanks
Terence
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
hi all
i was trying to execute some commands as an authorized user from within my php script with
exec ("su <username> -c \"sudo <command>\" 2>&1;", $output);
but it gives me
standard in must be a tty
how can i make it work? it runs perfectly at command prompt
I even tried to ssh, but the problem is where should i copy the rsa-key generated with keygen, as the scripts are run as apache/http user..........
Plz help me out of this
Thanx in advance
Nitin
attached mail follows:
Why do you need su? Set up sudo for apache user.
Nitin Mehta wrote:
> hi all
>
> i was trying to execute some commands as an authorized user from within my php script with
>
> exec ("su <username> -c \"sudo <command>\" 2>&1;", $output);
>
> but it gives me
>
> standard in must be a tty
>
> how can i make it work? it runs perfectly at command prompt
>
> I even tried to ssh, but the problem is where should i copy the rsa-key generated with keygen, as the scripts are run as apache/http user..........
>
> Plz help me out of this
>
> Thanx in advance
> Nitin
attached mail follows:
but how would i store keys for apache?
----- Original Message -----
From: "Marek Kilimajer" <kilimajer
webglobe.sk>
To: "Nitin Mehta" <nitinmehta
kappa.net.in>
Cc: <php-general
lists.php.net>
Sent: Tuesday, January 27, 2004 4:03 PM
Subject: Re: [PHP] su idn't working from within php
> Why do you need su? Set up sudo for apache user.
>
> Nitin Mehta wrote:
> > hi all
> >
> > i was trying to execute some commands as an authorized user from within
my php script with
> >
> > exec ("su <username> -c \"sudo <command>\" 2>&1;", $output);
> >
> > but it gives me
> >
> > standard in must be a tty
> >
> > how can i make it work? it runs perfectly at command prompt
> >
> > I even tried to ssh, but the problem is where should i copy the rsa-key
generated with keygen, as the scripts are run as apache/http user..........
> >
> > Plz help me out of this
> >
> > Thanx in advance
> > Nitin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
You need to edit /etc/sudoers file and allow apache to execute
<command>. And you also need to be carefull what you are doing or you
will create a security hole.
Nitin Mehta wrote:
> but how would i store keys for apache?
>
> ----- Original Message -----
> From: "Marek Kilimajer" <kilimajer
webglobe.sk>
> To: "Nitin Mehta" <nitinmehta
kappa.net.in>
> Cc: <php-general
lists.php.net>
> Sent: Tuesday, January 27, 2004 4:03 PM
> Subject: Re: [PHP] su idn't working from within php
>
>
>
>>Why do you need su? Set up sudo for apache user.
>>
>>Nitin Mehta wrote:
>>
>>>hi all
>>>
>>>i was trying to execute some commands as an authorized user from within
>
> my php script with
>
>>>exec ("su <username> -c \"sudo <command>\" 2>&1;", $output);
>>>
>>>but it gives me
>>>
>>>standard in must be a tty
>>>
>>>how can i make it work? it runs perfectly at command prompt
>>>
>>>I even tried to ssh, but the problem is where should i copy the rsa-key
>
> generated with keygen, as the scripts are run as apache/http user..........
>
>>>Plz help me out of this
>>>
>>>Thanx in advance
>>>Nitin
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
attached mail follows:
Marek Kilimajer wrote:
> You need to edit /etc/sudoers file and allow apache to execute
> <command>. And you also need to be carefull what you are doing or you
> will create a security hole.
>
> Nitin Mehta wrote:
>
>> but how would i store keys for apache?
>>
>> ----- Original Message ----- From: "Marek Kilimajer"
>> <kilimajer
webglobe.sk>
>> To: "Nitin Mehta" <nitinmehta
kappa.net.in>
>> Cc: <php-general
lists.php.net>
>> Sent: Tuesday, January 27, 2004 4:03 PM
>> Subject: Re: [PHP] su idn't working from within php
>>
>>
>>
>>> Why do you need su? Set up sudo for apache user.
>>>
>>> Nitin Mehta wrote:
>>>
>>>> hi all
>>>>
>>>> i was trying to execute some commands as an authorized user from within
>>
>>
>> my php script with
>>
>>>> exec ("su <username> -c \"sudo <command>\" 2>&1;", $output);
>>>>
>>>> but it gives me
>>>>
>>>> standard in must be a tty
>>>>
>>>> how can i make it work? it runs perfectly at command prompt
>>>>
>>>> I even tried to ssh, but the problem is where should i copy the rsa-key
>>
>>
>> generated with keygen, as the scripts are run as apache/http
>> user..........
>>
>>>> Plz help me out of this
>>>>
>>>> Thanx in advance
>>>> Nitin
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>>
Can I recommend you don't try to add the apache webserver user to your
sudoers file? Big no-no. If anyone tries to issue a 'su' command on
your server from a web based form for example you could compromise your
machine. I have a more elegant solution... create a shell script
'command.sh' and then setup a cron job to execute the script every so
often. Let me show you an example...
[shell.sh]
#!/bin/sh
if test -f /path/to/file
then
echo "file found, proceeding to execute command as root"
<code to be run as root>
echo "removing temporary file used to signal process"
rm -dfr /path/to/file
else
echo "file was not found, exiting shell gracefully"
exit 0
fi
[end shell.sh]
[script.php]
if(!emtpy($yourvariable)) {
echo "variable found, creating temporary file to flag shell script to
execute";
system("touch /path/to/file");
} else {
echo "variable not present, exiting"; }
[end script.php]
[crontab <file>]
*/5 * * * * /path/to/shell.sh >>/tmp/php_log 2>&1
[end crontab <file>]
*** make sure you are root when adding this command to your cron jobs
This way your cronjob runs every five minutes and executes your shell
script. Your shell script checks to see if a temporary file is present
and if it is executes the command on the server as the root user. No
privledge escalation holes.
Hope this helps, let me know if it doesn't or if you don't have
dedicated hosting.
Jas
attached mail follows:
Hello:
I have a string variable with the following value
$httppath = "http://www.mysite.org";
This variable is stored in an include file.
When I use this variable in another document, where the setting file is
included, the value of the above variable is getting replaced with:
http:/!
/www.mysite.org/
There is an exclamation mark and a line break inserted between the 2
forward slashes. Could anybody help me to figure out this problem.
Sheni R Meledath
sheni
cyber-gear.com
attached mail follows:
I'm not sure if this has been covered (I searched the archives) but does
anyone know if there is a size limit on what a session can store? What is
this dependant on?
Thanks!
-m
attached mail follows:
php memory limit if php has been compiled with --enable-memory-limit and
the limit is enabled, else it is limited by the platform php runs on
motorpsychkill wrote:
> I'm not sure if this has been covered (I searched the archives) but does
> anyone know if there is a size limit on what a session can store? What is
> this dependant on?
>
> Thanks!
>
> -m
>
attached mail follows:
In article <BPEOIJEFGCBLOABOGLIDCECPDFAA.binc2
ctech.ac.za>,
binc2
ctech.ac.za says...
> Anyone know of any php document management systems? if its open source that
> would be even better.
>
> TIA
>
http://www.google.com/search?q=php+document+management+systems should give
you a few pointers
--
Quod subigo farinam
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
attached mail follows:
Pablo Gosse wrote:
> Hi all. Quick quesiton about PCRE vs. POSIX-extended regular
> expressions.
>
> How much of a difference is there between these two types of regular
> expressions. I know I've read that PCRE is faster, but is it that much
> of a difference?
PCRE are _way_ more advanced, I, personally,
prefer them. Read about the syntax in the
fine manual.
--
Seks, seksiæ, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info { iWanToDie } WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kszta³ty... http://www.opera.com 007
attached mail follows:
Hello,
I use php admin flags to give each of my clients different permissions. All
of them , by default, are limited to their directory using openbasedir
parameter.
I also have phpmailer set up so everyone can use it as an include or require
function.
The only problem is, the folks locked into their directories cannot use it.
It gives an openbase directory error every time.
Does anyone know of a solution for this without compromising security?
+--------------------------------------------+
Mike Yrabedra (President)
323 Incorporated
Home of MacDock.com, MacAgent.com and MacShirt.com
+--------------------------------------------+
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: mike
323inc.com
I: ichatmacdock
+--------------------------------------------+
"Whatever you do, work at it with all your heart,
as working for the Lord, not for men."
~Colossians 3:23 <{{{><
+--------------------------------------------+
attached mail follows:
On Tuesday 27 January 2004 18:59, MIKE YRABEDRA wrote:
> The only problem is, the folks locked into their directories cannot use it.
> It gives an openbase directory error every time.
>
> Does anyone know of a solution for this without compromising security?
safe_mode_include_dir
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you want your spouse to listen and pay strict attention to every
word you say, talk in your sleep.
*/
attached mail follows:
Is there anyone out there using XML with php to connect to Tourico Holidays?
If so I need your help.
thanks.
--
--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039
Fax : 00-34-915228673
email: diana
hotelkey.com
Web : http://www.hotelkey.com
http://www.destinia.com
attached mail follows:
On 27 Jan 2004 at 20:46, Piers Lauder wrote:
> Hi!
>
> Your message has been received, but it hasn't been delivered to me
> yet. As I don't have any record of you sending me mail from this
> address before, I need to verify that you're not a spammer. Please
> reply and alter the Subject line to remove the word REMOVETHISWORD,
> and your previous message will be delivered, as will all your future
> messages.
>
> Thanks, and apologies for the inconvenience.
>
> Piers Lauder.
>
> Note: your original message is appended below.
>
> Please check it carefully.
>
> If it didn't originate from you, then a spammer is probably impersonating
> your address.
>
> In which case please ignore this message.
>
> ==== Original Message ====
>
> Received: by staff.cs.usyd.edu.au with postie; Tue, 27 Jan 2004 20:46:17
> +1000 Received: by staff.cs.su.oz.au with MHSnet; Tue, 27 Jan 2004
> 20:46:15 +1100 Received: from lists.php.net by MHSnet id 3+3XC-2AA+3XBd;
> Tue, 27 Jan 2004 20:46:14 +1100 Received: from pb1.pair.com. by
> staff.cs.usyd.edu.au.; Tue, 27 Jan 2004 20:46:14 +1100 Received: (qmail
> 44558 invoked by uid 1010); 27 Jan 2004 09:45:20 -0000 Mailing-List:
> contact php-general-help
lists.php.net; run by ezmlm Precedence: bulk
> list-help: <mailto:php-general-help
lists.php.net> list-unsubscribe:
> <mailto:php-general-unsubscribe
lists.php.net> list-post:
> <mailto:php-general
lists.php.net> Delivered-To: mailing list
> php-general
lists.php.net Received: (qmail 44508 invoked by uid 1010); 27
> Jan 2004 09:45:20 -0000 Delivered-To: ezmlm-scan-php-general
lists.php.net
> Delivered-To: ezmlm-php-general
lists.php.net To:
> php-general
lists.php.net From: David Robley <robleyd
ozemail.com.au>
> Date: Tue, 27 Jan 2004 20:15:32 +1030 Message-ID:
> <MPG.1a80d73366bbb59b989851
news.php.net> References:
> <BPEOIJEFGCBLOABOGLIDCECPDFAA.binc2
ctech.ac.za> Organization: Norfolke &
> Goode MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"
> Content-Transfer-Encoding: 7bit X-Newsreader: MicroPlanet Gravity v2.60
> X-Posted-By: 203.103.155.63 Subject: [PHP] Re: php document management
> systems
>
> In article <BPEOIJEFGCBLOABOGLIDCECPDFAA.binc2
ctech.ac.za>,
> binc2
ctech.ac.za says...
> > Anyone know of any php document management systems? if its open source
> > that would be even better.
> >
> > TIA
> >
>
> http://www.google.com/search?q=php+document+management+systems should give
> you a few pointers -- Quod subigo farinam
>
> A: Because it messes up the order in which people normally read text. Q:
> Why is top-posting such a bad thing? A: Top-posting. Q: What is the most
> annoying thing on usenet?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
It would appear that you have subscribed to the php mailing list, but you
are requiring people to confirm that their messages to the list, and
hence to you, are valid. You are probably missing qiute a few messages as
a result. You might wish to reconsider this approach, as it may tend to
annoy some people. I appreciate that you may be concerned about
unsolicited mail, but I suspect that using this approach on a mailing
list may be counter productive.
--
David Robley
Quod subigo farinam
"My hair's been cut off," Tom said distressfully.
attached mail follows:
On 26 January 2004 16:56, Christopher J. Crane wrote:
> Ok here is the wierd thing.
> I pasted more code, it seems to not work because of me
> changing the number
> format.
>
> This works ...
> if($Balance >= 10001) {
> $Balance = number_format($Balance,2,'.',',');
> echo "<font color=\"green\">\$$Balance</font><br>\n"; }
> if($Balance <= 9999) { $Balance =
> number_format($Balance,2,'.',','); echo "<font
> color=\"red\">\$$Balance</font><br>\n"; } else { $Balance =
> number_format($Balance,2,'.',','); echo "<font
> color=\"purple\">\$$Balance</font><br>\n"; }
>
> This does not ...
> $SummaryResults = mysql_query("SELECT * FROM Accounting WHERE
> UserID='$UserID' LIMIT 1") or die("Invalid query");
> while($SummaryField = mysql_fetch_array($SummaryResults)) {
> $Balance = number_format($SummaryField["Balance"],2,'.',',');
$Balnace is now (for example) "10,000.00"; comma is not a valid character in a PHP number, so when interpreted as a number this will convert to 10.
> } if($Balance >= 10001) { echo "<font
> color=\"green\">\$$Balance</font><br>\n"; }
> elseif($Balance <= 9999) { echo "<font
10 is <= 9999 so...
> color=\"red\">\$$Balance</font><br>\n"; }
> else { echo "<font color=\"purple\">\$$Balance</font><br>\n"; }
But I have to ask, why include all the invariant parts in every branch of your if-else chain? As a general principle, I try to put only the parts that are genuinely different inside conditionals, so in this case I'd probably write something like:
echo '<font color="';
if ($Balance >= 10001):
echo 'green';
elseif ($Balance <= 9999):
echo 'red';
else:
echo 'purple';
endif;
echo '">$', number_format($Balance, 2, '.', ','), "</font><br />\n";
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On Tuesday 27 January 2004 02:23, Chris W. Parker wrote:
> If I put the two functions mysql functions within the query method I
> created I get an error on those two lines BUT the program continues as
> normal WITH the data being printed to the page just as I want it to.
> Clearly the mysql resource being complained about is actually valid and
> not invalid considering that the data I'm trying to retrieve is printed
> to the page.
>
> Any other ideas?
Post some *concise* code which illustrates the problem.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Your supervisor is thinking about you.
*/
attached mail follows:
On Monday 26 January 2004 05:11, Paul wrote:
> I am trying to use a back button to allow a user to change submitted form
> values.
>
> The problem I am having is that when they submit the form a second time,
> regardless of what is entered, the variable $test does not change and keeps
> only the first value assigned to it! I am able to solve this by using
> session_unset($test); but I don't understand what is happening/why I should
> need to do this.
>
> Any help appreciated, here is some sample code to illustrate. Running this,
> only what is typed in first for $test is kept after that it will not take
> on new values!
[snip]
If you're using a relatively new version of php, it is strongly recommended
that you code for "register_globals = Off" and accordingly use the
corresponding method of handling sessions (manual > Session handling
functions).
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Man who falls in blast furnace is certain to feel overwrought.
*/
attached mail follows:
Hello,
I succeed in creating PDF files dynamically with PHP (including inserting
static PNG images), and also succeed in creating PNG images dynamically.
However, I can't insert dynamically created PNG images into PDF files,
neither with pdf_open_image_file, nor with pdf_open_png.
Is this impossible?
D o m i n i k
Example:
function putimage ($pdf, $fullfilename, $x, $y, $width) {
// init
$extension = substr($fullfilename, strrpos ($fullfilename, ".")+1);
$pdfimage = pdf_open_image_file($pdf, $extension, $fullfilename);
// define scale
$sourceimagewidth = pdf_get_value ($pdf, "imagewidth", $pdfimage);
$scale = $width / $sourceimagewidth;
// put image
pdf_place_image($pdf, $pdfimage, $x, $y, $scale);
}
attached mail follows:
The message contains Unicode characters and has been sent as a binary attachment.
attached mail follows:
Hi :),
i tried your code zu replace some parts of a string,
the problem is that this method only replaces when
there is only 1 word between stringA and stringB.
i got the problem that the part between both strings
is a dynamic one and much larger then 1 word.
i really tried to use the php manual and google
to find some help for this, but i got no luck with that :(
$stringA = "AA";
$stringB = "BB";
$string = "AA oneword BB AA two words BB";
$pattern = "/$stringA.\w*.$stringB/";
$replacement = "";
echo preg_replace($pattern, $replacement, $string);
i think it have to do something with the \w in the pattern,
is there a parameter to resolve my problem too?
regards
manuel
attached mail follows:
$pattern = "/$stringA.*?$stringB/";
.*? -> matches everything between $stringA and $stringB
the "?" means: stop matching after the first occurence
of $stringB (quantifier minimizer). otherwise ".*" would
match everything between the first occurence of $stringA
and the last occurence of $stringB
-> http://ch2.php.net/manual/de/pcre.pattern.syntax.php
g. tinu
Tue, 27 Jan 2004 13:25:27 +0100 Jack Bauer <jackbauer
elict.org>:
> Hi :),
>
> i tried your code zu replace some parts of a string,
> the problem is that this method only replaces when
> there is only 1 word between stringA and stringB.
> i got the problem that the part between both strings
> is a dynamic one and much larger then 1 word.
> i really tried to use the php manual and google
> to find some help for this, but i got no luck with that :(
>
> $stringA = "AA";
> $stringB = "BB";
> $string = "AA oneword BB AA two words BB";
>
> $pattern = "/$stringA.\w*.$stringB/";
> $replacement = "";
> echo preg_replace($pattern, $replacement, $string);
>
> i think it have to do something with the \w in the pattern,
> is there a parameter to resolve my problem too?
>
>
> regards
> manuel
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I have a potentially stupid problem with PHP and MSSQL on a Windows
server...
I can connect to the database and insert data to the tables etc but cannot
retrieve data...
This is the code I'm using:
//-----------------------------------------------
$list2 = $conn->Execute("SELECT * FROM elive.registration") or
DIE($conn->ErrorMsg());
while (!$list2->EOF){
$Msku = $list2->Fields("sku");
$Mname = $list2->Fields("name");
$Memailaddress = $list2->Fields("emailadd");
$Mcountry = $list2->Fields("country");
$Mnumdevices = $list2->Fields("numdevices");
$Msource = $list2->Fields("source");
echo
"<tr><td>$Msku</td><td>$Mname</td><td>$Memailaddress</td><td>$Mcountry</td><
td>$Mnumdevices</td><td>$Msource</td></tr>";
$list2->MoveNext();
}
//-----------------------------------------------
The returned info is:
Object Object Object Object Object Object
Am I doing something stupid?
Presumably, the code is the same as I am already using on an adodb
connection on a Linux box to a MySQL server?
Thanks for the help
Enda
Enda Nagle
+353 86 168 0774
enda
nightsol.net
www.nightsol.net
attached mail follows:
try print_r($Msku) and see what comes out
Enda Nagle wrote:
> I have a potentially stupid problem with PHP and MSSQL on a Windows
> server...
>
> I can connect to the database and insert data to the tables etc but cannot
> retrieve data...
>
> This is the code I'm using:
>
> //-----------------------------------------------
> $list2 = $conn->Execute("SELECT * FROM elive.registration") or
> DIE($conn->ErrorMsg());
>
> while (!$list2->EOF){
>
> $Msku = $list2->Fields("sku");
> $Mname = $list2->Fields("name");
> $Memailaddress = $list2->Fields("emailadd");
> $Mcountry = $list2->Fields("country");
> $Mnumdevices = $list2->Fields("numdevices");
> $Msource = $list2->Fields("source");
>
> echo
> "<tr><td>$Msku</td><td>$Mname</td><td>$Memailaddress</td><td>$Mcountry</td><
> td>$Mnumdevices</td><td>$Msource</td></tr>";
> $list2->MoveNext();
> }
> //-----------------------------------------------
>
> The returned info is:
>
> Object Object Object Object Object Object
>
> Am I doing something stupid?
>
> Presumably, the code is the same as I am already using on an adodb
> connection on a Linux box to a MySQL server?
>
> Thanks for the help
>
> Enda
> Enda Nagle
> +353 86 168 0774
> enda
nightsol.net
> www.nightsol.net
>
attached mail follows:
Hi Marek,
Thanks for your reply.
Tried that and got the following output:
COM Object ( [0] => Resource id #3 ) COM Object ( [0] => Resource id #9 )
COM Object ( [0] => Resource id #15 ) COM Object ( [0] => Resource id #21 )
There are 4 records in the table at the moment, and its performing the loop
etc for the recordset but just isn't returning the data (or returning data
in a readable format).
Thanks
Enda
--
-----Original Message-----
From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
Sent: 27 January 2004 14:05
To: Enda Nagle
Cc: PHP List
Subject: Re: [PHP] MS SQL / PHP
try print_r($Msku) and see what comes out
Enda Nagle wrote:
> I have a potentially stupid problem with PHP and MSSQL on a Windows
> server...
>
> I can connect to the database and insert data to the tables etc but cannot
> retrieve data...
>
> This is the code I'm using:
>
> //-----------------------------------------------
> $list2 = $conn->Execute("SELECT * FROM elive.registration") or
> DIE($conn->ErrorMsg());
>
> while (!$list2->EOF){
>
> $Msku = $list2->Fields("sku");
> $Mname = $list2->Fields("name");
> $Memailaddress = $list2->Fields("emailadd");
> $Mcountry = $list2->Fields("country");
> $Mnumdevices = $list2->Fields("numdevices");
> $Msource = $list2->Fields("source");
>
> echo
>
"<tr><td>$Msku</td><td>$Mname</td><td>$Memailaddress</td><td>$Mcountry</td><
> td>$Mnumdevices</td><td>$Msource</td></tr>";
> $list2->MoveNext();
> }
> //-----------------------------------------------
>
> The returned info is:
>
> Object Object Object Object Object Object
>
> Am I doing something stupid?
>
> Presumably, the code is the same as I am already using on an adodb
> connection on a Linux box to a MySQL server?
>
> Thanks for the help
>
> Enda
> Enda Nagle
> +353 86 168 0774
> enda
nightsol.net
> www.nightsol.net
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You need to find out what $list2->Fields("sku"); returns. This is not
php anymore, check COM reference.
Enda Nagle wrote:
> Hi Marek,
>
> Thanks for your reply.
>
> Tried that and got the following output:
> COM Object ( [0] => Resource id #3 ) COM Object ( [0] => Resource id #9 )
> COM Object ( [0] => Resource id #15 ) COM Object ( [0] => Resource id #21 )
>
> There are 4 records in the table at the moment, and its performing the loop
> etc for the recordset but just isn't returning the data (or returning data
> in a readable format).
>
> Thanks
>
> Enda
> --
>
>
>
> -----Original Message-----
> From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
> Sent: 27 January 2004 14:05
> To: Enda Nagle
> Cc: PHP List
> Subject: Re: [PHP] MS SQL / PHP
>
>
> try print_r($Msku) and see what comes out
>
> Enda Nagle wrote:
>
>
>>I have a potentially stupid problem with PHP and MSSQL on a Windows
>>server...
>>
>>I can connect to the database and insert data to the tables etc but cannot
>>retrieve data...
>>
>>This is the code I'm using:
>>
>>//-----------------------------------------------
>>$list2 = $conn->Execute("SELECT * FROM elive.registration") or
>>DIE($conn->ErrorMsg());
>>
>>while (!$list2->EOF){
>>
>> $Msku = $list2->Fields("sku");
>> $Mname = $list2->Fields("name");
>> $Memailaddress = $list2->Fields("emailadd");
>> $Mcountry = $list2->Fields("country");
>> $Mnumdevices = $list2->Fields("numdevices");
>> $Msource = $list2->Fields("source");
>>
>>echo
>>
>
> "<tr><td>$Msku</td><td>$Mname</td><td>$Memailaddress</td><td>$Mcountry</td><
>
>>td>$Mnumdevices</td><td>$Msource</td></tr>";
>> $list2->MoveNext();
>>}
>>//-----------------------------------------------
>>
>>The returned info is:
>>
>> Object Object Object Object Object Object
>>
>>Am I doing something stupid?
>>
>>Presumably, the code is the same as I am already using on an adodb
>>connection on a Linux box to a MySQL server?
>>
>>Thanks for the help
>>
>>Enda
>>Enda Nagle
>>+353 86 168 0774
>>enda
nightsol.net
>>www.nightsol.net
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Got it!
The rs objects need to be written as follows:
to give the following code:
$list2 = $conn->Execute("SELECT * FROM elive.registration") or
DIE($conn->ErrorMsg());
while (!$list2->EOF){
$Msku = $list2->Fields("sku");
$Mname = $list2->Fields("name");
$Memailaddress = $list2->Fields("emailadd");
$Mcountry = $list2->Fields("country");
$Mnumdevices = $list2->Fields("numdevices");
$Msource = $list2->Fields("source");
print ("<tr><td>" . $list2->Fields["sku"]->value . "</td><td>" .
$list2->Fields["name"]->value . "</td><td>" .
$list2->Fields["emailadd"]->value . "</td><td>" .
$list2->Fields["country"]->value . "</td><td>" .
$list2->Fields["numdevices"]->value . "</td><td>" .
$list2->Fields["source"]->value . "</td></tr>");
$list2->MoveNext();
}
-----Original Message-----
From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
Sent: 27 January 2004 14:34
To: Enda Nagle
Cc: PHP List
Subject: Re: [PHP] MS SQL / PHP
You need to find out what $list2->Fields("sku"); returns. This is not
php anymore, check COM reference.
Enda Nagle wrote:
> Hi Marek,
>
> Thanks for your reply.
>
> Tried that and got the following output:
> COM Object ( [0] => Resource id #3 ) COM Object ( [0] => Resource id #9 )
> COM Object ( [0] => Resource id #15 ) COM Object ( [0] => Resource id
#21 )
>
> There are 4 records in the table at the moment, and its performing the
loop
> etc for the recordset but just isn't returning the data (or returning data
> in a readable format).
>
> Thanks
>
> Enda
> --
>
>
>
> -----Original Message-----
> From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
> Sent: 27 January 2004 14:05
> To: Enda Nagle
> Cc: PHP List
> Subject: Re: [PHP] MS SQL / PHP
>
>
> try print_r($Msku) and see what comes out
>
> Enda Nagle wrote:
>
>
>>I have a potentially stupid problem with PHP and MSSQL on a Windows
>>server...
>>
>>I can connect to the database and insert data to the tables etc but cannot
>>retrieve data...
>>
>>This is the code I'm using:
>>
>>//-----------------------------------------------
>>$list2 = $conn->Execute("SELECT * FROM elive.registration") or
>>DIE($conn->ErrorMsg());
>>
>>while (!$list2->EOF){
>>
>> $Msku = $list2->Fields("sku");
>> $Mname = $list2->Fields("name");
>> $Memailaddress = $list2->Fields("emailadd");
>> $Mcountry = $list2->Fields("country");
>> $Mnumdevices = $list2->Fields("numdevices");
>> $Msource = $list2->Fields("source");
>>
>>echo
>>
>
>
"<tr><td>$Msku</td><td>$Mname</td><td>$Memailaddress</td><td>$Mcountry</td><
>
>>td>$Mnumdevices</td><td>$Msource</td></tr>";
>> $list2->MoveNext();
>>}
>>//-----------------------------------------------
>>
>>The returned info is:
>>
>> Object Object Object Object Object Object
>>
>>Am I doing something stupid?
>>
>>Presumably, the code is the same as I am already using on an adodb
>>connection on a Linux box to a MySQL server?
>>
>>Thanks for the help
>>
>>Enda
>>Enda Nagle
>>+353 86 168 0774
>>enda
nightsol.net
>>www.nightsol.net
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Is there a way wuth php to create a list ordered by more than one column
like in excel or access.
something like "ORDER BY points AND score"
attached mail follows:
christian tischler wrote:
> Is there a way wuth php to create a list ordered by more than one column
> like in excel or access.
>
> something like "ORDER BY points AND score"
Use http://php.net/usort and use both 'columns' in the comparison function.
--
Stuart
attached mail follows:
christian tischler wrote:
> Is there a way wuth php to create a list ordered by more than one
> column like in excel or access.
>
> something like "ORDER BY points AND score"
You might want to look at GROUP BY command too
http://www.mysql.com/doc/en/Group_by_functions_and_modifiers.html
/T
attached mail follows:
... ORDER BY points [DESC|ASC], score [DESC|ASC]
christian tischler wrote:
> Is there a way wuth php to create a list ordered by more than one column
> like in excel or access.
>
> something like "ORDER BY points AND score"
>
attached mail follows:
Is there any good reference on how to use CRON (I mean on the net)?
I need to fire some PHP pages at scheduled time daily or weekly, ... so on.
Regards,
Hamid
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
attached mail follows:
[snip]
Is there any good reference on how to use CRON (I mean on the net)?
I need to fire some PHP pages at scheduled time daily or weekly, ... so
on.
[/snip]
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
attached mail follows:
Hamid Hossain wrote:
> Is there any good reference on how to use CRON (I mean on the net)?
>
> I need to fire some PHP pages at scheduled time daily or weekly, ... so on.
http://www.google.com/search?q=cron+tutorial+php
--
Stuart
attached mail follows:
On Tuesday 27 January 2004 07:13, Stuart wrote:
> Hamid Hossain wrote:
> > Is there any good reference on how to use CRON (I mean on the
> > net)?
> >
> > I need to fire some PHP pages at scheduled time daily or weekly,
> > ... so on.
>
> http://www.google.com/search?q=cron+tutorial+php
depending on how you need them to fire off
a) if cron is on the same machine as the php script, then write the
script as a command-line php script
http://www.php.net/manual/en/features.commandline.php
b) if cron is on a different machine, create a normal web php script
with some sort of security and use lynx -dump to call it from cron
lynx -dump https://user:pass
mymachine.com/iben1Bj7s1N/sEg4gIh6G.php
either way add the job to the /etc/crontab file
man 5 crontab
<minute> <hour> <day of month> <month> <day of week> <user> <command>
ie
27 2 * * * bob php4 -q /usr/local/scripts/update.php
at 2:27am everyday, run 'php4 -q /usr/local/scripts/update.php' as
the user bob
attached mail follows:
On Tue, 2004-01-27 at 08:08, Hamid Hossain wrote:
> Is there any good reference on how to use CRON (I mean on the net)?
>
The best source is the man page crontab(5)
--
Brian GnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQBAFpZ4LDUBEASk8NwRApeXAKCE4RSJ5HJ9UT5oLlItYesbSYVnpgCfYrfe
ZAn7y9s1r/SvaoXVGrlUn/4=
=8rHP
-----END PGP SIGNATURE-----
attached mail follows:
Is Googlebot (or any other bot) able to follow links that are php?
e.g.
<a href="Contact.php">Contact Us</a>
<a href="Product.php"><img src="Images/product.jpg" width="110" height="111"
border="0"></a>
Is there a way to invite bots to your site?
Thanks
Matt
attached mail follows:
Hartley, Matt wrote:
> Is Googlebot (or any other bot) able to follow links that are php?
>
> e.g.
> <a href="Contact.php">Contact Us</a>
> <a href="Product.php"><img src="Images/product.jpg" width="110" height="111"
> border="0"></a>
Yes.
> Is there a way to invite bots to your site?
For most, yes.
--
Stuart
attached mail follows:
If you read the pages on google you will know the answer.
Hartley, Matt wrote:
>Is Googlebot (or any other bot) able to follow links that are php?
>
>e.g.
><a href="Contact.php">Contact Us</a>
><a href="Product.php"><img src="Images/product.jpg" width="110" height="111"
>border="0"></a>
>
>Is there a way to invite bots to your site?
>
>Thanks
>Matt
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
That's not very helpful.
I am also curious about this.
Anyone have a more thought provoking answer?
Frank
--- Raditha Dissanayake <jabber
raditha.com> wrote:
> If you read the pages on google you will know the answer.
>
> Hartley, Matt wrote:
>
> >Is Googlebot (or any other bot) able to follow links that are
> php?
> >
> >e.g.
> ><a href="Contact.php">Contact Us</a>
> ><a href="Product.php"><img src="Images/product.jpg"
> width="110" height="111"
> >border="0"></a>
> >
> >Is there a way to invite bots to your site?
> >
> >Thanks
> >Matt
> >
> >
> >
>
>
> --
> Raditha Dissanayake.
>
------------------------------------------------------------------------
> http://www.radinks.com/sftp/ |
> http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file
> uploader
> Graphical User Inteface. Just 150 KB | with progress bar.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
attached mail follows:
Perhaps this link will help:
http://www.google.com/webmasters/
Frank Tudor wrote:
> That's not very helpful.
>
> I am also curious about this.
>
> Anyone have a more thought provoking answer?
>
> Frank
>
> --- Raditha Dissanayake <jabber
raditha.com> wrote:
>
>>If you read the pages on google you will know the answer.
>>
>>Hartley, Matt wrote:
>>
>>
>>>Is Googlebot (or any other bot) able to follow links that are
>>
>>php?
>>
>>>e.g.
>>><a href="Contact.php">Contact Us</a>
>>><a href="Product.php"><img src="Images/product.jpg"
>>
>>width="110" height="111"
>>
>>>border="0"></a>
>>>
>>>Is there a way to invite bots to your site?
>>>