Re: [PHP] file_exists problems

2001-12-01 Thread Prolog

I've since tried that also.  It too seems to return the same error.  I'm
curious if the file_exists can't use relative positionslike it has to be
in the same folder or you have to use the whole line like c:\  I'm
working on a box that isn't mine of the net...if that's the case I don't
know my full directory line.  Just a thought but I'm not sure.  I'll include
my full code below...as it sits now.  Maybe you can see something that I
can't.

-

\n";

  echo "ImageInfo\n";

  do {

 //filename is the item number + t.jpg -- t shorthand for thumbnail

   $picname = "$itemnumber t.jpg";

 print ("");

 //if the file exists then print it.  Otherwise print a generic image saying
it doesn't exist.

 if (file_exists ("/images/$picname t.jpt")
 {
  print ('');
  print (" $dn
 $sp - $val  $size : \$$priceRelease: $release  Preorder This
Item\n");
 }
 else
 {
  print ("");
  print (" $dn
 $sp - $val  $size : \$$priceRelease: $release  Preorder This
Item\n");

 }


  }
  while ($myrow = mysql_fetch_array($result));

  print ("\n)";

  //if no results found display this message
}
else
{

  echo "Sorry, no records were found!";

}

$dn = "$myrow["driver_name"]";
$sp = "$myrow["sponsor"]";
$val = "$myrow["value"]";
$size = "$myrow["size"]";
$price = "$myrow["price"]";
$release = "$myrow["release"]";
$itemnumber = "$myrow[item_number]";
?>

-

maybe that will help.

-Jordan

"Faeton" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Prolog,
>
>
> Hm... And what about:
> print '';
> instead of readfile?
>
>
> P>  if(file_exists(/images/$filename))
> P>  {
> P>   readfile(/images/$filename);
> P>  }
> P>  else
> P>  {
> P>   readfile(images/npat.jpg);
> P>  }
>
>
>
> 
> Ivan 'Faeton aka xetrix' Danishevsky
> ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
> ::: Ñòîèò òîëüêî çàîñòðèòü âîïðîñ, êàê ñðàçó ïðîñÿò çàêðóãëÿòüñÿ. :::
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] file_exists problems

2001-12-01 Thread faeton

Hello Prolog,

If course it doesn't use relative positioning.
You should do it like that file_exists("images/...") instead of
("/images/..."). That's all :)



P> I've since tried that also.  It too seems to return the same error.  I'm
P> curious if the file_exists can't use relative positionslike it has to be
P> in the same folder or you have to use the whole line like c:\  I'm
P> working on a box that isn't mine of the net...if that's the case I don't
P> know my full directory line.  Just a thought but I'm not sure.  I'll include
P> my full code below...as it sits now.  Maybe you can see something that I
P> can't.



Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: Ñåãîäíÿ òðè ðàçà ïîäóìàë... Î÷åíü óñòàë... :::


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Question per install. Editing apxs (linux)

2001-12-01 Thread Joelmon2001

One source for raq 3 users like myself said to edit it for php and do this:
Line 203:
($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+S+W+iaA",
@ARGV);
This line should read as I have above. Normally its:
($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+iaA", @ARGV);
[in other words, remove the +S ]


Ok, Remove the +S. Fine. However, another site said:

#fix apxs so that it can use the -S option
wget http://www.uk2raq.com/updates/php/apxs
mv apxs /usr/sbin/apxs
chmod 755 /usr/sbin/apxs

That was interesting.

What is the difference between the 2 options?

Thanks. I hope this is not off topic, as it's per installing php

Joel






[PHP] Preventing a form from being submitted twice

2001-12-01 Thread rdkurth

How can I prevent somebody from using the back button after they fill
in a form and it takes them to a second page that checks there data
using php code. I don't what them to be able to resubmit the info a
second time with different information to be able to get the data that
they are buying. Hope this makes since to what I am asking



-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] [광고] 유용한 정보입니다!!!

2001-12-01 Thread 웹미디어스쿨


 



Re: [PHP] Preventing a form from being submitted twice

2001-12-01 Thread [ Swift eNetwork ]

Two Words:  Session Management

> How can I prevent somebody from using the back button after they fill
> in a form and it takes them to a second page that checks there data
> using php code. I don't what them to be able to resubmit the info a
> second time with different information to be able to get the data that
> they are buying. Hope this makes since to what I am asking
> 
> 
> 
> -- 
> Best regards,
>  rdkurth  mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> 
> 
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP & credit validation

2001-12-01 Thread Daniel Guerrier

What credit service(s) can intergrate with PHP

__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] Preventing a form from being submitted twice

2001-12-01 Thread rdkurth

could you give me a few more words to point me in the right direction

Saturday, December 01, 2001, 1:41:49 AM, you wrote:

Se> Two Words:  Session Management

>> How can I prevent somebody from using the back button after they fill
>> in a form and it takes them to a second page that checks there data
>> using php code. I don't what them to be able to resubmit the info a
>> second time with different information to be able to get the data that
>> they are buying. Hope this makes since to what I am asking
>> 
>> 
>> 
>> -- 
>> Best regards,
>>  rdkurth  mailto:[EMAIL PROTECTED]
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: php-list-
Se> [EMAIL PROTECTED]
>> 
>> 
>> 




-- 
Best regards,
 rdkurthmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: Re[2]: [PHP] Preventing a form from being submitted twice

2001-12-01 Thread Robert Samuel White

Well, that's kinda hard to do.  You should start by looking at the
session management functions of PHP.  Then, track your sessions by
creating a table in a database.  Then, once you are doing that...you
will have a session id associated with any individual using your
website.  Once that individual submits an entry, save the session id
with the order and don't allow them to submit another order since their
session id is already stored.

-OR-

If you only want them to be able to submit ONE ORDER EVER, then create a
cookie on their computer (that lasts for a year) once they have
completed the transaction and check for the cookie every time someone
tries to submit an order.  IF the cookie exists, then prevent the order
from processing.

Hope this helps.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 01, 2001 4:51 AM
To: php-general
Subject: Re[2]: [PHP] Preventing a form from being submitted twice


could you give me a few more words to point me in the right direction

Saturday, December 01, 2001, 1:41:49 AM, you wrote:

Se> Two Words:  Session Management

>> How can I prevent somebody from using the back button after they fill

>> in a form and it takes them to a second page that checks there data 
>> using php code. I don't what them to be able to resubmit the info a 
>> second time with different information to be able to get the data 
>> that they are buying. Hope this makes since to what I am asking
>> 
>> 
>> 
>> --
>> Best regards,
>>  rdkurth  mailto:[EMAIL PROTECTED]
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: php-list-
Se> [EMAIL PROTECTED]
>> 
>> 
>> 




-- 
Best regards,
 rdkurthmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Stripping slashes from db-insert?

2001-12-01 Thread Daniel Alsén

Hi,

i know this has been asked before - but:

When i add entries to MySql (varchar and text) all " and ' gets a slash in
front of them. How do i get rid of these slashes?

Regards
# Daniel Alsén| www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   | +46 8 694 82 22  #
# PGP: http://www.mindbash.com/pgp/  #


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Stripping slashes from db-insert?

2001-12-01 Thread Shane Wright


Addslashes() is probably getting called twice on the data on the insert...

if you have magic_gpc on, any inputted data already has the necessary escapes 
- so you shouldnt need to call it again...

Hope that helped :)

--
Shane

On Saturday 01 Dec 2001 1:14 pm, Daniel Alsén wrote:
> Hi,
>
> i know this has been asked before - but:
>
> When i add entries to MySql (varchar and text) all " and ' gets a slash in
> front of them. How do i get rid of these slashes?
>
> Regards
> # Daniel Alsén| www.mindbash.com #
> # [EMAIL PROTECTED]  | +46 704 86 14 92 #
> # ICQ: 63006462   | +46 8 694 82 22  #
> # PGP: http://www.mindbash.com/pgp/  #

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] XML and PHP - dynamic hell

2001-12-01 Thread Matthew Loff


Did you try adding:

header("Content-Type: text/xml");

To the top?


-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 01, 2001 12:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] XML and PHP - dynamic hell


I'm having one page output XML for other sites to parse. Unfortunately
if I
give an RSS parser the site (the php file) it errors out. But if I put
the
output in a XML file, and give that to the RSS parser everything works
perfectly. Does anyone know why it can't read it straight from the php
file?
PHP Builder has it working, I have no idea why mine doesn't. Thanks

Source:

\n";
echo "http://my.netscape.com/publish/formats/rss-0.91.dtd\";>\n";
echo "\n";
echo "\n";
  $query = mysql_query("Select * from " . PREFIX . "news order by Date
Desc
Limit 40");
  while($results = mysql_fetch_array($query))
  {
   echo "\n";
   echo "" . stripslashes($results["Subject"]) . "\n";
   echo "http://dod.stronger.org/\n";
   echo "$results[Name]\n";
   echo "" .
substr(htmlspecialchars(stripslashes($results["News"])),0,150) .
"...\n";
   echo "\n";
 }
?>
  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] XML and PHP - dynamic hell

2001-12-01 Thread Chris

It didn't help :(
- Original Message - 
From: "Matthew Loff" <[EMAIL PROTECTED]>
To: "'Chris'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, December 01, 2001 10:03 AM
Subject: RE: [PHP] XML and PHP - dynamic hell


> 
> Did you try adding:
> 
> header("Content-Type: text/xml");
> 
> To the top?
> 
> 
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, December 01, 2001 12:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] XML and PHP - dynamic hell
> 
> 
> I'm having one page output XML for other sites to parse. Unfortunately
> if I
> give an RSS parser the site (the php file) it errors out. But if I put
> the
> output in a XML file, and give that to the RSS parser everything works
> perfectly. Does anyone know why it can't read it straight from the php
> file?
> PHP Builder has it working, I have no idea why mine doesn't. Thanks
> 
> Source:
> 
>  require "division/settings.inc";
> require RootPath . "admin/Admin.php";  //these just define mysql logins
> and
> such
> echo "<" . "?xml version=\"1.0\"?" . ">\n";
> echo " 0.91//EN\"
> \"http://my.netscape.com/publish/formats/rss-0.91.dtd\";>\n";
> echo "\n";
> echo "\n";
>   $query = mysql_query("Select * from " . PREFIX . "news order by Date
> Desc
> Limit 40");
>   while($results = mysql_fetch_array($query))
>   {
>echo "\n";
>echo "" . stripslashes($results["Subject"]) . "\n";
>echo "http://dod.stronger.org/\n";
>echo "$results[Name]\n";
>echo "" .
> substr(htmlspecialchars(stripslashes($results["News"])),0,150) .
> "...\n";
>echo "\n";
>  }
> ?>
>   
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] LOAD DATA INFILE help

2001-12-01 Thread Tyler Longren

Hello everyone,

I posted this message to the mysql mailing list and didn't get a response.
I know a lot of people here are good with SQL.  So, here's my e-mail:

Hello,

I've been struggling with this all night.  Can someone give me a push in the
right direction?  I
have a csv file named Sheet1.txt, here's an example of its contents:
"P1002565",
"P1002566",
"P1002638",

I want to put the contents of Sheet1.txt in a table named 'passcodes'.  The
passcodes table has 2 fields: 'id' and 'passcode'.  I run this:
LOAD DATA INFILE 'Sheet1.txt' INTO TABLE passcodes FIELDS TERMINATED BY ','
ENCLOSED BY '"' LINES TERMINATED BY '\n';

Nothing gets inserted into the 'passcode' field, but ID's are generated for
every item in Sheet1.txt.

Can anyone give me some help?  Sorry for the sort of off-topic question!

Thanks,
Tyler Longren


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: file_exists problems

2001-12-01 Thread Fred

file_exists takes a string argument.
/images/$filename is not a string.
try "images/" . $filename instead.

Fred

Prolog <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I had a script that was running beautiful that simply called up a database
> and displayed the results in tables.  I went to add images to this script
> and all hell broke loose.  This is the portion of the script that I added:
>
>
> --
>
> file://filename is the item number + t.jpg -- t shorthand for thumbnail
>
>   $itemnumber = "$myrow[item_number]";
>   $filename = "$itemnumber t.jpg";
>
> echo "";
>
> file://if the file exists then print it.  Otherwise print a generic image
saying
> it doesn't exist.
>
>  if(file_exists(/images/$filename))
>  {
>   readfile(/images/$filename);
>  }
>  else
>  {
>   readfile(images/npat.jpg);
>  }
>
> -
>
> Is there anything I need to know about "file_exists" that I'm not doing.
> for some reason when this code is added it gives me an error on the line
> after the close of the else statement.  That line was perfectly fine
before
> the addition.  Please help.
>
> -Jordan
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: LOAD DATA INFILE help

2001-12-01 Thread Fred

It makes a huge difference if the order of fields is different in your text
file than it is in your mysql table.  For instance, if your mysql table has
id before passcode (assuming id is an autoincrement field), then every time
you try to load data from this file it grabs the passcode (which is first in
the file) and inserts it as an id (which is first in the table).  Since the
id is an autoincrement column it simply generates an id and ignores the
passcode.  Since there is only one field per line in your text file there is
nothing left to insert into the table's passcode column.

If that is the case then you need to add (passcode) tot he end of your query
so that mysql knows that the fields in the text file are to be inserted in
the passcode column.  mysql will then insert an id and the passcode for each
row.

Fred

Tyler Longren <[EMAIL PROTECTED]> wrote in message
003301c17a94$ac453610$0101a8c0@Longren">news:003301c17a94$ac453610$0101a8c0@Longren...
> Hello everyone,
>
> I posted this message to the mysql mailing list and didn't get a response.
> I know a lot of people here are good with SQL.  So, here's my e-mail:
>
> Hello,
>
> I've been struggling with this all night.  Can someone give me a push in
the
> right direction?  I
> have a csv file named Sheet1.txt, here's an example of its contents:
> "P1002565",
> "P1002566",
> "P1002638",
>
> I want to put the contents of Sheet1.txt in a table named 'passcodes'.
The
> passcodes table has 2 fields: 'id' and 'passcode'.  I run this:
> LOAD DATA INFILE 'Sheet1.txt' INTO TABLE passcodes FIELDS TERMINATED BY
','
> ENCLOSED BY '"' LINES TERMINATED BY '\n';
>
> Nothing gets inserted into the 'passcode' field, but ID's are generated
for
> every item in Sheet1.txt.
>
> Can anyone give me some help?  Sorry for the sort of off-topic question!
>
> Thanks,
> Tyler Longren
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Getting the filesize of an image?

2001-12-01 Thread Matt McClanahan

On Sat, Dec 01, 2001 at 09:55:47AM +0200, faeton wrote:

> Hello Matt,
> 
> filesize() works only on local filesystems.

If you want the size of a remote file, you'll have to download it; HTTP
doesn't provide a way to query a remote file's size.  FTP does, if you have
FTP access.

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 1 Dec 2001 21:02:02 -0000 Issue 1027

2001-12-01 Thread php-general-digest-help


php-general Digest 1 Dec 2001 21:02:02 - Issue 1027

Topics (messages 76300 through 76322):

Re: file_exists problems
76300 by: faeton
76305 by: Prolog
76306 by: faeton
76320 by: Fred

Re: call_user_func problem
76301 by: faeton
76310 by: Papp Gyozo

Re: Don't tell me this isn't possible (object related question)
76302 by: Matt McClanahan

Re: Getting the filesize of an image?
76303 by: Matt McClanahan
76304 by: faeton
76322 by: Matt McClanahan

Question per install. Editing apxs (linux)
76307 by: Joelmon2001.aol.com

Preventing a form from being submitted twice
76308 by: rdkurth.starband.net
76311 by: [ Swift eNetwork ]
76313 by: rdkurth.starband.net
76314 by: Robert Samuel White

[±¤°í] À¯¿ëÇÑ Á¤º¸ÀÔ´Ï´Ù!!!
76309 by: À¥¹Ìµð¾î½ºÄð

PHP & credit validation
76312 by: Daniel Guerrier

Stripping slashes from db-insert?
76315 by: Daniel Alsén
76316 by: Shane Wright

Re: XML and PHP - dynamic hell
76317 by: Matthew Loff
76318 by: Chris

LOAD DATA INFILE help
76319 by: Tyler Longren
76321 by: Fred

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 ---

Hello Prolog,


Hm... And what about:
print '';
instead of readfile?


P>  if(file_exists(/images/$filename))
P>  {
P>   readfile(/images/$filename);
P>  }
P>  else
P>  {
P>   readfile(images/npat.jpg);
P>  }




Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: Ñòîèò òîëüêî çàîñòðèòü âîïðîñ, êàê ñðàçó ïðîñÿò çàêðóãëÿòüñÿ. :::


--- End Message ---
--- Begin Message ---

I've since tried that also.  It too seems to return the same error.  I'm
curious if the file_exists can't use relative positionslike it has to be
in the same folder or you have to use the whole line like c:\  I'm
working on a box that isn't mine of the net...if that's the case I don't
know my full directory line.  Just a thought but I'm not sure.  I'll include
my full code below...as it sits now.  Maybe you can see something that I
can't.

-

\n";

  echo "ImageInfo\n";

  do {

 //filename is the item number + t.jpg -- t shorthand for thumbnail

   $picname = "$itemnumber t.jpg";

 print ("");

 //if the file exists then print it.  Otherwise print a generic image saying
it doesn't exist.

 if (file_exists ("/images/$picname t.jpt")
 {
  print ('');
  print (" $dn
 $sp - $val  $size : \$$priceRelease: $release  Preorder This
Item\n");
 }
 else
 {
  print ("");
  print (" $dn
 $sp - $val  $size : \$$priceRelease: $release  Preorder This
Item\n");

 }


  }
  while ($myrow = mysql_fetch_array($result));

  print ("\n)";

  //if no results found display this message
}
else
{

  echo "Sorry, no records were found!";

}

$dn = "$myrow["driver_name"]";
$sp = "$myrow["sponsor"]";
$val = "$myrow["value"]";
$size = "$myrow["size"]";
$price = "$myrow["price"]";
$release = "$myrow["release"]";
$itemnumber = "$myrow[item_number]";
?>

-

maybe that will help.

-Jordan

"Faeton" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Prolog,
>
>
> Hm... And what about:
> print '';
> instead of readfile?
>
>
> P>  if(file_exists(/images/$filename))
> P>  {
> P>   readfile(/images/$filename);
> P>  }
> P>  else
> P>  {
> P>   readfile(images/npat.jpg);
> P>  }
>
>
>
> 
> Ivan 'Faeton aka xetrix' Danishevsky
> ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
> ::: Ñòîèò òîëüêî çàîñòðèòü âîïðîñ, êàê ñðàçó ïðîñÿò çàêðóãëÿòüñÿ. :::
>



--- End Message ---
--- Begin Message ---

Hello Prolog,

If course it doesn't use relative positioning.
You should do it like that file_exists("images/...") instead of
("/images/..."). That's all :)



P> I've since tried that also.  It too seems to return the same error.  I'm
P> curious if the file_exists can't use relative positionslike it has to be
P> in the same folder or you have to use the whole line like c:\  I'm
P> working on a box that isn't mine of the net...if that's the case I don't
P> know my full directory line.  Just a thought but I'm not sure.  I'll include
P> my full code below...as it sits now.  Maybe you can see something that I
P> can't.



Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: Ñåãîäíÿ òðè ðàçà ïîäóìàë... Î÷åíü óñòàë... :::


--- End Message ---
--- Begin Message ---

file_exists takes a string argument.
/images/$filename is not a string.
try "images/" . $filename instead.

Fred

Prolog <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">ne

Re[2]: [PHP] Getting the filesize of an image?

2001-12-01 Thread faeton

Hello Matt,

Of course it does not, but as i've already said file() with strlen()
can be used. :)

MM> If you want the size of a remote file, you'll have to download it; HTTP
MM> doesn't provide a way to query a remote file's size.  FTP does, if you have
MM> FTP access.



Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Getting the filesize of an image?

2001-12-01 Thread Matt McClanahan

On Sat, Dec 01, 2001 at 11:05:51PM +0200, faeton wrote:

> Hello Matt,
> 
> Of course it does not, but as i've already said file() with strlen()
> can be used. :)
> 
> MM> If you want the size of a remote file, you'll have to download it; HTTP
> MM> doesn't provide a way to query a remote file's size.  FTP does, if you have
> MM> FTP access.

Not on binary files.  For an image that's 4494 bytes, file/join/strlen gives
me 3512.  And since file() on a remote file is downloading it anyway, you
might as well do it right:

$fp = fopen('http://example.com/image.jpg','r');
while (!feof($fp))
$image .= fread($fp,1024);
echo strlen($image);

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] Getting the filesize of an image?

2001-12-01 Thread faeton

Hello Matt,

So does that problem have a solution?

MM> Not on binary files.  For an image that's 4494 bytes, file/join/strlen gives
MM> me 3512.  And since file() on a remote file is downloading it anyway, you
MM> might as well do it right:
MM> $fp = fopen('http://example.com/image.jpg','r');
MM> while (!feof($fp))
MM> $image .= fread($fp,1024);
MM> echo strlen($image);
MM> Matt



Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] SAPI

2001-12-01 Thread Obasi Adande George

I have been trying to get apache2 to load the php4 module for a while now, but after 
consulting the bug report page, i was directed to seek assistance from you all. Is 
there any further files I may need to have this program p and running.

Thank You For Your Assistance in this matter
Obasi Adande George



[PHP] Cause of:`T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR'

2001-12-01 Thread Jason G.

Hello all,

I have ran across this error a number of times, and for those of you who 
are or will pulling out your hair, read on.

When you get a:

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or 
`T_VAR' or `'}'' in your_script.php on line 2149

Check to see if you have all of you { and } intact.
The error could be thousands of lines away, but the error message may point 
to the end of your file.

I notice this behavior when I am working on class definitions and forget to 
open close a block (switch, for, while) in a method in the class somewhere.

Hope it helps someone.

-Jason Garber
IonZoft.com






[PHP] how to get multiple checkbox values in a results page?

2001-12-01 Thread Ivan Carey

Hello,
I have a form with multiple checkboxes.
Their names are the same ie all are befname and their values are dynamically filled 
from a data base.
When I check multiple boxes I expect that an array of the values with the array named 
befname is sent to the results page. In my example the form action is inschk.php

If an array is sent to inschk.php how may I get the multiple values out of it.

If this can be done I then will insert the different values into a database.

At present if I check multiple checkboxes I can only see the value of the last 
checkbox that is checked.

Thanks,
Ivan



[PHP] Re: how to get multiple checkbox values in a results page?

2001-12-01 Thread Philip Hallstrom

Rename your form name to "befname[]"  Then you'll get them all... this is
in the manual somewhere if you need more info on it... don't remember
exactly where.

-philip

On Sun, 2 Dec 2001, Ivan Carey wrote:

> Hello,
> I have a form with multiple checkboxes.
> Their names are the same ie all are befname and their values are dynamically filled 
>from a data base.
> When I check multiple boxes I expect that an array of the values with the array 
>named befname is sent to the results page. In my example the form action is inschk.php
>
> If an array is sent to inschk.php how may I get the multiple values out of it.
>
> If this can be done I then will insert the different values into a database.
>
> At present if I check multiple checkboxes I can only see the value of the last 
>checkbox that is checked.
>
> Thanks,
> Ivan
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Strange problem...

2001-12-01 Thread Edgardo Rossetto

Hola Daniel:

Te escribo en castellano ya que veo que el inglés no es tu idioma natural.

Creo que el error se produce al concatenar las variables, acordate que para
indicar que las variables con cadenas tenés que encerrarlas entre "", yo lo
definiría así:

$user_birthdate = "$birth_year-$birth_month-$birth_day"; // 1982-12-08

Saludos

Edgardo

"Daniel alsén" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> i have a strange problem.
>
> I get a users birthdate with three dropdown menus (year, month and day of
> month). I get these values into one string with:
>
> $user_birthdate = $birth_year . $birth_month . $birth_day;
>
> If i echo $user_birthdate after this it is correct (mmdd). But when i
> insert the value of $user_birthdate into MySql it gets the value
'8388607'.
> It doesn´t matter what value $user_birthdate had originally - it always
> inserts as 8388607.
>
> Any ideas???
>
>
>
> The db question looks like this btw:
>
> $query = "INSERT INTO users ";
>
> $query .= "(user_name, user_birthdate, user_city, user_mail, user_icq,
> user_msn, user_www, user_login, user_password) ";
>
> $query .= " values('$user_name', '$user_birthdate', '$user_city',
> '$user_mail', '$user_icq', '$user_msn', '$user_www', '$user_login',
> '$user_password')";
>
>
> Regards
> # Daniel Alsén| www.mindbash.com #
> # [EMAIL PROTECTED]  | +46 704 86 14 92 #
> # ICQ: 63006462   | +46 8 694 82 22  #
> # PGP: http://www.mindbash.com/pgp/  #
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: SAPI

2001-12-01 Thread Fred

What is not working?  Are you getting an error message?

Fred

Obasi Adande George <[EMAIL PROTECTED]> wrote in message
000801c17ab6$5d77bf90$b6d45ed1@tbird">news:000801c17ab6$5d77bf90$b6d45ed1@tbird...
I have been trying to get apache2 to load the php4 module for a while now,
but after consulting the bug report page, i was directed to seek assistance
from you all. Is there any further files I may need to have this program p
and running.

Thank You For Your Assistance in this matter
Obasi Adande George




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Cause of:`T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR'

2001-12-01 Thread Fred

A couple of more pointers:

Check the line right before the parse error for missing }) or ;

Always close your curley braces right after you open them and then insert
your code lines between the braces. {}  This will prevent you from
forgetting to close your braces.

Never write a single script with 2149 lines of code ;)

Fred

Jason G. <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> I have ran across this error a number of times, and for those of you who
> are or will pulling out your hair, read on.
>
> When you get a:
>
> Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or
> `T_VAR' or `'}'' in your_script.php on line 2149
>
> Check to see if you have all of you { and } intact.
> The error could be thousands of lines away, but the error message may
point
> to the end of your file.
>
> I notice this behavior when I am working on class definitions and forget
to
> open close a block (switch, for, while) in a method in the class
somewhere.
>
> Hope it helps someone.
>
> -Jason Garber
> IonZoft.com
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Updating parts of files without rewriting them

2001-12-01 Thread Jeff Lewis

I have a file that contains settings and there are a lot of comments in
there and a lot of variables.  An excerpt of the file looks like below.  My
question is, is it possible to change only certain variables?  For example,
I want to set just the db variables, is it possible for me to input the new
values in a form and replace only those in the file without having to
rewrite the entire file?

$mailtype = 0; # 0 - sendmail, 1 - SMTP

## Database Info ##
$db_name = "name";
$db_user = "user";
$db_passwd = "pass";
$db_server = "localhost";

## Directories/Files ##
# Note: directories other than $imagesdir do not have to be changed unless
you move things

$boarddir = "."; # The absolute path to the folder (usually can be left
as '.')
$sourcedir = "./Sources";   # Directory with source files



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Updating parts of files without rewriting them

2001-12-01 Thread Fred

You cannot make changes to a file without writing the entire contents of the
file to disk.  On the other hand, you do not need to manually re-create the
entire contents.  Simple read the file into a variable and use regular
expressions to replace the old lines with new ones and then write the file
to disk.  For what its worth, I cannot think of a justification for keeping
any settings other than database settings in a file.  I would recommend
keeping all settings, other than database access settings, in a database.
This makes accessing and updating the settings much easier.  The only reason
database settings must be in a file is because you obviously cannot access
the database without them (unless you use default settings in the php.ini
file).

Fred

Jeff Lewis <[EMAIL PROTECTED]> wrote in message
002801c17ad9$7ec8b820$0100a8c0@cr983033a">news:002801c17ad9$7ec8b820$0100a8c0@cr983033a...
> I have a file that contains settings and there are a lot of comments in
> there and a lot of variables.  An excerpt of the file looks like below.
My
> question is, is it possible to change only certain variables?  For
example,
> I want to set just the db variables, is it possible for me to input the
new
> values in a form and replace only those in the file without having to
> rewrite the entire file?
>
> $mailtype = 0; # 0 - sendmail, 1 - SMTP
>
> ## Database Info ##
> $db_name = "name";
> $db_user = "user";
> $db_passwd = "pass";
> $db_server = "localhost";
>
> ## Directories/Files ##
> # Note: directories other than $imagesdir do not have to be changed unless
> you move things
>
> $boarddir = "."; # The absolute path to the folder (usually can be
left
> as '.')
> $sourcedir = "./Sources";   # Directory with source files
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Few quick questions on php 4.1

2001-12-01 Thread Joelmon2001

I saw a download for it a few days ago but I am curious to know:

A.) how stable is it
B.) Is there offically a known 'make' one must have on linux to install it?
3.7.7 ok? (Freetype I found out 3.7.8 or higher according to a developer of 
freetype)
C.) what are the new features and when is it officially up from php.net?

Unless I am a picklehead and I missed it was released like today or yesterday

Thanks 
Joel



[PHP] HTTP_SESSION_VARS != Work

2001-12-01 Thread Andrew Forgue

Hello,

Slight Problem:

--
This piece of code:

session_start();
unset($testvar);
session_register("testvar"); $HTTP_SESSION_VARS["testvar"] = "testval";
print "Global: $testvar | Track_var: " . $HTTP_SESSION_VARS["testvar"] . ".";
$testvar = "testglobalassign";
print "Global: $testvar | Track_var: " . $HTTP_SESSION_VARS["testvar"] . ".";

Produces this output:

Global: | Track_var:
Global: testglobalassign | Track_var:



Now, The other HTTP_*_VARS works just fine. I dont know where to go to fix this. The 
Php.ini file says:

register_globals: on
and I compiled it with --enable-track-vars (even though it should be on by default) 

PHP version is 4.0.6 with apache 1.3.22

Anyone seen this problem or know how to fix?

Thanks, 
Andrew








[PHP] Re: HTTP_SESSION_VARS != Work

2001-12-01 Thread Fred

It looks like it is working as expected.  You must note two things.

First, session variables are updated to new values only when you explicitly
call session_register or when the script ends.  When you call
session_register, the session variable will have the value that the global
variable had at the time the session_register is called.  In your case the
variable is not set so the session variable is empty.  When the script ends
the session variable is assigned the value held by the global variable when
the script ends.  This is why you get "" when you try to print the session
variables.  They have never been updated.

Second, the HTTP_SESSION_VARS array is read only.  You cannot assign values
to session variables this way.  You can only assign values to session
variables by assigning values to the global variable that has been
registered with the session.  This is why neither the global or session
variable was changed in the first part of your example.

Fred

Andrew Forgue <[EMAIL PROTECTED]> wrote in message
002c01c17af4$a765f390$6701a8c0@ajf">news:002c01c17af4$a765f390$6701a8c0@ajf...
Hello,

Slight Problem:

--
This piece of code:

session_start();
unset($testvar);
session_register("testvar"); $HTTP_SESSION_VARS["testvar"] = "testval";
print "Global: $testvar | Track_var: " . $HTTP_SESSION_VARS["testvar"] .
".";
$testvar = "testglobalassign";
print "Global: $testvar | Track_var: " . $HTTP_SESSION_VARS["testvar"] .
".";

Produces this output:

Global: | Track_var:
Global: testglobalassign | Track_var:



Now, The other HTTP_*_VARS works just fine. I dont know where to go to fix
this. The Php.ini file says:

register_globals: on
and I compiled it with --enable-track-vars (even though it should be on by
default)

PHP version is 4.0.6 with apache 1.3.22

Anyone seen this problem or know how to fix?

Thanks,
Andrew









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Testing Alert: Significant changes to DOM-XML

2001-12-01 Thread Markus Fischer

[This mail goes out to php-dev, php-qa and php-general and
has its Reply-To: set to php-dev!]

Hi Zak,

thanks for the mail, I was thinking about writing such a mail
myself but was to tired I guess.


Yep, the CVS note to the latest ext/domxml changes state it
clearly:

# Testers/patches/contribs welcome.

The actual changelog can be found here [1].


Also for anyone out there who has no idea about CVS: It won't
help me anything filing bug reports against any released
source code of PHP out there. Please use the HEAD branch when
filing bug reports. See CVS instructions at
http://www.php.net/anoncvs.php how to achive this.


Although I don't expect a rush on this ;) I want to give out
some simple rules for anyone helping us getting domxml more
stable:

.) If you have a reproduceable crash with small
   self-containing script with no other external
   dependencies than loading a file ->

don't forget to use the bug reporting system!

   Do not mail me privately about it!

   No, I'm not lazy or whatever but I wan't to broaden
   the audience reading about the bugs (two eyes see less
   than more eyes) and it also helps me keeping track of
   all the problems.

.) If you have a reproduceable crash but can't create a
   small self-containing script, there are three options:

1) still try to create one (prefered)

2) Provide backtrace in your bug report
   ('bt full' command, not normal bt)

3) give me access to your devel system
   (no, no joke. This has worked in the past, it can
   in the future) But no promises.

.) Before reporting, try creating a testcase which is
   suiteable to run on the command line of PHP (read:
   with the CGI version).

   Apache is nice but it adds some extra work when
   handling the bugs I prefer the reproduceable scripts
   which use the CGI version for testing and don't
   contain any fancy  tags but newlines and such
   instead. The find bug/fix it cycle is much faster
   without apache.

   Again, I'm not lazy, but I'm also using MSVC for
   debugging and although I'm not a windows fan I've seen
   myself being faster chasing down bugs with it then
   with gdb (doh!).

.) Patches can go directly to me; but please also tell me
   why and what and give a testing script and not only
   send a diff to me.

   Of cousre, anyone with the proper karma is encouraged
   to fix it himself (you might want to check back if I'm
   not currently working on it).

.) NEW FEATURES

   No, I do NOT plan to add now featuers. I'm just
   interesting in making the current version more stable
   but time doesn't permit to expand this scope.

   But you're still encouraged to use the bug report
   system to put your feature requests there or do it
   yourself.


What I wrote done seems normal to me and I do not explicetely
prefer this for domxml but anything else too. Saves mit quite
lot of time.


On Sat, Dec 01, 2001 at 08:19:47PM -0700, Zak Greant wrote : 
> Marcus Fischer has made [...]

Yo, and its still MarKKKus ;-)

- Markus

[1] http://cvs.php.net/cvs.php/php4/ext/domxml/php_domxml.c

-- 
Please always Cc to me when replying to me on the lists.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] call_user_func problem

2001-12-01 Thread Papp Gyozo

| That means that you should create a .htaccess file containing that:
| 
| php_value allow_call_time_pass_reference 1
| 
| That should work :)

But as the errormessage mentioned it may not supported in future version.
I think if you declare your function arguments to be passed by variables
then you don't need to explicitly set it in call-time.

does it work? (i've not tried yet.)

$result = call_user_func("foo", $bar);
function foo( &$bar ) {
   $bar .= 'foobar';
   return 1;
}


| 
| C> Prior to 4.0.6 it worked fine, however, now when I try:
| 
| C> $result = call_user_func("foo", &$bar);
| 
| C> function foo( &$bar ) {
| C>$bar .= 'foobar';
| C>return 1;
| C> }
| 
| C> I get this:
| 
| C> Warning: Call-time pass-by-reference has been deprecated - argument passed
| C> by value; If you would like to pass it by reference, modify the declaration
| C> of call_user_func(). If you would like to enable call-time
| C> pass-by-reference, you can set allow_call_time_pass_reference to true in
| C> your INI file. However, future versions may not support this any longer.
| 
| C> Does that mean I can't pass by reference anymore? I kinda need to (the two
| C> functions above are not my actual functions btw)
| 
| 
| 
| Ivan 'Faeton aka xetrix' Danishevsky
| ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
| ::: Ńëîíű ďî äĺpĺâü˙ě íĺ ëŕçŕţň. Îíč ěîăyň, íî čő ëîěŕĺň. :::
| 
| 
| -- 
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|