php-general Digest 3 Dec 2001 10:32:24 -0000 Issue 1030

Topics (messages 76352 through 76370):

Question about adding library to use with php
        76352 by: Joelmon2001.aol.com

SQL state S1090: Almost connected to mysql via PHP/odbc
        76353 by: mweb
        76357 by: Venu
        76358 by: mweb

content disposition and internet exploder
        76354 by: Fred
        76355 by: Jason Murray
        76356 by: Rasmus Lerdorf
        76359 by: Fred
        76360 by: Fred

Re: A tricky one?
        76361 by: Justin French

Re: How to set file extension php Mac OSX and PHP 4.0.6
        76362 by: Rasmus Lerdorf

pages will not refresh publically
        76363 by: Keith Kwasigroch
        76364 by: Miles Thompson

4800           Would you like to lose weight while you sleep?                  5060017
        76365 by: 1750600ultimate.excite.com

Re: why didnt you come watch me on my webcam? you said you would! w
        76366 by: Steve Maroney

problems with looping array
        76367 by: Jordan
        76368 by: Fred
        76369 by: Jordan

Re: best way to handle a form with 60 fields !!!
        76370 by: Krzysztof Kocjan

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, i have one simple question

With php installed, if the time comes where I want to add another library, 
let's say ming, do I redo the ./congigure script or do I redo the 
installation or just edit one file to accomodate the new software so it can 
work with php? This way if there is software not configured with php at the 
moment that comes out in a year or what not, I would know what to do.

This is one area I am confused with. I am not sure if it is necessary to redo 
installation or just one simple modification.

Thanks
--- End Message ---
--- Begin Message ---
Hello,

thanks to the precious suggestions I had on this list some day ago, I have 
made some progresses, or at least have something new to report.
I would like to ask now above the error mentioned in the subject, because I
have not found it inside www.,mysql.com

I have a database called m97. It *is* listed when I run "show databases" in 
themysql monitor. It *shows* when I run isql -v m97.
 I have modified /etc/odbc.ini and /etc/odbcinst.ini and /etc/odbc.ini as 
follows:

/etc/odbc.ini

[m97]
Trace    = On
TraceFile= stderr
Driver   = /usr/lib/libmyodbc.so
DSN      = m97
SERVER   = localhost 
USER     = test
PASSWORD = gee
PORT     = 3306 
OPTIONS = 1
DATABASE= m97
SOCKET  = /tmp/mysql.sock
#############################################

/etc/odbcinst.ini

# From the MyODBC package
[MySQL]
Description     = ODBC for MySQL
Driver          = /usr/lib/libmyodbc.so
FileUsage       = 1

In the PHP file I have:
putenv("LD_LIBRARY_PATH=/usr/lib/");
putenv("ODBCINSTINI=/etc/odbcinst.ini");
putenv("ODBCINI=/etc/odbc.ini");
$DSN="m97";
        $cnx = odbc_connect( $DSN , 'test', 'gee' );

The result in netscape is still:

Warning: SQL error: [unixODBC][TCX][MyODBC]Invalid DSN specified, SQL state 
S1090 in SQLConnect in
/home/mweb/public_html/test.php on line 360
--- End Message ---
--- Begin Message ---
Hi, 

> -----Original Message-----
> From: mweb [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 02, 2001 2:03 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: SQL state S1090: Almost connected to mysql via PHP/odbc
> 
> 
> Hello,
> 
> thanks to the precious suggestions I had on this list some day ago, I have 
> made some progresses, or at least have something new to report.
> I would like to ask now above the error mentioned in the subject, because I
> have not found it inside www.,mysql.com
> 
> I have a database called m97. It *is* listed when I run "show databases" in 
> themysql monitor. It *shows* when I run isql -v m97.
>  I have modified /etc/odbc.ini and /etc/odbcinst.ini and /etc/odbc.ini as 
> follows:
> 
> /etc/odbc.ini
> 
> [m97]
> Trace    = On
> TraceFile= stderr
> Driver   = /usr/lib/libmyodbc.so
> DSN      = m97
> SERVER   = localhost 
> USER     = test
> PASSWORD = gee
> PORT     = 3306 
> OPTIONS = 1
> DATABASE= m97
> SOCKET  = /tmp/mysql.sock
> #############################################
> 
> /etc/odbcinst.ini
> 
> # From the MyODBC package
> [MySQL]
> Description     = ODBC for MySQL
> Driver          = /usr/lib/libmyodbc.so
> FileUsage       = 1
> 
> In the PHP file I have:
> putenv("LD_LIBRARY_PATH=/usr/lib/");
> putenv("ODBCINSTINI=/etc/odbcinst.ini");
> putenv("ODBCINI=/etc/odbc.ini");
> $DSN="m97";
>       $cnx = odbc_connect( $DSN , 'test', 'gee' );
> 
> The result in netscape is still:
> 
> Warning: SQL error: [unixODBC][TCX][MyODBC]Invalid DSN specified, SQL state 
> S1090 in SQLConnect in
> /home/mweb/public_html/test.php on line 360
> 

The problem is that, unixODBC is not able to find your MyODBC 
DSN entry. This is probably due to the fact that it is not picking 
the right odbc.ini file.

Did you tried by using isql -v m97 to check whether it is 
really picking the .ini or not.

For more information on howto setup MyODBC, unixODBC and 
MySQL, refer to the following link:
http://lists.mysql.com/cgi-ez/ezmlm-cgi?5:mss:3657:200108:einnhiokafobjmjbmcbm

Regards, Venu
--
For technical support contracts, go to https://order.mysql.com
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Mr. Venu <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Developer
/_/  /_/\_, /___/\___\_\___/  California, USA
       <___/  www.mysql.com


--- End Message ---
--- Begin Message ---
On Sunday 02 December 2001 23:18, Venu wrote:
<snip>
> > in themysql monitor. It *shows* when I run isql -v m97.
> >  I have modified /etc/odbc.ini and /etc/odbcinst.ini and /etc/odbc.ini as
<snip>
> The problem is that, unixODBC is not able to find your MyODBC
> DSN entry. This is probably due to the fact that it is not picking
> the right odbc.ini file.
> Did you tried by using isql -v m97 to check whether it is
> really picking the .ini or not.

Venu,
I tried, as posted in the original message. Also, I put the complete path to 
the odbc.ini file listing that DSN (see again original post).
There is certainly something wrong with my config files, but I'm checking 
them aginst all the documentation I found so far, and nothing appears.
Any help is appreciated.

                mweb
--- End Message ---
--- Begin Message ---
I am attempting to allow users to download csv files that are created
dynamically from a database.  In order to do so  I use:

header( "Content-Disposition: attachment, filename=query.csv");

This works fine in NS, but not in IE, as it always attempts to save the file
using the script name instead of the filename in the header.  I have read
numerous posts and articles on MS site as well as this list about bugs in MS
4.01 5.0 and 5.5, but each article claims that the problem is fixed with SP2
etc.  I have installed each of the service packs and have not been able to
get this to work correclty on any of them.

Has anyone had success in getting IE to use the correct filename when
downloading dynamically generated files?

Fred


--- End Message ---
--- Begin Message ---
> I am attempting to allow users to download csv files that are created
> dynamically from a database.  In order to do so  I use:
> 
> header( "Content-Disposition: attachment, filename=query.csv");
[snip]
> Has anyone had success in getting IE to use the correct filename when
> downloading dynamically generated files?

I just use:

 Header("Content-disposition: filename=".$filename);

... ie, no "attachment".

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"
--- End Message ---
--- Begin Message ---
You could just trick it with a URL like:

http://your.domain.com/script.php/query.csv

IE will think your script is called query.csv while Apache is smart enough 
to run script.php.

-Rasmus

On Sun, 2 Dec 2001, Fred wrote:

> I am attempting to allow users to download csv files that are created
> dynamically from a database.  In order to do so  I use:
> 
> header( "Content-Disposition: attachment, filename=query.csv");
> 
> This works fine in NS, but not in IE, as it always attempts to save the file
> using the script name instead of the filename in the header.  I have read
> numerous posts and articles on MS site as well as this list about bugs in MS
> 4.01 5.0 and 5.5, but each article claims that the problem is fixed with SP2
> etc.  I have installed each of the service packs and have not been able to
> get this to work correclty on any of them.
> 
> Has anyone had success in getting IE to use the correct filename when
> downloading dynamically generated files?
> 
> Fred
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
LOL
Of course it worked.  Open Source outwits MS yet again.

Fred

Rasmus Lerdorf <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You could just trick it with a URL like:
>
> http://your.domain.com/script.php/query.csv
>
> IE will think your script is called query.csv while Apache is smart enough
> to run script.php.
>
> -Rasmus
>
> On Sun, 2 Dec 2001, Fred wrote:
>
> > I am attempting to allow users to download csv files that are created
> > dynamically from a database.  In order to do so  I use:
> >
> > header( "Content-Disposition: attachment, filename=query.csv");
> >
> > This works fine in NS, but not in IE, as it always attempts to save the
file
> > using the script name instead of the filename in the header.  I have
read
> > numerous posts and articles on MS site as well as this list about bugs
in MS
> > 4.01 5.0 and 5.5, but each article claims that the problem is fixed with
SP2
> > etc.  I have installed each of the service packs and have not been able
to
> > get this to work correclty on any of them.
> >
> > Has anyone had success in getting IE to use the correct filename when
> > downloading dynamically generated files?
> >
> > Fred
> >
> >
> >
> >
>


--- End Message ---
--- Begin Message ---
That works fine in IE but does not work in NS, undoubtedly because it does
not conform to the RFC.

Fred

Jason Murray <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am attempting to allow users to download csv files that are created
> > dynamically from a database.  In order to do so  I use:
> >
> > header( "Content-Disposition: attachment, filename=query.csv");
> [snip]
> > Has anyone had success in getting IE to use the correct filename when
> > downloading dynamically generated files?
>
> I just use:
>
>  Header("Content-disposition: filename=".$filename);
>
> ... ie, no "attachment".
>
> Jason
>
> --
> Jason Murray
> [EMAIL PROTECTED]
> Web Developer, Melbourne IT
> "Work now, freak later!"


--- End Message ---
--- Begin Message ---
Basically, you want to do is evaluate if they entered anything for each
item, and if so, print an additional line to the message.

<?

$message = "I would like to order:\n";
if($pizza != "") { $message .= "Pizza: $pizza \n"; }
if($chips != "") { $message .= "Chips: $chips \n"; }
if($hamburger != "") { $message .= "Hamburger: $hamburger \n"; }

?>

Explanation:
$message .= "blah"; appends "blah" onto the end of the string $message
\n is a new line (I dunno, you might be a newbie!!)

If they entered 2 hamburgers and one pizza into the form, then the
result of $message would be:

---
I would like to order:
Pizza: 1
Hamburger: 2
---

I think you get the drift.


There are DEFINATELY better ways to write this code, but it's the
simplest to understand.


Justin French





Raymond Lilleodegard wrote:
> 
> Thanks for answering.
> 
> But this only works if the customer orders one of each. Do you know how to
> do it if, lets say the customer order 2 hamburgers and nothing else?
> 
> Raymond
> 
> "Raymond LilleøDegåRd" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi!
> >
> > I'm trying to make this form working with a mail() script.
> > I made this form. Then the customer could write how many "pizzas" or
> > "hamburgers" as he want.
> > But how do I solve this without too much headache? Havent slept for days
> > because of this problem : )
> >
> >
> > <input type="text" name="pizza">
> > <input type="text" name="chips">
> > <input type="text" name="hamburger">
> >
> >
> > -------- script ----------------
> > <?php
> > /* recipients */
> > $to  = "[EMAIL PROTECTED]" ;
> >
> > /* subject */
> > $subject = "Order";
> >
> > /* message */
> > $message = "I would like to order $?";
> >
> > /* To send HTML mail, you can set the Content-type header. */
> >
> > /* additional headers */
> > $headers = "From: Someone <[EMAIL PROTECTED]>\r\n";
> >
> >
> > /* and now mail it */
> > mail($to, $subject, $message, $headers);
> >
> >
> > Best regards
> >
> > Raymond
> >
> >
> 
> --
> 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]
--- End Message ---
--- Begin Message ---
In your httpd.conf file, add:

AddType application/x-httpd-php .php4

On Sun, 2 Dec 2001, [ISO-8859-1] René Fournier wrote:

> I have successfully installed PHP 4.0.6, and it works! Only problem is 
> that Apache only sends files to the PHP module that have a .php 
> extension. However, I need to name the files .php4 (long story). As it 
> stands, all I see is the actual PHP source, not the output.
> 
> Does anyone know how I can change Apache and/or the PHP module to 
> recognize .php4 files and execute them as such?
> 
> Thanks.
> 
> ...Rene
> 
> 
> 

--- End Message ---
--- Begin Message ---
I have a W2k box setup with IIS and PHP.  It works fine, well almost.  I can
create a .php page and it works great.  But, when I edit that page, the old
page still shows up pubically.  The page is updated if I open it from within
the private network.  For instance:  www.domain.com displays old page, but
192.168.x.x displays updated page.

????

Thanks in advance for any help.


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

Sounds like the old page is cached somewhere along the line. I am assuming 
that the same server is serving both the Internet and the private network, 
and there's no "Oops, forgot up upload it." <smack on the side of the head>

Miles

At 08:32 PM 12/2/2001 -0500, Keith Kwasigroch wrote:
>I have a W2k box setup with IIS and PHP.  It works fine, well almost.  I can
>create a .php page and it works great.  But, when I edit that page, the old
>page still shows up pubically.  The page is updated if I open it from within
>the private network.  For instance:  www.domain.com displays old page, but
>192.168.x.x displays updated page.
>
>????
>
>Thanks in advance for any help.
>
>
>
>--
>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]

--- End Message ---
--- Begin Message ---
 As seen on NBC, CBS, CNN, and even Oprah! The health 
discovery that actually reverses aging while burning fat, 
without dieting or exercise! This proven discovery has even 
been reported on by the New England Journal of Medicine. 
Forget  aging and dieting forever! And it's Guaranteed!   

Click here:
http://ultimatehgh1000.81832.com

Would you like to lose weight while you sleep!
No dieting!
No hunger pains!
No Cravings!
No strenuous exercise!
Change your life forever! 

100% GUARANTEED!

1.Body Fat Loss            82% improvement.
2.Wrinkle Reduction     61% improvement.
3.Energy Level               84% improvement.
4.Muscle Strength         88% improvement.
5.Sexual Potency           75% improvement.
6.Emotional Stability     67% improvement.
7.Memory                        62% improvement.


You are receiving this email as a subscriber
to the Opt-In America Mailing List. 
To remove yourself from all related maillists,
just click here:
mailto:[EMAIL PROTECTED]?Subject=REMOVE

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

On Fri, 30 Nov 2001 [EMAIL PROTECTED] wrote:

> Below is the result of your feedback form.  It was submitted by
>  ([EMAIL PROTECTED]) on Friday, November 30, 2001 at 20:45:27
> ---------------------------------------------------------------------------
>
> : hey babe, it's karina remember me? if you don't im 5'8" with brown hair and blue 
>eyes with an ass you can bounce a quarter off of :) Im 21 years old and im in my 
>final year of college at OSU in OREGON! i just got my first webcam and i love meeting 
>new people on it and just showing my body off. i want you to come watch me do a 
>striptease! my website is located at: http://sepimpin.brinkster.net/ if that doesnt 
>work try http://karina.tk.ru/ ~ LOVE ALWAYS! -Karina XOXOXO<33
>
> ---------------------------------------------------------------------------
>
>
> --
> 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]
>
>


Sorry, We're to busy with PHP !





Thank you,
Steve Maroney




--- End Message ---
--- Begin Message ---
here's the situation.  I'm making a shopping cart, when an item is added
it's item number is added into an array.  I then want this array's items to
be compared agains the database.  Unfortunately I haven't been able to use a
variable in the query string of MySQL.  something along the lines of....


<?PHP

   include ('connect.php');

   $result = mysql_query("SELECT * FROM ar
   LEFT JOIN company on ar.company_id=company.company_id
   LEFT JOIN scale on ar.scale_id=scale.scale_id
   WHERE item_number =" . $item[$index]);

?>

where $item is the array of item numbers and $index is an auto incrementing
number that increments at the end of the loop.  Please help if you know of
anyway to use this variable.  Also, I can post my whole script if needed...I
just didn't want unneeded info posted.  Thanks in advance.

-Jordan


--- End Message ---
--- Begin Message ---
Strings in your sql query must be quoted.  Try this instead:

>    $result = mysql_query("SELECT * FROM ar
>    LEFT JOIN company on ar.company_id=company.company_id
>    LEFT JOIN scale on ar.scale_id=scale.scale_id
>    WHERE item_number = \"$item[$index]\")";

Fred

Jordan <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> here's the situation.  I'm making a shopping cart, when an item is added
> it's item number is added into an array.  I then want this array's items
to
> be compared agains the database.  Unfortunately I haven't been able to use
a
> variable in the query string of MySQL.  something along the lines of....
>
>
> <?PHP
>
>    include ('connect.php');
>
>    $result = mysql_query("SELECT * FROM ar
>    LEFT JOIN company on ar.company_id=company.company_id
>    LEFT JOIN scale on ar.scale_id=scale.scale_id
>    WHERE item_number =" . $item[$index]);
>
> ?>
>
> where $item is the array of item numbers and $index is an auto
incrementing
> number that increments at the end of the loop.  Please help if you know of
> anyway to use this variable.  Also, I can post my whole script if
needed...I
> just didn't want unneeded info posted.  Thanks in advance.
>
> -Jordan
>
>


--- End Message ---
--- Begin Message ---
I tried but nothing different happened.  I'm still playing though and I'll
see if I can make it work.  I'm new to all of this...so we'll see how it
goes.  Thanks for your help.

-jordan


Fred <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Strings in your sql query must be quoted.  Try this instead:
>
> >    $result = mysql_query("SELECT * FROM ar
> >    LEFT JOIN company on ar.company_id=company.company_id
> >    LEFT JOIN scale on ar.scale_id=scale.scale_id
> >    WHERE item_number = \"$item[$index]\")";
>
> Fred
>
> Jordan <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > here's the situation.  I'm making a shopping cart, when an item is added
> > it's item number is added into an array.  I then want this array's items
> to
> > be compared agains the database.  Unfortunately I haven't been able to
use
> a
> > variable in the query string of MySQL.  something along the lines of....
> >
> >
> > <?PHP
> >
> >    include ('connect.php');
> >
> >    $result = mysql_query("SELECT * FROM ar
> >    LEFT JOIN company on ar.company_id=company.company_id
> >    LEFT JOIN scale on ar.scale_id=scale.scale_id
> >    WHERE item_number =" . $item[$index]);
> >
> > ?>
> >
> > where $item is the array of item numbers and $index is an auto
> incrementing
> > number that increments at the end of the loop.  Please help if you know
of
> > anyway to use this variable.  Also, I can post my whole script if
> needed...I
> > just didn't want unneeded info posted.  Thanks in advance.
> >
> > -Jordan
> >
> >
>
>


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


Fred wrote:

> Third, it is ineffecient and unneccessary to put 60 fields in a single form.
> If you are using the GET method it probably will not work since it passes
> the variable names and values in the URL, which has a maximum length of 255


In my mind maximum length 255 is not true. There isn't any limit for 
GET/POST requests as I read in RFC documents. The limit depends on Your 
web server implementation. I've never tested but suppose Apache could 
handle GET method with URL longer than 255 characters. I've never had 
problems with form's data length using Apache and GET/POST methods.
But if I'm wrong I apologize.

Krzysztof



-------------R----E----K----L----A----M----A---------------
Juz w sprzedazy. Katalog Samochodowy AUTO TESTY 2002. 
Ceny i dane techniczne 1400 samochodow, 236 raportow z jazd,
testy porownawcze, wszystko o bezpieczenstwie.

--- End Message ---

Reply via email to