php-windows Digest 3 Mar 2003 21:55:25 -0000 Issue 1616

Topics (messages 18811 through 18818):

Recommended for newbies
        18811 by: m1nt ch3w

Thank you! [GD Libraries]
        18812 by: Anthony Ritter

PHP array to JS function ???
        18813 by: Aidal
        18818 by: Chris Kranz

Re: include_path
        18814 by: Aidal

Re: PHP install on Windows98 and PWS
        18815 by: Aidal
        18816 by: Aidal

Mysql datetime field
        18817 by: s.garriock.rgc.aberdeen.sch.uk

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- I found this on the web. It includes apache, php, mysql and perl. All in an install program that sets it up for you. Good for people new to php. The latest version isn't free, but this one is:

http://download.com.com/3000-2165-6474268.html?legacy=cnet

Regards,
/m1nt


--- End Message ---
--- Begin Message ---
Thank you to all that came to my aid while I was muddleing through my
attempts to install GD Libraries.

Since I had various versions of PHP from textbook CD's - I downloaded PHP
Triad which happened to be PHP version 4.1.1

I changed two lines in the php.ini file and ran the phpinfo() function call
and GD showed up without the page hanging up.

In that version, there is no php_gd2.dll - just php_gd.dll.

Again...my sincerest thanks to all.
Tony Ritter





--- End Message ---
--- Begin Message ---
Hi NG.

I'm having some trouble parsing a php array to a javascript function.
I've searched the web and found that others before me have had the same
problem, but I haven't been able to find a solution to my problem yet.

simple function example:
"tal" is a php array and "count" is the size of that array.
The array "tal" and the var "count" has of cause been assigned values prior
to calling preload_images($tal, $count);
----------------------------------
<script language=javascript>
function preload_images(tal, count) {
    var pics = new Array(count);
    for (i = 0; i < count; i++) {
        var pic = new Image();
        pic.src = 'nef/graphic/ball_' + tal[i] + '.gif';
        pics[i] = pic;
        document.write(pic.src + '<br>');
    }
}
</script>
----------------------------------
The idea was just to pick up the images in the new array "pics" to make sure
the images were preloaded.
But I added the "document.write" statement to check the value of the image
path.
The result is as follows for sizeof($tal) = 14:
-------------------------------
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
--------------------------------
So my php array seems to have no values once in the javascript function. How
can I fix this?
Please help...

/Aidal




--- End Message ---
--- Begin Message ---
Far as I know, there's no way to take arrays like that and pass them
straight over to js.

I've done things like this before, and the only way I did it, was to get
PHP to print out the JS to define each item in the array seperatly. This
is a pretty simple way of doing it, and shouldn't make too much
difference to your scripting. It can still be dynamic as you like...

There may be some way of putting the array into the POST_VARS and then
getting JS to read it out of there, but that's just an idea, and I dunno
if that'd be supported at all.

chris kranz
fatcuban.com



-----Original Message-----
From: Aidal [mailto:[EMAIL PROTECTED] 
Sent: 03 March 2003 14:53
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PHP array to JS function ???


Hi NG.

I'm having some trouble parsing a php array to a javascript function.
I've searched the web and found that others before me have had the same
problem, but I haven't been able to find a solution to my problem yet.

simple function example:
"tal" is a php array and "count" is the size of that array.
The array "tal" and the var "count" has of cause been assigned values
prior to calling preload_images($tal, $count);
----------------------------------
<script language=javascript>
function preload_images(tal, count) {
    var pics = new Array(count);
    for (i = 0; i < count; i++) {
        var pic = new Image();
        pic.src = 'nef/graphic/ball_' + tal[i] + '.gif';
        pics[i] = pic;
        document.write(pic.src + '<br>');
    }
}
</script>
----------------------------------
The idea was just to pick up the images in the new array "pics" to make
sure the images were preloaded. But I added the "document.write"
statement to check the value of the image path. The result is as follows
for sizeof($tal) = 14:
-------------------------------
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
http://localhost/nef/graphic/ball_undefined.gif
--------------------------------
So my php array seems to have no values once in the javascript function.
How can I fix this? Please help...

/Aidal




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--- End Message ---
--- Begin Message ---
Having more than one file with the same name isn't a very good idea in the
first place if you ask me.
Also I do not know how Apache reacts to having more than 1 path assigned to
include_path.
If Apache thinks it's ok, then try to find answers to the following when
including/requireing files.

"which path gets looked at first?"
"if more then one file with the required name excists in one of the paths,
which will Apache then pick and why?"

If I were you I would:
1. maybe only use one include_path.
2. make sure that each file has a unique name.

That would solve many of you problems at hand as well as the many others you
have coming, as I see it.
I'm no pro myself though, but I have used php with Apache for some time now.


"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I'm new with php. I've installed  apache 1.27, php 4.2.2 with windows 2000
and I'm trying to realize a
web site.
The include_path setting is:
".;C:/xxx/yyy/includes/others;C:/xxx/yyy/includes/myfiles"
I get authentication.php in my include path and, unfortunatly, an other
authentication.php does exist in the 2° path and is processed before my
authentication.php file, and maybe gets a function name
like one of mine.
When, in a file I write: include("authentication.php"), my file is never
included; php includes the first
one that finds.
What can I do to resolve this problem?

Thanks.

John M.





--- End Message ---
--- Begin Message ---
<? phpinfo() ?>
This will probably not work since you do not tell the function what to do
with the returned value.

<? echo phpinfo(); ?> or <? print(phpinfo()); ?>
Should solve that problem.

/Aidal

"Keith Engelhardt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have installed PHP (using the install wizard and files from
> http://www.php.net/downloads.php on Windows98 and PWS. The PWS <Home>
> virtual directory
> to set for Read, Execute, and Scripts access. PWS sever is runing and it
> runs other web content (both html and ASP) fine. But I get a HTTP 500 -
> Internal server error when accessing a page (http://localhost/PHPtest.php)
> containing
>
> <html>
> <head>
> <body>
> <p>PHP Test</p>
> <?php phpinfo()?>
> </body>
> </head>
> </html>
>
> I have tested the PHP executable with c:\PHP\php.exe -i and it dumps the
> info file just fine.
>
> I have checked the registry and .ini file and the settings and they seem
to
> match all the areas covered in the "manual install" instructions at the
> http://localhost/PHPtest.php site. So, I assume the install wizard did its
> job.
>
> Can anyone suggest anything else to try? Or how to get PHP running on a
> Windows98 and PWS platform?
>
> Thanks in advance.
>
> Keith E.
> [EMAIL PROTECTED]
>
>
>
>



--- End Message ---
--- Begin Message ---
If what I wrote abowe doesnt work, then it is not a coding problem you have
at hand.
I don't know much about PWS but whereever you configure PWS try to find out
what kind of file extensions it knows and what actions it is set to take.
As in "what does PWS do when it incounters a *.asp file and what does it do
when it incounters a *.php file?"

Of cause you will get an error if PWS sends a *.php file to the ASP-parser,
so you have to make sure that PWS knows what to do with those files namely
send it to the PHP-parser.

/Aidal

"Aidal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> <? phpinfo() ?>
> This will probably not work since you do not tell the function what to do
> with the returned value.
>
> <? echo phpinfo(); ?> or <? print(phpinfo()); ?>
> Should solve that problem.
>
> /Aidal
>
> "Keith Engelhardt" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I have installed PHP (using the install wizard and files from
> > http://www.php.net/downloads.php on Windows98 and PWS. The PWS <Home>
> > virtual directory
> > to set for Read, Execute, and Scripts access. PWS sever is runing and it
> > runs other web content (both html and ASP) fine. But I get a HTTP 500 -
> > Internal server error when accessing a page
(http://localhost/PHPtest.php)
> > containing
> >
> > <html>
> > <head>
> > <body>
> > <p>PHP Test</p>
> > <?php phpinfo()?>
> > </body>
> > </head>
> > </html>
> >
> > I have tested the PHP executable with c:\PHP\php.exe -i and it dumps the
> > info file just fine.
> >
> > I have checked the registry and .ini file and the settings and they seem
> to
> > match all the areas covered in the "manual install" instructions at the
> > http://localhost/PHPtest.php site. So, I assume the install wizard did
its
> > job.
> >
> > Can anyone suggest anything else to try? Or how to get PHP running on a
> > Windows98 and PWS platform?
> >
> > Thanks in advance.
> >
> > Keith E.
> > [EMAIL PROTECTED]
> >
> >
> >
> >
>
>



--- End Message ---
--- Begin Message ---
Hi
I was wondering if anyone knew how to print out the field DATETIME from mysql.
I need it for a news system I am making.
 
Cheers

From Shaun Garriock
RGC Webmaster

 


--- End Message ---

Reply via email to