php-windows Digest 16 Sep 2003 16:35:43 -0000 Issue 1912
Topics (messages 21390 through 21397):
Re: calling a php script
21390 by: Sek-Mun Wong
21393 by: Luis Moreira
session and cookie
21391 by: Exiang
Re: clearing cache ...... still not workin out
21392 by: toby z
21394 by: Piotr Pluciennik
21395 by: toby z
21396 by: Piotr Pluciennik
php 4.3.3 / 4.1. - variable problem
21397 by: Wolfgang Schneider
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 ---
try
$fp = fopen (http://www.example.com/otherscript.php?a=1&b=2, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
then preg_match $contents for any output.
"Gerardo Rojas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I'm trying to call a php script from another php script. I have the script
name in a variable. Any suggestions on how to implement this? I tried the
"back-tick" and the exec. I even tried doing it with a *.bat file. Nothing
seems to work. I'm on W2k and php 4.3.3
--- End Message ---
--- Begin Message ---
What do you mean by "nothing seems to work" ?
Have you tried to "include" the script you wish to run ?
If you use http (i don't think so), you can also use forms and links.
----- Original Message -----
From: "Gerardo Rojas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 15, 2003 5:32 PM
Subject: [PHP-WIN] calling a php script
I'm trying to call a php script from another php script. I have the script
name in a variable. Any suggestions on how to implement this? I tried the
"back-tick" and the exec. I even tried doing it with a *.bat file. Nothing
seems to work. I'm on W2k and php 4.3.3
--- End Message ---
--- Begin Message ---
i m doin a login system....
what's the diff between session and cookie?
which one is more secure?
i tried session on my server but there's error....
so....i use cookie and it work well.
btw..is there any module that's ready to use for login system?
--- End Message ---
--- Begin Message ---
thnx guyz
but i have tried
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the
past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); //
HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
and it aint working either .....
its still the same .... have to refresh the dammed page .....
i must be scewing something somewhere .....
cant figure out what n where .....
anyother ideas anyone .....
thanx a mill ....
toby
--- Piotr Pluciennik <[EMAIL PROTECTED]> wrote: > Before sending
your graph with:
>
> Imagegif($im);
>
> try things like that:
>
> Header("Expires: Fri, 10 Jun 1976 07:00:00 GMT");
>
> HTH
> Piotr
>
> --- toby z <[EMAIL PROTECTED]> wrote:
> > hay guyz
> >
> > this is a rather silly thing
> > but its starting to drive me now
> >
> > i have a page with a million switches .... checkin
> > and including
> > files for each case .....
> >
> > the files on their turn run a few queries
> > and then each calls a file generate graph
> > which generates a graph for the query rum earlier in
> > the caller file
> >
> > u know the works .....
> >
> > the problem is
> >
> > each file passes to the grapgh file the data fetched
> > and the title of
> > the graph
> >
> > unless i re-fresh the page the graph displayed last
> > keeps appearing
> > and re-appearing
> > with the old title n old data u know .....
> > caching the old one ...... :S
> >
> > i stumbled upon clearstatcache()
> > but it aint seem to be workin either
> >
> >
> > and another thing
> > this screwup happens only on remote machines not on
> > ma own
> > not on the server u know ......
> >
> > what else can i do to clear the cache without having
> > to tell ma
> > clients to refresh the page each time
> > (they cant even turn the compu on properly ...... :)
> > )
> >
> > will sumbdy plz tell me .....
> > as im pretty lost in the cache clearing thinggy
> > .....
> >
> >
> > thnx a mill guyz
> >
> > toby
> >
> >
> >
> >
>
________________________________________________________________________
> > Want to chat instantly with your online friends?
> > Get the FREE Yahoo!
> > Messenger http://mail.messenger.yahoo.co.uk
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
--- End Message ---
--- Begin Message ---
How do you send this file generated graph to the
client browser?
Are you using one of the functions ImagePNG(),
ImageWBMP(), ImageJPEG()
or
are you presenting a link to your graph in php
generated html output?
Piotr
--- toby z <[EMAIL PROTECTED]> wrote:
> thnx guyz
>
> but i have tried
>
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> // Date in the
> past
> header("Last-Modified: " . gmdate("D, d M Y H:i:s")
> . " GMT"); //
> always modified
> header("Cache-Control: no-store, no-cache,
> must-revalidate"); //
> HTTP/1.1
> header("Cache-Control: post-check=0, pre-check=0",
> false);
> header("Pragma: no-cache");
> // HTTP/1.0
>
>
> and it aint working either .....
>
> its still the same .... have to refresh the dammed
> page .....
>
> i must be scewing something somewhere .....
> cant figure out what n where .....
>
> anyother ideas anyone .....
>
> thanx a mill ....
>
> toby
>
> --- Piotr Pluciennik <[EMAIL PROTECTED]> wrote:
> > Before sending
> your graph with:
> >
> > Imagegif($im);
> >
> > try things like that:
> >
> > Header("Expires: Fri, 10 Jun 1976 07:00:00 GMT");
> >
> > HTH
> > Piotr
> >
> > --- toby z <[EMAIL PROTECTED]> wrote:
> > > hay guyz
> > >
> > > this is a rather silly thing
> > > but its starting to drive me now
> > >
> > > i have a page with a million switches ....
> checkin
> > > and including
> > > files for each case .....
> > >
> > > the files on their turn run a few queries
> > > and then each calls a file generate graph
> > > which generates a graph for the query rum
> earlier in
> > > the caller file
> > >
> > > u know the works .....
> > >
> > > the problem is
> > >
> > > each file passes to the grapgh file the data
> fetched
> > > and the title of
> > > the graph
> > >
> > > unless i re-fresh the page the graph displayed
> last
> > > keeps appearing
> > > and re-appearing
> > > with the old title n old data u know .....
> > > caching the old one ...... :S
> > >
> > > i stumbled upon clearstatcache()
> > > but it aint seem to be workin either
> > >
> > >
> > > and another thing
> > > this screwup happens only on remote machines not
> on
> > > ma own
> > > not on the server u know ......
> > >
> > > what else can i do to clear the cache without
> having
> > > to tell ma
> > > clients to refresh the page each time
> > > (they cant even turn the compu on properly
> ...... :)
> > > )
> > >
> > > will sumbdy plz tell me .....
> > > as im pretty lost in the cache clearing thinggy
> > > .....
> > >
> > >
> > > thnx a mill guyz
> > >
> > > toby
> > >
> > >
> > >
> > >
> >
>
________________________________________________________________________
> > > Want to chat instantly with your online friends?
>
> > > Get the FREE Yahoo!
> > > Messenger http://mail.messenger.yahoo.co.uk
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit:
> http://www.php.net/unsub.php
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> > http://sitebuilder.yahoo.com
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
>
________________________________________________________________________
> Want to chat instantly with your online friends?
> Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
heres my code pitor
for generate_graph.php
this file is included in all query files ......
=======================
// ma data
$max_data = count($gfData);
for ($k = 0; $k < $max_data; $k++)
{
//$arrData[$k] = $gfData[$k] * $factor ;
$data[$k] = $gfData[$k] ;
}
// Create the Pie Graph.
$graph = new PieGraph(650,400,"auto");
$graph->SetShadow();
//split title :P:P:P ! ! ! !
$newStr="";
$newStr = explode( "/r/n", $title );
$graph->title->Set("$newStr[0]");
$graph->subtitle->Set("$newStr[1]");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,18);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1,0.2);
// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.4);
$p1->SetSize(150);
// Adjust projection angle
$p1->SetAngle(45);
// Adjsut angle for first slice
$p1->SetStartAngle(45);
// Display the slice values
$p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
$p1->value->SetColor("navy");
// Add colored edges to the 3D pie
// NOTE: You can't have exploded slices with edges!
$p1->SetEdge("navy");
for ($i = 0; $i < $max_data; $i++)
{
if ($arrData[$i] > $max_value)
$max_value = $arrData[$i];
if ( strlen($label[$i]) > $max_label_width )
$max_label_width = strlen($label[$i]);
$p1->SetLegends($label);
$ttl_rkrdz = array_sum($gfData);
}
$graph->Add($p1);
$graph->Stroke("abc.jpg");
echo("
<table width='100%' border='0'>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr> <td align='center'>
<img src=abc.jpg>
</td> </tr>
</table>
<br><br><br>
");
$table_text = "<table align='center' border='0'><tr><td
align='center'> </td></tr>
<tr><td align='center'></td></tr><tr><td align=center
><br><table
border=4><tr>";
for ($i = 0; $i < $max_data; $i++)
{
if ($arrData[$i] > $max_value)
$max_value = $arrData[$i];
if ( strlen($label[$i]) > $max_label_width )
$max_label_width = strlen($label[$i]);
$table_text = $table_text . "<th> " . $label[$i] . " </th>";
$ttl_rkrdz = array_sum($gfData);
}
$table_text = $table_text . "</tr>";
$table_text = $table_text . "<tr>";
for ($i = 0; $i < $max_data; $i++)
{
$table_text = $table_text . "<td style= \"font-family: $font\" >" .
$gfData[$i] . "</td>";
}
$table_text = $table_text . "</tr>
</table></td></tr>
<tr>
<td style= \"font-family: $font\"> </td>
</tr>
<tr><td> </td></tr>
<tr> <td>
<table border='4' align=center>
<tr>
<th width='50%' valign='center' style= \"font-family: $font\">
Total Records </th>
<td width='50%' valign='center' style= \"font-family: $font\">
$ttl_rkrdz </td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
";
echo($table_text);
=========================================
thnx a mill again
toby
--- Piotr Pluciennik <[EMAIL PROTECTED]> wrote: > How do you send
this file generated graph to the
> client browser?
> Are you using one of the functions ImagePNG(),
> ImageWBMP(), ImageJPEG()
> or
> are you presenting a link to your graph in php
> generated html output?
>
> Piotr
>
> --- toby z <[EMAIL PROTECTED]> wrote:
> > thnx guyz
> >
> > but i have tried
> >
> > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> > // Date in the
> > past
> > header("Last-Modified: " . gmdate("D, d M Y H:i:s")
> > . " GMT"); //
> > always modified
> > header("Cache-Control: no-store, no-cache,
> > must-revalidate"); //
> > HTTP/1.1
> > header("Cache-Control: post-check=0, pre-check=0",
> > false);
> > header("Pragma: no-cache");
> > // HTTP/1.0
> >
> >
> > and it aint working either .....
> >
> > its still the same .... have to refresh the dammed
> > page .....
> >
> > i must be scewing something somewhere .....
> > cant figure out what n where .....
> >
> > anyother ideas anyone .....
> >
> > thanx a mill ....
> >
> > toby
> >
> > --- Piotr Pluciennik <[EMAIL PROTECTED]> wrote:
> > > Before sending
> > your graph with:
> > >
> > > Imagegif($im);
> > >
> > > try things like that:
> > >
> > > Header("Expires: Fri, 10 Jun 1976 07:00:00 GMT");
> > >
> > > HTH
> > > Piotr
> > >
> > > --- toby z <[EMAIL PROTECTED]> wrote:
> > > > hay guyz
> > > >
> > > > this is a rather silly thing
> > > > but its starting to drive me now
> > > >
> > > > i have a page with a million switches ....
> > checkin
> > > > and including
> > > > files for each case .....
> > > >
> > > > the files on their turn run a few queries
> > > > and then each calls a file generate graph
> > > > which generates a graph for the query rum
> > earlier in
> > > > the caller file
> > > >
> > > > u know the works .....
> > > >
> > > > the problem is
> > > >
> > > > each file passes to the grapgh file the data
> > fetched
> > > > and the title of
> > > > the graph
> > > >
> > > > unless i re-fresh the page the graph displayed
> > last
> > > > keeps appearing
> > > > and re-appearing
> > > > with the old title n old data u know .....
> > > > caching the old one ...... :S
> > > >
> > > > i stumbled upon clearstatcache()
> > > > but it aint seem to be workin either
> > > >
> > > >
> > > > and another thing
> > > > this screwup happens only on remote machines not
> > on
> > > > ma own
> > > > not on the server u know ......
> > > >
> > > > what else can i do to clear the cache without
> > having
> > > > to tell ma
> > > > clients to refresh the page each time
> > > > (they cant even turn the compu on properly
> > ...... :)
> > > > )
> > > >
> > > > will sumbdy plz tell me .....
> > > > as im pretty lost in the cache clearing thinggy
> > > > .....
> > > >
> > > >
> > > > thnx a mill guyz
> > > >
> > > > toby
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
--- End Message ---
--- Begin Message ---
I think the problem is in the code mentioned below.
<table width='100%' border='0'>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr> <td align='center'>
<img src=abc.jpg>
</td> </tr>
</table>
");
You are creating a file abc.jpg, then showing it to
the client via the link. You are not sending any
headers regarding this jpg file.
Try this way - create graph generating php file:
graph.php file:
**************************************************
<?php
Header("Content-type: image/jpeg");
Header("Expires: Fri, 10 Jun 1976 07:00:00 GMT");
$pth = "abc.jpg";
$im = imagecreatefromjpeg($pth);
// some operations with your image - create your graph
Imagejpeg($im); // send to the client
ImageDestroy($im); // free resources
?>
**************************************************
then in your html try to place such generated image:
<IMG SRC='graph.php?if needed - your parameters'
WIDTH='width' HEIGHT='height' BORDER='0'>
Headers will be sent and your graph will be reloaded.
It's based on a real world :-) working program i wrote
long ago. I've changed only type gif to your jpeg...
so check exactly functions names.
HTH, let me know
Piotr
--- toby z <[EMAIL PROTECTED]> wrote:
> heres my code pitor
> for generate_graph.php
>
> this file is included in all query files ......
>
>
> =======================
>
>
> // ma data
>
> $max_data = count($gfData);
>
> for ($k = 0; $k < $max_data; $k++)
> {
> //$arrData[$k] = $gfData[$k] * $factor ;
> $data[$k] = $gfData[$k] ;
> }
>
>
>
>
> // Create the Pie Graph.
> $graph = new PieGraph(650,400,"auto");
> $graph->SetShadow();
>
>
> //split title :P:P:P ! ! ! !
>
> $newStr="";
>
> $newStr = explode( "/r/n", $title );
>
> $graph->title->Set("$newStr[0]");
> $graph->subtitle->Set("$newStr[1]");
> $graph->title->SetFont(FF_VERDANA,FS_BOLD,18);
> $graph->title->SetColor("darkblue");
> $graph->legend->Pos(0.1,0.2);
>
> // Create 3D pie plot
> $p1 = new PiePlot3d($data);
> $p1->SetTheme("sand");
> $p1->SetCenter(0.4);
> $p1->SetSize(150);
>
> // Adjust projection angle
> $p1->SetAngle(45);
>
> // Adjsut angle for first slice
> $p1->SetStartAngle(45);
>
> // Display the slice values
> $p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
> $p1->value->SetColor("navy");
>
> // Add colored edges to the 3D pie
> // NOTE: You can't have exploded slices with edges!
> $p1->SetEdge("navy");
>
>
> for ($i = 0; $i < $max_data; $i++)
> {
> if ($arrData[$i] > $max_value)
> $max_value = $arrData[$i];
>
> if ( strlen($label[$i]) > $max_label_width )
> $max_label_width = strlen($label[$i]);
>
> $p1->SetLegends($label);
>
> $ttl_rkrdz = array_sum($gfData);
> }
>
>
> $graph->Add($p1);
> $graph->Stroke("abc.jpg");
>
> echo("
> <table width='100%' border='0'>
>
> <tr><td> </td></tr>
> <tr><td> </td></tr>
> <tr> <td align='center'>
> <img src=abc.jpg>
> </td> </tr>
> </table>
>
> <br><br><br>
> ");
>
>
>
> $table_text = "<table align='center'
> border='0'><tr><td
> align='center'> </td></tr>
>
> <tr><td align='center'></td></tr><tr><td
> align=center ><br><table
> border=4><tr>";
>
>
>
> for ($i = 0; $i < $max_data; $i++)
> {
> if ($arrData[$i] > $max_value)
> $max_value = $arrData[$i];
>
> if ( strlen($label[$i]) > $max_label_width )
> $max_label_width = strlen($label[$i]);
>
> $table_text = $table_text . "<th> " . $label[$i] .
> " </th>";
> $ttl_rkrdz = array_sum($gfData);
>
> }
> $table_text = $table_text . "</tr>";
> $table_text = $table_text . "<tr>";
>
>
> for ($i = 0; $i < $max_data; $i++)
> {
>
> $table_text = $table_text . "<td style=
> \"font-family: $font\" >" .
> $gfData[$i] . "</td>";
>
>
> }
> $table_text = $table_text . "</tr>
> </table></td></tr>
> <tr>
> <td style= \"font-family: $font\"> </td>
> </tr>
> <tr><td> </td></tr>
>
> <tr> <td>
> <table border='4' align=center>
> <tr>
> <th width='50%' valign='center' style=
> \"font-family: $font\">
> Total Records </th>
> <td width='50%' valign='center' style=
> \"font-family: $font\">
> $ttl_rkrdz </td>
> </tr>
> </table>
> </td>
> </tr>
> <tr><td> </td></tr>
> <tr><td> </td></tr>
> <tr><td> </td></tr>
> ";
>
> echo($table_text);
>
>
> =========================================
>
>
> thnx a mill again
>
> toby
>
>
> --- Piotr Pluciennik <[EMAIL PROTECTED]> wrote:
> > How do you send
> this file generated graph to the
> > client browser?
> > Are you using one of the functions ImagePNG(),
> > ImageWBMP(), ImageJPEG()
> > or
> > are you presenting a link to your graph in php
> > generated html output?
> >
> > Piotr
> >
> > --- toby z <[EMAIL PROTECTED]> wrote:
> > > thnx guyz
> > >
> > > but i have tried
> > >
> > > header("Expires: Mon, 26 Jul 1997 05:00:00
> GMT");
> > > // Date in the
> > > past
> > > header("Last-Modified: " . gmdate("D, d M Y
> H:i:s")
> > > . " GMT"); //
> > > always modified
> > > header("Cache-Control: no-store, no-cache,
> > > must-revalidate"); //
> > > HTTP/1.1
> > > header("Cache-Control: post-check=0,
> pre-check=0",
> > > false);
> > > header("Pragma: no-cache");
>
> > > // HTTP/1.0
> > >
> > >
> > > and it aint working either .....
>
=== message truncated ===
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
Hi everyone,
I just upgraded my Win2000 installation of PHP to the php 4.3.3 ...
and everything seems to be running fine in cooperation with my Apache
1.23 server also installed on this Win2000 "testing" platform ....
While calling up a website I am developing now, I am encountering a
problem in my updated installation with passing on a variable to a
new page ... situation is as follows:
I am calling a file called "showpics.php" and I was adding on to the
URL the following variables by "?pic=photo01&picby=Mr Smith" ... the
line as a whole being
.../showpics.php?pic=photo01&picby=Mr%20Smith
This worked without a problem with my previous php 4.1.2 .... but it
displays and empty page under the new php 4.3.3 .... because the
variables in the page are not being replaced by the values passed to
them ...
Does anyone have an idea what and where the difference in the two php
versions is? and where I need to perhaps add something either in the
php.ini file ?
Any input is greatly appreciated ..
Wolfgang
--- End Message ---