|
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 2006 05:07:17 -0000 Issue 3929
php-general-digest-help
lists.php.net
Date: Thu Jan 26 2006 - 23:07:17 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 27 Jan 2006 05:07:17 -0000 Issue 3929
Topics (messages 229316 through 229356):
copy problem with HTTP wrapper
229316 by: Laurent Vanstaen
229336 by: Richard Lynch
Re: Workaround ISP's redirect of 404 Not Found PHP pages?
229317 by: James Benson
229321 by: Jim McIntyre
229338 by: Richard Lynch
Re: News
229318 by: John Nichel
XML Session serializer - XMLDBX
229319 by: Mark
229322 by: Mark
Re: way to write mysqli result set to disk
229320 by: John Nichel
HTML Question?
229323 by: William Stokes
229324 by: David Grant
229330 by: William Stokes
229335 by: Richard Lynch
automating creation of thumbnails
229325 by: Geoff
229329 by: Weber Sites LTD
Re: [SOLVED] Re: usr VAR value as a VAR Name
229326 by: Chris Boget
header WWW-Authenticate Question
229327 by: News1
229328 by: Philip Hallstrom
229334 by: Richard Lynch
229337 by: Manuel Lemos
Apache is not parsing .php files
229331 by: sanjay
229349 by: Richard Lynch
229350 by: Ray Hauge
Connect to AS400
229332 by: Justin Cook
229348 by: Richard Lynch
229353 by: James Lobley
229354 by: James Lobley
Best way to handle PREVIOUS and NEXT processing of database records retrieved
229333 by: Sue
229339 by: Jay Paulson
229346 by: Weber Sites LTD
229347 by: Richard Lynch
Re: adapting some code from a phpbb mod to my site
229340 by: Richard Lynch
Re: Recursive array_push?
229341 by: Richard Lynch
Re: Use VAR string value AS VAR Name
229342 by: Richard Lynch
Basic OOP Question
229343 by: Chris Kennon
229344 by: Jay Paulson
229345 by: Richard Davey
Isolating a php directory on a main server
229351 by: The Doctor
229352 by: Ray Hauge
Re: Google using PHP
http://www.google-store.com
229355 by: ben johnson
Re: $_SESSION saves all values but Class -- works on one server butnot another?! [SOLVED]
229356 by: Daevid Vincent
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:
Hi all,
I'm trying to copy a file from my PHP server to another server (a home
gateway, called a LiveBox). I've used this code :
$livebox = "192.168.1.1";
...
...
...
$crontab_livebox = "http://".$livebox."/cgi-bin/newCrontab";
if (!copy($crontab_temp_name, $crontab_livebox)) {
echo "<br />Impossible to copy the temp crontab file to the Livebox.<br
/>";
}
I get the following error :
"HTTP wrapper does not support writeable connections"
OK can I solve this. Can't I use URLs with the "copy" function if they don't
point to my PHP server (local URLs) ? How can I copy a file from my PHP
server to another server (there's no FTP server on the destination machine)
?
Thanks,
Laurent Vanstaen
attached mail follows:
On Thu, January 26, 2006 9:28 am, Laurent Vanstaen wrote:
> Hi all,
> I'm trying to copy a file from my PHP server to another server (a
> home
> gateway, called a LiveBox). I've used this code :
>
> $livebox = "192.168.1.1";
> ...
> ...
> ...
> $crontab_livebox = "http://".$livebox."/cgi-bin/newCrontab";
> if (!copy($crontab_temp_name, $crontab_livebox)) {
> echo "<br />Impossible to copy the temp crontab file to the
> Livebox.<br
> />";
> }
>
> I get the following error :
> "HTTP wrapper does not support writeable connections"
>
> OK can I solve this. Can't I use URLs with the "copy" function if they
> don't
> point to my PHP server (local URLs) ? How can I copy a file from my
> PHP
> server to another server (there's no FTP server on the destination
> machine)
> ?
Put it this way:
If what you typed above *DID* work, what's to stop *ME* from copying
whatever I want onto your server?...
You probably need to use cURL to login to your livebox, and then POST
the data into the newCrontab form handler.
The basic idea is to use cURL to "fake out" the LiveBox into thinking
that it's really you sitting there typing things.
So you would want to have your browser open and go through the process
"by hand" while you code your cURL script, and look at "View Source"
in your browser for the LiveBox login, and what the cURL script gets,
and then you POST the username/password to mimic a login, and then you
will get back some Cookies, most likely, and then you should be able
to send back those cookies and your new crontab into the form --
Essentially walking your PHP script through the exact same steps you
would take to do it by hand.
http://php.net/curl
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
>> PHP is running as a CGI on the shared hosting servers, which is
>> why your .htaccess isn't working for it.
>>
>> You will have to create the error rule within a php.ini file.
>
That is so much bull, how then can it work for NON .php files?
I know for a fact that CGI does not prevent you using .htaccess or the
ErrorDocument directive in apache because Im using one myself right now
in CGI mode and it works just fine, does your webhost use a custom error
page that advertises its own services or provides a link to their
website by any chance?
James
---------------------------------------------------------
Master CIW Designer http://www.ciwcertified.com
Zend Certified Engineer http://www.zend.com
http://www.jamesbenson.co.uk
---------------------------------------------------------
attached mail follows:
At 3:32 PM +0000 1/26/06, James Benson wrote:
>>> PHP is running as a CGI on the shared hosting servers, which is
>>> why your .htaccess isn't working for it.
>>>
>>> You will have to create the error rule within a php.ini file.
>
>That is so much bull, how then can it work for NON .php files?
>
>I know for a fact that CGI does not prevent you using .htaccess or
>the ErrorDocument directive in apache because Im using one myself
>right now in CGI mode and it works just fine, does your webhost use
>a custom error page that advertises its own services or provides a
>link to their website by any chance?
Well, laboring under the assumption that everything they tell me is
bull, I looked the other way and found a solution. Thanks also to
Barry for this:
At 3:42 PM +0100 1/26/06, Barry wrote:
>Best thing is probably to use a rewrite rule.
>So if the error.html should be desplayed the rewrite rule opens the .php file.
In .htaccess, I replaced
ErrorDocument 404 /not_found.php
with
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /not_found.php
and it seems to be working.
Many, many thanks to you both. I should have started here - it would
have saved me about two weeks. No lie.
Peace,
Jim
attached mail follows:
On Thu, January 26, 2006 9:32 am, James Benson wrote:
>>> PHP is running as a CGI on the shared hosting servers, which is
>>> why your .htaccess isn't working for it.
>>>
>>> You will have to create the error rule within a php.ini file.
>>
>
>
> That is so much bull, how then can it work for NON .php files?
>
> I know for a fact that CGI does not prevent you using .htaccess or the
> ErrorDocument directive in apache because Im using one myself right
> now
> in CGI mode and it works just fine, does your webhost use a custom
> error
> page that advertises its own services or provides a link to their
> website by any chance?
Perhaps his host has somehow managed to force PHP CGI to kick in
*BEFORE* the ErrorDocument of Apache...
Now, I got no idea how they would manage to do that, but it seems like
a reasonable assumption...
WILD GUESS:
If they do PHP CGI with EngineRewrite, and if that takes effect before
the ErrorDocument handler, as I suspect it would, then it would
explain this behaviour, and their response, without the sinister
implications James suggests.
They may even be laboring under the impression that that's the only
way to make PHP CGI work.
More likely, they think it's the best way to make it work for them and
their customers.
I'm not aware of any kind of 404 settings avaiable in php.ini, but
perhaps they just assumed it could be done in php.ini to handle
non-existent files in some way.
From the phpinfo URL provided by the OP, it looks like they are giving
him PHP CGI with his own php.ini file to tinker with, which could be
quite handy, compared to some shard hosting environments I've suffered
through...
What's that old saying?
Never assign to malice what can be explained by sheer stupidity.
Something like that.
I've come to realize, as I get older, that what we often perceive as
some sort of diabolical plot to foil us, is just some other poor guy
doing the best they can with what they've got, and our failure to
appreciate what it is they are offering/doing and why.
Jeez, now I feel like I gotta go watch Karate Kid or something...
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
dd
cron.ru wrote:
> Your archive is attached.
I wonder how many people opened this.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
Well, last week or so I noticed that Squirrelmail's session array contained
recursive variable references and caused my serializer to crash on infinite
recursion. Oh well, that's life.
I found the time to add a variable stack for encoding to XML. If a variable
is "is_ref" or has a "refcount" greater than 1, the variable stack is
searched for a previous occurrence. If the variable has not been seen
previously, it is push onto the stack. If it has, only a reference ID of
the previous variable is saved in the xml stream.
is_ref and refcount are now added as attributes in the XML stream.
Anyone want to lend a hand and test the serializer?
attached mail follows:
Mark wrote:
> Well, last week or so I noticed that Squirrelmail's session array
> contained recursive variable references and caused my serializer to crash
> on infinite recursion. Oh well, that's life.
>
> I found the time to add a variable stack for encoding to XML. If a
> variable is "is_ref" or has a "refcount" greater than 1, the variable
> stack is
> searched for a previous occurrence. If the variable has not been seen
> previously, it is push onto the stack. If it has, only a reference ID of
> the previous variable is saved in the xml stream.
>
> is_ref and refcount are now added as attributes in the XML stream.
>
> Anyone want to lend a hand and test the serializer?
Doh!!
www.mohawksoft.org
In the "Code and Documentation" section, click on "CVS Access" and follow
the instructions for XMLDBX PHP Extension
attached mail follows:
James Benson wrote:
> jonathan wrote:
>
>> hmm.... is this a mysql 5 feature. could be interesting but haven't
>> heard much about it.
>>
>
>
>
> You cannot see the mysql 5 plastered all over the page?
>
>
> I can see at least 5 different sections that say MySQL 5
http://dev.mysql.com/doc/refman/5.1/en/insert.html
Can you see mysql 5.1 plastered all over the page?
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
Hello,
This is totally HTML question but I had to post cause I can't get this one
to work myself....
How to print tables to a page so that they are placed side by side
horizontally as long as there is screen width left and then continue to
second row below? Like in many image galleries where thumpnails are dumped
to screen and the lines of thumpnails scale dynamically according to screen
widht.
I need to dump my thumpnails to screen and add some image info below every
thumpnail and I want to take advantage of the whole screen widht.
Thanks
-Will
attached mail follows:
William,
William Stokes wrote:
> How to print tables to a page so that they are placed side by side
> horizontally as long as there is screen width left and then continue to
> second row below? Like in many image galleries where thumpnails are dumped
> to screen and the lines of thumpnails scale dynamically according to screen
> widht.
>
> I need to dump my thumpnails to screen and add some image info below every
> thumpnail and I want to take advantage of the whole screen widht.
http://www.alistapart.com/articles/practicalcss/
David
--
David Grant
http://www.grant.org.uk/
attached mail follows:
Jawohl :)
"David Grant" <david
grant.org.uk> kirjoitti
viestissä:43D909B5.9050304
grant.org.uk...
> William,
>
> William Stokes wrote:
>> How to print tables to a page so that they are placed side by side
>> horizontally as long as there is screen width left and then continue to
>> second row below? Like in many image galleries where thumpnails are
>> dumped
>> to screen and the lines of thumpnails scale dynamically according to
>> screen
>> widht.
>>
>> I need to dump my thumpnails to screen and add some image info below
>> every
>> thumpnail and I want to take advantage of the whole screen widht.
>
> http://www.alistapart.com/articles/practicalcss/
>
> David
> --
> David Grant
> http://www.grant.org.uk/
attached mail follows:
On Thu, January 26, 2006 11:35 am, William Stokes wrote:
> This is totally HTML question but I had to post cause I can't get this
> one
> to work myself....
>
> How to print tables to a page so that they are placed side by side
> horizontally as long as there is screen width left and then continue
> to
> second row below? Like in many image galleries where thumpnails are
> dumped
> to screen and the lines of thumpnails scale dynamically according to
> screen
> widht.
>
> I need to dump my thumpnails to screen and add some image info below
> every
> thumpnail and I want to take advantage of the whole screen widht.
Those aren't tables, that's CSS, almost for sure...
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
I remember the other day someone was asking for a way to easily
create a bunch of thumbnails from image files. I just spotted this:
http://www.phpclasses.org/browse/package/2846.html
"This is a simple class that can be used to generate thumbnails of
image files. It can resize the images so they do not exceed a given
width or height. The images are loaded as true color to preserve the
quality as much as possible during the rescale operation. Currently,
the images can be loaded and saved in the JPEG and GIF formats."
Geoff.
attached mail follows:
Here are some more to check out :)
Dynamic Thumbnail Generation
http://www.weberdev.com/ViewArticle-388.html
upload one or more files, and show thumbs and html code of images, I images
were uploaded.
http://www.weberdev.com/get_example-3083.html
Image Upload And Resize Script
http://www.weberdev.com/get_example-3938.html
Sincerely
berber
Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
Free Uptime Monitor : http://uptime.weberdev.com
PHP content for your site : http://content.weber-sites.com
-----Original Message-----
From: Geoff [mailto:php-general
2yd.com]
Sent: Thursday, January 26, 2006 8:13 PM
To: php-general
lists.php.net
Subject: [PHP] automating creation of thumbnails
I remember the other day someone was asking for a way to easily create a
bunch of thumbnails from image files. I just spotted this:
http://www.phpclasses.org/browse/package/2846.html
"This is a simple class that can be used to generate thumbnails of image
files. It can resize the images so they do not exceed a given width or
height. The images are loaded as true color to preserve the quality as much
as possible during the rescale operation. Currently, the images can be
loaded and saved in the JPEG and GIF formats."
Geoff.
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
>> Let me start by saying there is nothing wrong with the above and it's
>> doing exactly what the OP needed. However, when I use variable
>> variables, I prefer to use the following notation:
>> ${$foo}
>> It makes the coder's intention clear and makes it so that it can't be
>> mistaken for a possible typo when someone comes in after the fact to
>> maintain the code.
> And When I use this and when i use that. Oh i like this ^_^
> Btw. my working buddys said on first view your example looked more wrong.
Try it and see. ;)
> And on top of that, i wont let anyone code in my PHP docs who doesn't know
> what $$var is or does!!
Agreed. But there have been a few times when I accidently added in an
extra $ to the variable and, consequently, didn't get the results I
expected.
thnx,
Chris
attached mail follows:
Hi.
I have been looking for this in several areas and I can't seem to find it.
I'm new to PHP (any programming since FORTRAN, really :) so please forgive
my ignorance.
I am trying to send username/password credentials to a web server using a
PHP script. This is done to automatically log into a web camera from my
workstation. I don't know if the header www-authenticate option is the
correct one (or if it's even possible) to use for this.
Any help is appreciated.
Thanks!
attached mail follows:
> I have been looking for this in several areas and I can't seem to find it.
> I'm new to PHP (any programming since FORTRAN, really :) so please forgive
> my ignorance.
>
> I am trying to send username/password credentials to a web server using a
> PHP script. This is done to automatically log into a web camera from my
> workstation. I don't know if the header www-authenticate option is the
> correct one (or if it's even possible) to use for this.
Depending on what you're doing it might be as easy as:
http://user:pass
host/path?query=string
If all you need to do is suck down a page that would do it. If your
POSTING check the HTTP RFC for what headers to send...
-philip
attached mail follows:
On Thu, January 26, 2006 1:02 pm, News1 wrote:
> I am trying to send username/password credentials to a web server
> using a
> PHP script. This is done to automatically log into a web camera from
> my
> workstation. I don't know if the header www-authenticate option is
> the
> correct one (or if it's even possible) to use for this.
I think www-authenticate is what the server sends to the browser, not
the other way around.
I'm guessing that since it's called PHP_AUTH_USER and PHP_AUTH_PW in
PHP, that you would need to send:
GET / HTTP/1.0
AUTH_USER: $username
PATH_PW: $password
Host: example.com
You may also want to look into:
http://php.net/curl
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Hello,
> I am trying to send username/password credentials to a web server using a
> PHP script. This is done to automatically log into a web camera from my
> workstation. I don't know if the header www-authenticate option is the
> correct one (or if it's even possible) to use for this.
You may want to try this HTTP client class. It comes with HTTP
authentication support using the SASL library package. The example
test_http.php has some comments to let you know how to configure the
authetication support:
http://www.phpclasses.org/httpclient
http://www.phpclasses.org/sasl
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Hi,
I have a strange problem while trying to run php based applications.
Lets start with phpMyAdmin, a very popular open source tool to manage
MySQL written in php.
I have already installed phpMyAdmin and was running fine.
One day suddenly when I pointed my browser at :
http://localhost/phpMyAdmin
Instead of running the phpMyAdmin browser opened a message window with
options-
"Open With" or "Save to disk" .
I am sure its not browser problem because I tried on Firefox-1.5,
Mozilla, Epiphany and Konqueror.
One more point I would like to add here that if I write one small php
program and
save it in as php file (test.php) then
http://localhost/test.php
executes properly
I am using Fedora 2 and apache2, php-4.3x and mysql-3.x were part of the
Fedora installation.
The only change I made in the /etc/php.ini file was to increase the
memory limit from 8MB to 12MB.
(Then restarted the http server)
Now even php.ini file is in the original state but problem is still there.
The http.conf file is unchanged.
Can any one give me some sort of idea.
Thanks,
Sanjay
attached mail follows:
On Thu, January 26, 2006 2:19 pm, sanjay wrote:
> I have a strange problem while trying to run php based applications.
>
> Lets start with phpMyAdmin, a very popular open source tool to manage
> MySQL written in php.
> I have already installed phpMyAdmin and was running fine.
> One day suddenly when I pointed my browser at :
> http://localhost/phpMyAdmin
> Instead of running the phpMyAdmin browser opened a message window with
> options-
> "Open With" or "Save to disk" .
> I am sure its not browser problem because I tried on Firefox-1.5,
> Mozilla, Epiphany and Konqueror.
>
> One more point I would like to add here that if I write one small php
> program and
> save it in as php file (test.php) then
> http://localhost/test.php
> executes properly
>
> I am using Fedora 2 and apache2, php-4.3x and mysql-3.x were part of
> the
> Fedora installation.
> The only change I made in the /etc/php.ini file was to increase the
> memory limit from 8MB to 12MB.
> (Then restarted the http server)
> Now even php.ini file is in the original state but problem is still
> there.
> The http.conf file is unchanged.
>
>
> Can any one give me some sort of idea.
My first WILD GUESS is that way long time ago, you changed httpd.conf
and/or php.ini, but forgot to re-start Apache, and then tested, and
everything worked, so you went on.
Now, when you HAVE re-started Apache, your "fix" from ages ago is
finally kicking in, and you have no recollection of that change.
If you have log files or notes of changes made previously, especially
to httpd.conf, php.ini, or .htaccess, review them -- Keep in mind that
what you are calling your "original" httpd.conf and php.ini file are,
in fact, the ones you modified oh so long ago.
Another tack you can take is to go ahead and save what the browser is
sending you and look at it and see what it looks like.
PHP Source?
Or something else?
Also use telnet or curl (from another box) or similar to get the
headers and HTML that is coming out from the broken pages.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Thursday 26 January 2006 03:28 pm, Richard Lynch wrote:
> On Thu, January 26, 2006 2:19 pm, sanjay wrote:
> > I have a strange problem while trying to run php based applications.
> >
> > Lets start with phpMyAdmin, a very popular open source tool to manage
> > MySQL written in php.
> > I have already installed phpMyAdmin and was running fine.
> > One day suddenly when I pointed my browser at :
> > http://localhost/phpMyAdmin
> > Instead of running the phpMyAdmin browser opened a message window with
> > options-
> > "Open With" or "Save to disk" .
> > I am sure its not browser problem because I tried on Firefox-1.5,
> > Mozilla, Epiphany and Konqueror.
> >
> > One more point I would like to add here that if I write one small php
> > program and
> > save it in as php file (test.php) then
> > http://localhost/test.php
> > executes properly
> >
> > I am using Fedora 2 and apache2, php-4.3x and mysql-3.x were part of
> > the
> > Fedora installation.
> > The only change I made in the /etc/php.ini file was to increase the
> > memory limit from 8MB to 12MB.
> > (Then restarted the http server)
> > Now even php.ini file is in the original state but problem is still
> > there.
> > The http.conf file is unchanged.
> >
> >
> > Can any one give me some sort of idea.
>
> My first WILD GUESS is that way long time ago, you changed httpd.conf
> and/or php.ini, but forgot to re-start Apache, and then tested, and
> everything worked, so you went on.
>
> Now, when you HAVE re-started Apache, your "fix" from ages ago is
> finally kicking in, and you have no recollection of that change.
>
> If you have log files or notes of changes made previously, especially
> to httpd.conf, php.ini, or .htaccess, review them -- Keep in mind that
> what you are calling your "original" httpd.conf and php.ini file are,
> in fact, the ones you modified oh so long ago.
>
> Another tack you can take is to go ahead and save what the browser is
> sending you and look at it and see what it looks like.
>
> PHP Source?
>
> Or something else?
>
> Also use telnet or curl (from another box) or similar to get the
> headers and HTML that is coming out from the broken pages.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
I ran into this a while ago. My hosting company did some "updates" and messed
up the httpd.conf file. I eventually tracked it down to the php directives
being a bit mangled. Make sure that Apache is loading the PHP module, and
that you are telling apache how to handle php files.
Since you have apache2, check the /etc/httpd/conf.d/php.conf file to make sure
that LoadModule, AddHandler, AddType, and DirectoryIndex are all in there.
HTH
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099
attached mail follows:
We need to connect to a database on our AS400. Would this be best accomplished with ODBC? If not, what is the preferred method? Thanks!
attached mail follows:
On Thu, January 26, 2006 2:23 pm, Justin Cook wrote:
> We need to connect to a database on our AS400. Would this be best
> accomplished with ODBC? If not, what is the preferred method? Thanks!
The AS400 was discussed on this list, or possible on the predecessor
list which was just php
lists.php.net back in the day when there was
only one PHP mailing list (not counting internal developer lists).
As I recall, a straight ODBC connection was not quite enough, and some
Voodoo had to be performed to get it to work, but it was possible.
I also vaguely recall that the AS400 ended up being READ-ONLY, at
least under one variant of that voodoo...
But this is going WAAAAAAY back in time, so you'll need to search the
archives to confirm.
But, for sure, some developers have faced and at least partially
solved this at some time in the past, so it's worth digging for it.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On 1/26/06, Justin Cook <jcook
mwenergy.com> wrote:
>
> We need to connect to a database on our AS400. Would this be best
> accomplished with ODBC? If not, what is the preferred method? Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Talking from a Windows point of view, you will need the AS400 Client Access
software (or similar - I think it has a new name now!) installed on the
machine you are trying to connect from.
Once this is done, you need to set up a data source in ODBC - System DSN
works best, then use the standard ODBC calls within PHP to access the
database.
If you need further detail, I should be able to help you once I get to work
in about 8 hours!
attached mail follows:
On 1/26/06, Richard Lynch <ceo
l-i-e.com> wrote:
>
> On Thu, January 26, 2006 2:23 pm, Justin Cook wrote:
> > We need to connect to a database on our AS400. Would this be best
> > accomplished with ODBC? If not, what is the preferred method? Thanks!
>
> The AS400 was discussed on this list, or possible on the predecessor
> list which was just php
lists.php.net back in the day when there was
> only one PHP mailing list (not counting internal developer lists).
>
> As I recall, a straight ODBC connection was not quite enough, and some
> Voodoo had to be performed to get it to work, but it was possible.
>
> I also vaguely recall that the AS400 ended up being READ-ONLY, at
> least under one variant of that voodoo...
From my experience, when the ODBC driver (for windows at least) is
installed, it defaults to read-only.
From memory, this can be changed simply by ticking a check box to allow
writes.
attached mail follows:
I am retrieving records from a MySQL database and need to just display each
record one after the other on a page. I only want to display a maximum of
25 records per page though, and am wondering if there is a way to handle
this easily within PHP? I'd like to use something like NEXT and PREVIOUS as
links to go back and forth from each of the pages if there is more than 1
page of data to display. Any examples/ideas would be greatly appreciated.
Thanks in advance!
attached mail follows:
You could always use the LIMIT functionality in MySQL
SELECT * FROM table LIMIT 0,25
Then just pass the variables for the limit to start at and how many you want
returned in your query.
SELECT * FROM table LIMIT $start,$num_returned
So looking at records 26 through 50 your links would look like below.
<a href="file.php?start=51&num_returned=25">Next</a> |
<a href="file.php?start=0&num_returned=25">Previous
Just make sure you check your variables so they are numbers to avoid any
kind of SQL injection.
On 1/26/06 2:27 PM, "Sue" <skot1
twcny.rr.com> wrote:
> I am retrieving records from a MySQL database and need to just display each
> record one after the other on a page. I only want to display a maximum of
> 25 records per page though, and am wondering if there is a way to handle
> this easily within PHP? I'd like to use something like NEXT and PREVIOUS as
> links to go back and forth from each of the pages if there is more than 1
> page of data to display. Any examples/ideas would be greatly appreciated.
>
> Thanks in advance!
attached mail follows:
Check out :
Pagination
http://www.weberdev.com/get_example-4242.html
Sincerely
berber
Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
PHP code examples : http://www.weberdev.com
Free Uptime Monitor : http://uptime.weberdev.com
PHP content for your site : http://content.weber-sites.com
-----Original Message-----
From: Sue [mailto:skot1
twcny.rr.com]
Sent: Thursday, January 26, 2006 10:27 PM
To: php-general
lists.php.net
Subject: [PHP] Best way to handle PREVIOUS and NEXT processing of database
records retrieved
I am retrieving records from a MySQL database and need to just display each
record one after the other on a page. I only want to display a maximum of
25 records per page though, and am wondering if there is a way to handle
this easily within PHP? I'd like to use something like NEXT and PREVIOUS as
links to go back and forth from each of the pages if there is more than 1
page of data to display. Any examples/ideas would be greatly appreciated.
Thanks in advance!
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
On Thu, January 26, 2006 2:27 pm, Sue wrote:
> I am retrieving records from a MySQL database and need to just display
> each
> record one after the other on a page. I only want to display a
> maximum of
> 25 records per page though, and am wondering if there is a way to
> handle
> this easily within PHP? I'd like to use something like NEXT and
> PREVIOUS as
> links to go back and forth from each of the pages if there is more
> than 1
> page of data to display. Any examples/ideas would be greatly
> appreciated.
There are probably a few thousand PHP / MySQL "pagination" classes out
there...
http://info.com/php+mysql+pagination
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Thu, January 26, 2006 7:46 am, Barry wrote:
> 7BoZaR secret wrote:
>> Hello,
>>
>> I wish to integrate some code of MOD for phpbb forum named
>> "gf-portail": http://www.gf-phpbb.info/dlfile.php?id=31 , to my
>> HTML
>> website.
>>
>> In the menus of right-hand side (Last subjects, Which is on line?,
>> Statistics) however variables models and models files make me mad
>> ( i am beginner at PHP ) (root\modportal: mod_recent_topics.php,
>> mod_whoisonline.php, mod_statistiques.php and
>> \root\templates\subSilver\modportal: mod_recent_topics.tpl,
>> mod_whoisonline.tpl, mod_statistiques.tpl)
>>
>> could you help me???
Because your question is so specific, you probably should check in a
phpBB forum, or even one specfically for gf-portail...
PS
The English word you are using "mad" should probably be "crazy" to
avoid confusion for American readers... "mad" == "angry"
Though I suspect the Brits would disagree with me on that. :-)
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Thu, January 26, 2006 2:50 am, Kim Christensen wrote:
> Has anyone out there stumbled over the issue of making
> multi-dimensional arrays out of bracket-separated strings? In a less
> fuzzy way of putting it:
>
> $str = "[layer1][layer2][layer3][layer4]"
>
> would become
>
> $str_array = Array( [layer1] => Array( [layer2] => Array( [layer3] =>
> Array( [layer4] ) ) ) );
>
> ...or something similar. Passing values is not an issue at the moment,
> it's just the recursive thinking that keeps bugging me right now, and
> my temporary solution to this matter is not even mentionable!
To keep in theme with the hack-o-rama, even though I think it's a
lousy way to do this...
$str = substr($str, 1, -1); //chop off lead/end square brackets
$layers = explode('][', $str);
$str_array = array();
$layers = array_reverse($layers);
foreach($layers as $layer){
$str_array[] = $layer;
$str_array = array($str_array);
//or something like that...
}
> I would really like PHP to have a function of building expressions
> with strings, and then execute them through a function - but that's
> just me it seems :-)
I think you mean this one:
http://php.net/eval
:-)
Though the other suggestion might be more suitable to what you are doing:
http://php.net/create_function
You may want to post the Big Picture of what you are doing and how you
got that string in the first place, because 99 times out of 100, when
people use eval, there's an easier way to do it.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Wed, January 25, 2006 6:11 pm, Fernando Anchorena wrote:
> I'm stuck trying to get work this :
>
> This is an example
> page1.php
> =======================================
> <form action="/page2.php?form=yes" method="post">
> $sql_pro ="SELECT Sid FROM table";
> $res_pro =
mysql_query( $sql_pro);
> while ($campo_pro =
mysql_fetch_array($res_pro)) {
> $sid_pro = $campo_pro["Sid"]; // *sid_pro = 4*
> $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of
> $sid_pro as a VAR name *$sid_pro = p4*
> print "<td > *<input name='$sid_pro' type= 'radio'
> value='SOLVE_ME'/>* </td>"; // *name=p4 *
> BLA BLA BLA
> }
> SUBMIT FORM
> =======================================
>
> page2.php
> =======================================
> $sqlname = "SELECT Sid FROM Table";
> $res = mysql_query ($sqlname) ;
> while ($campo_pro = mysql_fetch_array($res)) {
> $name1 = $campo_pro["Sid"]; // *$name1 = 4*
> $radio = '$'.'p'.$name1 ; // *$radio = $p4
> ----------------------
> Now the Problem
> **How can I get the Value SOLVE_ME from the submited form ?*
>
> }
> ======================================
While Variable Variables solve the original question, as asked, I
suspect you'd be better off using:
... NAME="camp_pro[<?php echo $sid_pro?>]" ...
in your radio buttons.
HTML and browsers will treat the radio buttons as "the same" if the
camp_pro part matches, and you'll have $sid_pro
I confess the formatting left me a bit confused as to which variable
you want where, but I suspect resorting to Variable Variables is not
needed at all.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Hi,
This is my first post so a cheery hello, this script from php.net:
[www.php.net]
<?php
class SimpleClass
{
// member declaration
public $var = 'a default value';
// method declaration
public function displayVar() {
echo $this->var;
}
}
mySimpleClass = new SimpleClass();
?>
Returned this:
Parse error: parse error, unexpected T_STRING, expecting T_FUNCTION
in /Users/chris/Sites/php/oop/simple.php on line 4
I'm running PHP Version 5.0.4, with MAC OS 10.4.4
attached mail follows:
> Hi,
> This is my first post so a cheery hello, this script from php.net:
>
>
> [www.php.net]
>
> <?php
> class SimpleClass
> {
> // member declaration
> public $var = 'a default value';
>
> // method declaration
> public function displayVar() {
> echo $this->var;
> }
> }
>
> mySimpleClass = new SimpleClass();
> ?>
You need to change the last line there.
$mySimpleClass = new SimpleClass();
There's no '$'
>
>
> Returned this:
> Parse error: parse error, unexpected T_STRING, expecting T_FUNCTION
> in /Users/chris/Sites/php/oop/simple.php on line 4
>
>
>
> I'm running PHP Version 5.0.4, with MAC OS 10.4.4
attached mail follows:
On 26 Jan 2006, at 21:42, Chris Kennon wrote:
> mySimpleClass = new SimpleClass();
$mySimpleClass
^
^
^
Cheers,
Rich
--
http://www.corephp.co.uk
Zend Certified Engineer
PHP Development Services
attached mail follows:
How can one do this ?? CLient wants to isolate away so
development code so that only he can upload it and no one in the world can
see it.
--
Member - Liberal International
This is doctor
nl2k.ab.ca Ici doctor
nl2k.ab.ca
God Queen and country! Beware Anti-Christ rising!
Born 29 Jan 1969 Redhill Surrey UK
attached mail follows:
On Thursday 26 January 2006 03:48 pm, The Doctor wrote:
> How can one do this ?? CLient wants to isolate away so
> development code so that only he can upload it and no one in the world can
> see it.
>
> --
> Member - Liberal International
> This is doctor
nl2k.ab.ca Ici doctor
nl2k.ab.ca
> God Queen and country! Beware Anti-Christ rising!
> Born 29 Jan 1969 Redhill Surrey UK
If I'm reading this right, this sounds like more of a webserver issue. If
you're using Apache, then you could probably put in a <Directory> directive
to lock it down to his IP (if he is static). You could also put the
user/pass authentication in there.
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099
attached mail follows:
Oscommerce itself hasn't released a new version for an age. I am guessing
their next release will be better. Still ive seen a lot worse... Strange
javascript with frames aggh!
I think it was a quick knock-up job to see if anyone else would buy their
tat. I don't see the google radio they sent me the other year for spendng so
much on adwords though. ;)
On 1/25/06, tedd <tedd
sperling.com> wrote:
>
> >They are using oscommerce specifically. An open source PHP shopping cart.
>
> ben:
>
> Not that you said or implied otherwise.
>
> <soapbox>
> PHP or not, there's no reason I know of for not complying with w3c --
> especially if you're high profile like Google. It's clear that they
> are not concerned with disability issues.
> </soapbox>
>
> tedd
>
>
>
> >I have also come accross php errrors when accessing googles suggest
> >feature, some strange reaction with greesemonkey.
> >
> >On 1/25/06, tedd <<mailto:tedd
sperling.com>tedd
sperling.com> wrote:
> >
> > >Looks like google are using PHP and oscommerce for their web store:
> >><http://www.google-store.com>http://www.google-store.com
> >>
> >>Nice to see :)
> >>
> >>James
> >
> >It would be nice to see them being w3c compliant, but they aren't.
> >
> >tedd
> >
> >--
>
> >--------------------------------------------------------------------------------
> ><http://sperling.com/>http://sperling.com/
> >
> >--
> >PHP General Mailing List (<http://www.php.net/> http://www.php.net/)
> >To unsubscribe, visit:
> ><http://www.php.net/unsub.php>http://www.php.net/unsub.php
>
>
> --
>
> --------------------------------------------------------------------------------
> http://sperling.com/
>
attached mail follows:
UGH!!!!
After a WEEK of wasted time, I finally tracked this down.
If you have a __destructor() on a class object that you're saving in a
$_SESSION, then that object will have all it's values NULL'd out when you
call session_start() and retrieve it.
http://www.php.net/session-set-save-handler
"Write and Close handlers are called AFTER destructing objects since PHP
5.0.5. Thus destructors can use sessions but session handler can't use
objects. In prior versions, they were called in the opposite order. It is
possible to call session_write_close() from the destructor to solve this
chicken and egg problem. "
Why wouldn't you save the session values out BEFORE destroying them? Why
should the programmer be burdened with this crap? It worked just fine in
prior versions and now it's broken in my opinion.
So you have to do something like this now:
function __destruct()
{
session_write_close();
foreach($this as $key => $value)
unset($this->$key);
}
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]