php-windows Digest 8 Apr 2002 17:53:35 -0000 Issue 1083
Topics (messages 12959 through 12967):
Newbie Question
12959 by: Hubert DAUL
12963 by: Mike Flynn
12965 by: Mike Flynn
12966 by: Hubert DAUL
Re: update?'
12960 by: Sandeep Murphy
Cookies and IIS5
12961 by: John Braden
R: [PHP-WIN] Cookies and IIS5
12962 by: Alberto. Sartori
R: [PHP-WIN] Newbie Question
12964 by: Alberto. Sartori
Session Destroy with IE6
12967 by: Chip Snider
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 ---
Hi ,
Here's my problem :
I read a data file (no sql file) which contains 8 lines, and in each line, 8
datas
(ex: name1;picture1;title1;anything1;everything1;nothing1)
and when i run it I see only one picture(the second data) and not all of
them
If someone could help me
TYA
Here the code :
<html>
<head>
<title>Solid</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="384" border="1">
<?php
$row = 1;
$fp = fopen ("album.dat","r");
while ($data = fgetcsv ($fp, 1000, ";"))
{
$num = count ($data);
$row++;
if (isset($vignette))
{
print("<tr>");
print("<td>$vignette</td>");
// I think it's wrong here but I dont know why
==> print("<td><img src=\"images/$photo\"><a href =
\"prod.php?file=lecteur.dat\"></a></td>");
print("<td>$marque</td>");
print("<td>$nom</td>");
print("<td>$pdfproduit</td>");
print("<td>$commprod</td>");
print("</tr>");
}
for ($c=0; $c<$num; $c++)
switch ($c) {
case 0 :
{
$vignette = $data[$c];
break;
}
case 1 :
{
$photo= $data[$c];
break;
}
case 2 :
{
$marque= $data[$c];
break;
}
case 3 :
{
$nom = $data[$c];
break;
}
case 4 :
{
$pdfproduit= $data[$c];
break;
}
case 5 :
{
$commprod = $data[$c];
break;
}
}
}
?>
</table>
</body>
</html>
--- End Message ---
--- Begin Message ---
Give this a shot...
<?php
$row = 1;
$fp = fopen ("album.dat","r");
while ($data = fgets($fp)) {
$values = explode(';', $data);
list($vignette, $photo, $marque, $nom, $pdfproduit, $commprod) = $values;
print("<tr>");
print("<td>$vignette</td>");
print("<td><img src=\"images/$photo\"><a
href=\"prod.php?file=lecteur.dat\"></a></td>");
print("<td>$marque</td>");
print("<td>$nom</td>");
print("<td>$pdfproduit</td>");
print("<td>$commprod</td>");
print("</tr>");
}
?>
At 08:54 AM 4/8/2002 +0200, Hubert DAUL wrote:
>Hi ,
>
>Here's my problem :
>
>I read a data file (no sql file) which contains 8 lines, and in each line, 8
>datas
>
>(ex: name1;picture1;title1;anything1;everything1;nothing1)
>
>and when i run it I see only one picture(the second data) and not all of
>them
>
>If someone could help me
>
>TYA
>
>Here the code :
>
><?php $row = 1; $fp = fopen ("album.dat","r"); while ($data = fgetcsv
>($fp, 1000, ";")) { $num = count ($data); $row++; if (isset($vignette)) {
>print("
>"); print("$vignette"); // I think it's wrong here but I dont know why ==>
>print("10e834.jpg"); print("$marque"); print("$nom");
>print("$pdfproduit"); print("$commprod"); print("
>"); } for ($c=0; $c<$num; $c++) switch ($c) { case 0 : { $vignette =
>$data[$c]; break; } case 1 : { $photo= $data[$c]; break; } case 2 : {
>$marque= $data[$c]; break; } case 3 : { $nom = $data[$c]; break; } case 4
>: { $pdfproduit= $data[$c]; break; } case 5 : { $commprod = $data[$c];
>break; } } } ?>
>
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
Mike Flynn - Burlington, VT
http://www.mikeflynn.net/ - [EMAIL PROTECTED]
home=>work=>home=>store=>home [repeat daily]
--- End Message ---
--- Begin Message ---
At 03:31 PM 4/8/2002 +0200, Alberto. Sartori wrote:
>You should do the cicle and get the datas until you reach the end of file
>aka feof($fp) or better, try to use fread()
Yup, good point. Here's the modified code.. not using fread() though. For
non-binary data I think this should work ok though.
<?php
$fp = fopen ("album.dat","r");
while (!feof($fp)) {
$data = fgets($fp)
$values = explode(';', $data);
list($vignette, $photo, $marque, $nom, $pdfproduit, $commprod) = $values;
print("<tr>");
print("<td>$vignette</td>");
print("<td><img src=\"images/$photo\"><a
href=\"prod.php?file=lecteur.dat\"></a></td>");
print("<td>$marque</td>");
print("<td>$nom</td>");
print("<td>$pdfproduit</td>");
print("<td>$commprod</td>");
print("</tr>");
}
fclose($fp);
?>
--- End Message ---
--- Begin Message ---
Thanks for your help, but i've found what was wrong, it was in the code, but
in the data file
I wrote the picture name with first letter uppercase and unix server doesn(t
like it
Thanks again
Hubert
Lyon, France
--- End Message ---
--- Begin Message ---
thnx.. will try it out...
cheers,
sands
-----Original Message-----
From: Mike Flynn [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 5 de Abril de 2002 17:27
To: Sandeep Murphy; 'Svensson, B.A.T. (HKG)'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] update?'
I doubt there is any way to do this without using an intermediate step. I
would grab all the data you need from whichever tables you are grabbing
from, into a temporary array in PHP, including whatever keys you are using
to place them into the other table where they are being placed. Then go
back through that array, running one or more UPDATE query for each row,
putting the data where it belongs.
-Mike
At 12:36 PM 4/5/02 +0100, Sandeep Murphy wrote:
>hi,
>
>sorry for missing out on the database type.. am using Mysql 3.23... am
>trying to execute this query in query analyzer (Mascon) directly...
--- End Message ---
--- Begin Message ---
I've looked thru some of the posts and noticed quite a few issues with this
configuration. Has anyone had any luck getting cookies working with PHP and
IIS5?
I have an application that is having some login problems which I believe are
cookie related (No cookie is even being sent!!).
Thanks..
--- End Message ---
--- Begin Message ---
I've used for several time my pc with IIS5 and php with no problem. And I can use the
cookies quitelly.....what kind of problem you got?
-----Messaggio originale-----
Da: John Braden [mailto:[EMAIL PROTECTED]]
Inviato: luned́ 8 aprile 2002 14.50
A: [EMAIL PROTECTED]
Oggetto: [PHP-WIN] Cookies and IIS5
I've looked thru some of the posts and noticed quite a few issues with this
configuration. Has anyone had any luck getting cookies working with PHP and
IIS5?
I have an application that is having some login problems which I believe are
cookie related (No cookie is even being sent!!).
Thanks..
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You should do the cicle and get the datas until you reach the end of file aka
feof($fp) or better, try to use fread()
-----Messaggio originale-----
Da: Mike Flynn [mailto:[EMAIL PROTECTED]]
Inviato: luned́ 8 aprile 2002 15.30
A: Hubert DAUL; [EMAIL PROTECTED]
Oggetto: Re: [PHP-WIN] Newbie Question
Give this a shot...
<?php
$row = 1;
$fp = fopen ("album.dat","r");
while ($data = fgets($fp)) {
$values = explode(';', $data);
list($vignette, $photo, $marque, $nom, $pdfproduit, $commprod) = $values;
print("<tr>");
print("<td>$vignette</td>");
print("<td><img src=\"images/$photo\"><a
href=\"prod.php?file=lecteur.dat\"></a></td>");
print("<td>$marque</td>");
print("<td>$nom</td>");
print("<td>$pdfproduit</td>");
print("<td>$commprod</td>");
print("</tr>");
}
?>
At 08:54 AM 4/8/2002 +0200, Hubert DAUL wrote:
>Hi ,
>
>Here's my problem :
>
>I read a data file (no sql file) which contains 8 lines, and in each line, 8
>datas
>
>(ex: name1;picture1;title1;anything1;everything1;nothing1)
>
>and when i run it I see only one picture(the second data) and not all of
>them
>
>If someone could help me
>
>TYA
>
>Here the code :
>
><?php $row = 1; $fp = fopen ("album.dat","r"); while ($data = fgetcsv
>($fp, 1000, ";")) { $num = count ($data); $row++; if (isset($vignette)) {
>print("
>"); print("$vignette"); // I think it's wrong here but I dont know why ==>
>print("10e834.jpg"); print("$marque"); print("$nom");
>print("$pdfproduit"); print("$commprod"); print("
>"); } for ($c=0; $c<$num; $c++) switch ($c) { case 0 : { $vignette =
>$data[$c]; break; } case 1 : { $photo= $data[$c]; break; } case 2 : {
>$marque= $data[$c]; break; } case 3 : { $nom = $data[$c]; break; } case 4
>: { $pdfproduit= $data[$c]; break; } case 5 : { $commprod = $data[$c];
>break; } } } ?>
>
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
Mike Flynn - Burlington, VT
http://www.mikeflynn.net/ - [EMAIL PROTECTED]
home=>work=>home=>store=>home [repeat daily]
--- End Message ---
--- Begin Message ---
IE6 doesn't seem to be destroying its sessions.
anyone have any ideas on how to rectify this?
--- End Message ---