Re: [PHP] Does not work

2002-07-15 Thread Alberto Serra

ðÒÉ×ÅÔ!

Saci wrote:
 Who cares about privacy on my own company Intranet ?

Anyone not willing to show where they has been surfing on the net to any 
unexperienced bycomer. Youu may read the history, but you just have *no* 
warranty that it will not be cleared at runtime.

Since you have control on the machines (which you should have said at 
the beginning to have people help you) you'd be better off by having 
them configured to actually give the HTTP_referer string to Apache. It 
would be much more solid.

Besides, there *are* international laws concerning privacy at work, so I 
am not sure a determined employee could not getting your company into 
trouble because of your watching what he is doing.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




RE: [PHP] Does not work

2002-07-14 Thread Michael Geier

from PHP documentation:
http://www.php.net/manual/en/reserved.variables.php

'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the
current page. This is set by the user agent. Not all user agents will set
this, and some provide the ability to modify HTTP_REFERER as a feature. In
short, it cannot really be trusted.

 -Original Message-
 From: Saci [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, July 14, 2002 2:11 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Does not work


 I tried this simple code

 html
 body
 Page refered by
 ?php
 echo $HTTP_REFERER.'br';
 echo $_SERVER['HTTP_REFERER'].'br';
 ?
 /body
 /html

 and I receive blank reply even if referenced from a link from other site.

 What am i doing wrong ? Or perhaps my server does not have
 referer enabled?





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



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




Re: [PHP] Does not work

2002-07-14 Thread Saci

// HTTP_REFERER as a feature. In  short, it cannot really be trusted.

Anybody know how to do that using JAva history with PHP together , or any
other methode that works and can be trusted.



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




Re: [PHP] Does not work

2002-07-14 Thread Alberto Serra

ðÒÉ×ÅÔ!

Saci wrote:
 // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
 
 Anybody know how to do that using JAva history with PHP together , or any
 other methode that works and can be trusted.

Thank god no method can be trusted :) History even less the the 
referrer. Just think of the frequency at which people in their offices 
clear it to avoid bosses seeing where they surfed while they were 
supposed to work...

You'll never get a secure method, and if you do I'll personally report 
you to the authority for protection of privacy :) Marketing dotcoms 
would just love to do it, but fortunately it cannot be done :) Relax, 
you can live without knowing where some of the guys came from. Most 
won't mind telling you. But I just cleared my history immediately after 
reading your msg :) Pavlovian reaction ;)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Does not work

2002-07-14 Thread Justin French

Pffft you can't trust Java, JavaScript or anything on the server side at
all.  Since it's set by the browser (client) itself, the best you can do is
test for it, and provide a fall back option.

For the bulk of users, this will be okay, because they're on IE.  What you
need to be carefull of is what effect your fall back has on the unknown
browsers.

Or design/program without the need to know what they're using :D


Justin French


on 15/07/02 5:34 AM, Saci ([EMAIL PROTECTED]) wrote:

 // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
 
 Anybody know how to do that using JAva history with PHP together , or any
 other methode that works and can be trusted.
 
 


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




Re: [PHP] Does not work

2002-07-14 Thread Saci

To say the minumum yor reply does not help in nothing.

Who cares about privacy on my own company Intranet ?



Alberto Serra [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ðÒÉ×ÅÔ!

 Saci wrote:
  // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
 
  Anybody know how to do that using JAva history with PHP together , or
any
  other methode that works and can be trusted.

 Thank god no method can be trusted :) History even less the the
 referrer. Just think of the frequency at which people in their offices
 clear it to avoid bosses seeing where they surfed while they were
 supposed to work...

 You'll never get a secure method, and if you do I'll personally report
 you to the authority for protection of privacy :) Marketing dotcoms
 would just love to do it, but fortunately it cannot be done :) Relax,
 you can live without knowing where some of the guys came from. Most
 won't mind telling you. But I just cleared my history immediately after
 reading your msg :) Pavlovian reaction ;)

 ÐÏËÁ
 áÌØÂÅÒÔÏ
 ëÉÅ×


 @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

 LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
 lOrD i'M sHiNiNg...
 YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is...




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




RE: [PHP] Does not work

2002-07-14 Thread Peter



 -Original Message-
 From: Saci [mailto:[EMAIL PROTECTED]]
 Sent: Monday, 15 July 2002 12:51 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Does not work
 
 
 To say the minumum yor reply does not help in nothing.
 
 Who cares about privacy on my own company Intranet ?
 
 
u the bosses.. the employees tring to hide where they been from the bosses... the 
network admin... the list goes on and on and on and on and on and on and on ...


Re: [PHP] Does not work

2002-07-14 Thread Saci

I agree, I made a mistake on my last reply , and I apologize for that.

Thank you also for you for your coments, but my main question still open
without any related reply.





  To say the minumum yor reply does not help in nothing.
 
  Who cares about privacy on my own company Intranet ?

 1. I don't believe you specified this was a company intranet, but you may
 have.

 2. Generally it's a good idea to get things right the first time, rather
 than assuming that something will always remain in it's current state.  I
 tend to copy-and-paste a lot of code from one project to another, or
 assemble libraries of code.  It might be okay for you to say this code
 works for a limited environment, and i'm happy with that, but will you
 remember this when:

 a) you copy it across to another project
 b) the status of the project changes or is extended
 c) the project is no longer in your control

 If you insist on sticking with this limitation, do yourself and your
 co-workers a favour, and ensure you:

 a) comment your code well, pointing out the limitation
 b) do some minimal (at least) error handling to deal with the fact that it
 may not be there

 3. The reply WAS helpful, raised some important issues, and IMHO you
should
 have thanked the poster for being kind enough to point out issues you may
 not have thought of.  You could have easily replied with thanks for those
 pointers, but I'm less concerned with privacy, since this is a corporate
 intranet.


 I'm not sure I'd ever help you again, if I'd received a reply such as
yours.


 Justin French




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




Re: [PHP] Does not work

2002-07-14 Thread Justin French

This works for me, PHP 4.1.1

Upon first loading the page, I get nothing, but when I click on go, I get
both referrer address' echoed.

refer.php:
---
html
body
A HREF=refer.phpgo/aBRBR

Page refered by
?php
echo $HTTP_REFERER.'br';
echo $_SERVER['HTTP_REFERER'].'br';
?
/body
/html
---



It's already been said but:


1. are you sure php is working (with other files, and with simple echo
hello world!; type stuff)?


2. use this file (phpinfo.php) to test for the existence of HTTP_REFERER:

refer.php:
---
html
body
A HREF=refer.phpgo/aBRBR

Page refered by
?php
echo $HTTP_REFERER.'br';
echo $_SERVER['HTTP_REFERER'].'br';
?
/body
/html
---

Upon first loading, it will not be set, but when you click go, you have a
referer, and it is set.  For me, it's listed under the Apache Environment
heading.


If you still can't get a referrer var after all that, then there's an issue
with your server (are you using apache) or perhaps the client (browser).

because it *should* be simple.


Justin French


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




Re: [PHP] Re: PHP does not work??

2002-07-02 Thread Richard Lynch

I forgot to point out another disadvantage of turning on register_globals
apart from that of security is that when you are sending a page with a
form to the same page, e.g:

form name=whatever action=$PHP_SELF method=post

there is a tendency to lose info..  E.g.
If you are sending text separated by spaces you only manage to
send the first word this can be overcome by using the
htmlspecialchars('value') method to evaluate value...

turning on globals is to make the coding easier but has a
good deal of disadvantages...

register_globals on or off is completely irrelevant to using urlencode (GET)
or htmlentities (POST) to send properly formatted strings to the browser.

If you want to delude yourself the register_globals off significantly
increases security, go ahead, but don't claim that it somehow fixes
badly-encoded HTML.  It doesn't.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Re: PHP does not work??

2002-06-28 Thread Scott Fletcher

Not a problem, I can make some code modification.  Sometime it is better to
do it now and not have so much headache later on when more features are
being added.

Scott
Kondwani Spike Mkandawire [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I forgot to point out another disadvantage of turning on register_globals
 apart from that of security is that when you are sending a page with a
 form to the same page, e.g:

 form name=whatever action=$PHP_SELF method=post

 there is a tendency to lose info..  E.g.
 If you are sending text separated by spaces you only manage to
 send the first word this can be overcome by using the
 htmlspecialchars('value') method to evaluate value...

 turning on globals is to make the coding easier but has a
 good deal of disadvantages...

 Spike...
 Scott Fletcher [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Um, alright, I'll just leave the code in the hyperlink the way it is.
It
 is
  not possible to use the form or post of some sort for the hyperlink.
  form will work with the submit button where we can use post or
hidden.
  Hyperlink meant words or sentences that have underline underneath it,
when
  clicked will go to a different webpage.
 
  Thanks,
   Scott
 
  Erik Price [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  
   On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:
  
I tried that and it worked.  I have
one question, what about the hyperlink?  People will see the option
in
the
hyperlink.  You know.  Is there a way around it to hid that in the
hyperlink?
  
   If by hyperlink you mean the URL in the URL bar of their browser,
   correct -- people will see it.  That GET data is part of the URL, sort
   of.
  
   Most browsers will not display POST data to their users (easily) but
   it's never truly hidden from view.  Any data that your users are
   sending to you, whether it's GET, POST, or COOKIE, is data that they
can
   see.
  
  
   Erik
  
  
  
   
  
   Erik Price
   Web Developer Temp
   Media Lab, H.H. Brown
   [EMAIL PROTECTED]
  
 
 





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




Re: [PHP] Re: PHP does not work??

2002-06-28 Thread Scott Fletcher

Not a problem!  I can make some adjustment to the $user_detail['']
(session_id()) to make it work as $_SESSION[''].

Scott
Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, June 26, 2002, at 02:37  PM, Scott Fletcher wrote:

  I didn't know that.  Thanks for the info.  I think it would be best
  that I
  not use php.ini.

 On the contrary, I think it would be best if you read through it and
 read about it at http://www.php.net/manual/en/configuration.php .
 Putting it off will only cause you trouble in the long run.

  I can write the script to register the variable.  What would be a demo
  script that would work?  I'm having a little trouble understanding that
  on
  the php.net website.  Most of the script that use global variables came
  from
  hyperlinks.  I have no form method like post or get.

 If it doesn't have post or get, then your data is probably in the
 $_GET array.  But you should always use the method attribute of the
 form tag.

  I have one website that use session.  Like session_start(),
  session_register(), etc.  How would this be affected and what is the
  work
  around to this one.

 You now refer to a session variable as $_SESSION['variablename'].


 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




Re: [PHP] Re: PHP does not work??

2002-06-27 Thread Kondwani Spike Mkandawire

I forgot to point out another disadvantage of turning on register_globals
apart from that of security is that when you are sending a page with a
form to the same page, e.g:

form name=whatever action=$PHP_SELF method=post

there is a tendency to lose info..  E.g.
If you are sending text separated by spaces you only manage to
send the first word this can be overcome by using the
htmlspecialchars('value') method to evaluate value...

turning on globals is to make the coding easier but has a
good deal of disadvantages...

Spike...
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Um, alright, I'll just leave the code in the hyperlink the way it is.  It
is
 not possible to use the form or post of some sort for the hyperlink.
 form will work with the submit button where we can use post or hidden.
 Hyperlink meant words or sentences that have underline underneath it, when
 clicked will go to a different webpage.

 Thanks,
  Scott

 Erik Price [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:
 
   I tried that and it worked.  I have
   one question, what about the hyperlink?  People will see the option in
   the
   hyperlink.  You know.  Is there a way around it to hid that in the
   hyperlink?
 
  If by hyperlink you mean the URL in the URL bar of their browser,
  correct -- people will see it.  That GET data is part of the URL, sort
  of.
 
  Most browsers will not display POST data to their users (easily) but
  it's never truly hidden from view.  Any data that your users are
  sending to you, whether it's GET, POST, or COOKIE, is data that they can
  see.
 
 
  Erik
 
 
 
  
 
  Erik Price
  Web Developer Temp
  Media Lab, H.H. Brown
  [EMAIL PROTECTED]
 





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




[PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

I'm using UNIX, not windows, so there is no php.ini in UNIX.

I only use the ./configure command which is 

-- snip --
./configure
--with-apache=../apache_1.3.26
--with-ibm-db2=/usr/lpp/db2_06_01
--with-openssl=../openssl-0.9.6d
--with-mcrypt=../../lib
--without-mysql
--with-config-file-path=/etc
--enable-track-vars
--with-curl=../../lib
--with-xml
--snip--

Then I went on to compile the PHP, then Apache, etc.

Since from recent post, there was some talk about register_globals.  I'm not
familiar with that so I will find out what that is, and what that is use
for.  If anyone know, can anyone tell me what it does?  Thanks.  Scott
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!  I downloaded the newer version of PHP and compiled it.  The php is
 working great!  But there is one problem.

 When I use the hyperlink, test.php?data=yes and I go to this page,
 test.php but there is no data in this variable, $data.  So, the web page I
 have, most of them are all thrown off becuase of this.  I use PHP version
 4.2.1.  Is there a bug in this PHP version???  Or some changes in PHP that
 I'm not aware of?  Let me know!

 Thanks,
  Scott





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




RE: [PHP] Re: PHP does not work??

2002-06-26 Thread Jay Blanchard

[snip]
I'm using UNIX, not windows, so there is no php.ini in UNIX.
[/snip]

Look here /etc/apache/php.ini-dist or /etc/apache/php.ini. There is an ini
file for PHP, and you may have to rename php.ini-dist to php.ini. Once done,
look for

; You should do your best to write your scripts so that they do not require
; register_globals to be on;  Using form variables as globals can easily
lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off

Setting Off to On will let your scripts continue to work, once you have
restarted your server of course. You really should, due to security
considerations leave this set of Off and reconfigure your variables as
stated in other e-mails. Since this will probably take some time you can
leave register_globals on until you're finished with that project.

HTH!

Jay



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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 02:13  PM, Scott Fletcher wrote:

 I'm using UNIX, not windows, so there is no php.ini in UNIX.

Sorry, don't take offense if I ask if you've been living under a rock -- 
I only use Linux, and there is definitely a php.ini file that you use.  
I put mine in /usr/local/lib/ .  If you follow the source install 
instructions, you will see that the last step is:

$ cp php.ini-dist /usr/local/lib/php.ini

Yep, that means you're supposed to copy php.ini-dist to a dir on your 
server.  This is your configuration file, where register_globals and a 
million other configuration directives are decided...


?



Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

I didn't know that.  Thanks for the info.  I think it would be best that I
not use php.ini.

I can write the script to register the variable.  What would be a demo
script that would work?  I'm having a little trouble understanding that on
the php.net website.  Most of the script that use global variables came from
hyperlinks.  I have no form method like post or get.

I have one website that use session.  Like session_start(),
session_register(), etc.  How would this be affected and what is the work
around to this one.

Thanks,
 Scott

Jay Blanchard [EMAIL PROTECTED] wrote in message
002901c21d3e$0bba45d0$8102a8c0@niigziuo4ohhdt">news:002901c21d3e$0bba45d0$8102a8c0@niigziuo4ohhdt...
 [snip]
 I'm using UNIX, not windows, so there is no php.ini in UNIX.
 [/snip]

 Look here /etc/apache/php.ini-dist or /etc/apache/php.ini. There is an ini
 file for PHP, and you may have to rename php.ini-dist to php.ini. Once
done,
 look for

 ; You should do your best to write your scripts so that they do not
require
 ; register_globals to be on;  Using form variables as globals can easily
 lead
 ; to possible security problems, if the code is not very well thought of.
 register_globals = Off

 Setting Off to On will let your scripts continue to work, once you have
 restarted your server of course. You really should, due to security
 considerations leave this set of Off and reconfigure your variables as
 stated in other e-mails. Since this will probably take some time you can
 leave register_globals on until you're finished with that project.

 HTH!

 Jay





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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

Hi Erik!

This is my 2nd posting, not sure what happened to my first one.  Sorry about
not seeing your previous posting before.  Windows crashed on me.  My fault.
I didn't know we can use php.ini in UNIX or Linux.  Cool!  Haven't been
using it on UNIX for a long time.  I think I can leave it out for now and
make some changes to the scripts instead.  When I saw the php.ini on
Windows, I couldn't believe of so many configuration.  So, I think it will
be helpful to make some changes to teh website and keep it simple for
someone who will take my place as webmaster.

Saw your comments about _GET['data'].  I tried that and it worked.  I have
one question, what about the hyperlink?  People will see the option in the
hyperlink.  You know.  Is there a way around it to hid that in the
hyperlink?  Just curious.

Thanks,
 Scott

Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, June 26, 2002, at 02:13  PM, Scott Fletcher wrote:

  I'm using UNIX, not windows, so there is no php.ini in UNIX.

 Sorry, don't take offense if I ask if you've been living under a rock --
 I only use Linux, and there is definitely a php.ini file that you use.
 I put mine in /usr/local/lib/ .  If you follow the source install
 instructions, you will see that the last step is:

 $ cp php.ini-dist /usr/local/lib/php.ini

 Yep, that means you're supposed to copy php.ini-dist to a dir on your
 server.  This is your configuration file, where register_globals and a
 million other configuration directives are decided...


 ?



 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Hurring

There is no feasable way to hide data being submitted to your
website.  Anything that a user's browser can send, the user can
telnet to port 80 of your server and spoof.

You can try POSTing data, which will not appear in the URL,
but dont even waste time trying to hide submitted data,
rather, build a stronger backend.

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Erik!

 This is my 2nd posting, not sure what happened to my first one.  Sorry about
 not seeing your previous posting before.  Windows crashed on me.  My fault.
 I didn't know we can use php.ini in UNIX or Linux.  Cool!  Haven't been
 using it on UNIX for a long time.  I think I can leave it out for now and
 make some changes to the scripts instead.  When I saw the php.ini on
 Windows, I couldn't believe of so many configuration.  So, I think it will
 be helpful to make some changes to teh website and keep it simple for
 someone who will take my place as webmaster.

 Saw your comments about _GET['data'].  I tried that and it worked.  I have
 one question, what about the hyperlink?  People will see the option in the
 hyperlink.  You know.  Is there a way around it to hid that in the
 hyperlink?  Just curious.

 Thanks,
  Scott

 Erik Price [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  On Wednesday, June 26, 2002, at 02:13  PM, Scott Fletcher wrote:
 
   I'm using UNIX, not windows, so there is no php.ini in UNIX.
 
  Sorry, don't take offense if I ask if you've been living under a rock --
  I only use Linux, and there is definitely a php.ini file that you use.
  I put mine in /usr/local/lib/ .  If you follow the source install
  instructions, you will see that the last step is:
 
  $ cp php.ini-dist /usr/local/lib/php.ini
 
  Yep, that means you're supposed to copy php.ini-dist to a dir on your
  server.  This is your configuration file, where register_globals and a
  million other configuration directives are decided...
 
 
  ?
 
 
 
  Erik
 
 
 
 
  
 
  Erik Price
  Web Developer Temp
  Media Lab, H.H. Brown
  [EMAIL PROTECTED]
 





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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:

 I tried that and it worked.  I have
 one question, what about the hyperlink?  People will see the option in 
 the
 hyperlink.  You know.  Is there a way around it to hid that in the
 hyperlink?

If by hyperlink you mean the URL in the URL bar of their browser, 
correct -- people will see it.  That GET data is part of the URL, sort 
of.

Most browsers will not display POST data to their users (easily) but 
it's never truly hidden from view.  Any data that your users are 
sending to you, whether it's GET, POST, or COOKIE, is data that they can 
see.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 02:37  PM, Scott Fletcher wrote:

 I didn't know that.  Thanks for the info.  I think it would be best 
 that I
 not use php.ini.

On the contrary, I think it would be best if you read through it and 
read about it at http://www.php.net/manual/en/configuration.php .  
Putting it off will only cause you trouble in the long run.

 I can write the script to register the variable.  What would be a demo
 script that would work?  I'm having a little trouble understanding that 
 on
 the php.net website.  Most of the script that use global variables came 
 from
 hyperlinks.  I have no form method like post or get.

If it doesn't have post or get, then your data is probably in the 
$_GET array.  But you should always use the method attribute of the 
form tag.

 I have one website that use session.  Like session_start(),
 session_register(), etc.  How would this be affected and what is the 
 work
 around to this one.

You now refer to a session variable as $_SESSION['variablename'].


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

Um, alright, I'll just leave the code in the hyperlink the way it is.  It is
not possible to use the form or post of some sort for the hyperlink.
form will work with the submit button where we can use post or hidden.
Hyperlink meant words or sentences that have underline underneath it, when
clicked will go to a different webpage.

Thanks,
 Scott

Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:

  I tried that and it worked.  I have
  one question, what about the hyperlink?  People will see the option in
  the
  hyperlink.  You know.  Is there a way around it to hid that in the
  hyperlink?

 If by hyperlink you mean the URL in the URL bar of their browser,
 correct -- people will see it.  That GET data is part of the URL, sort
 of.

 Most browsers will not display POST data to their users (easily) but
 it's never truly hidden from view.  Any data that your users are
 sending to you, whether it's GET, POST, or COOKIE, is data that they can
 see.


 Erik



 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




Re: [PHP] Does $_SESSION work in any release?

2002-04-13 Thread Patrick Aland

I am doing a session_start and am definately not using session_register
(minus ? and ?, the exact code is in my original email).
phpinfo reports register_globals is off. Is there something else in the
php.ini file I need to turn on to 'enable' $_SESSION?

I tried using the php.ini-recommended and it didn't work either.

Any other ideas?



On Sat, Apr 13, 2002 at 11:42:49AM -0600, Jason Sheets wrote:
 $_SESSION has worked for me on Unix since it was introduced.  Make sure your
 PHP is properly configured.  session_start() must be called before you can
 use $_SESSION.  I've heard that if you use $_SESSION you may not use
 session_register.
 
 The reports I've seen are reporting it is broken on Windows, however it
 appears to be fixed on Windows in 4.2 RC2.
 
 Jason
 - Original Message -
 From: Patrick Aland [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, April 13, 2002 11:22 AM
 Subject: [PHP] Does $_SESSION work in any release?
 
 
  Running Apache,linux,php4.1.2 and I can't get $_SESSION to work, creates
  the temp file but doesn't actually put anything in it. There appears to
  be a bug report saying it is broke but does anyone know what version (if
  any) $_SESSION actually works in? I'm trying 4.1.1 also and its doing the
  same thing.
 
  I am running the the code from the manual's session page:
  session_start();
  if (!isset($_SESSION['count'])) {
  $_SESSION['count'] = 0;
  } else {
  $_SESSION['count']++;
  }
  print(SESSION : .$_SESSION['count']);
 
  and only get 0.
 
 
  Thanks.
  patrick
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] does this work?

2002-01-10 Thread Kevin Stone

Hmm I believe that the mysql_query() function requires quotes around the
query statement even it it is being passed as a variable..

mysql_query($tempsql, $db);

-Kevin

 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


 --
 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] does this work?

2002-01-10 Thread R'twick Niceorgaw

what eact parse error you are getting ? and what is that line ?

Is it giving an error like undefined variable  $temprow[count];
 or some thing like that ?

You may try to change the mysql_fetch_row line to the following

$temprow = mysql_fetch_array($tempresult, MYSQL_ASSOC);

- Original Message - 
From: Erik Price [EMAIL PROTECTED]
To: PHP (E-mail) [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 4:28 PM
Subject: [PHP] does this work?


 It seems that I have a parse error somewhere in the following code 
 (since that's the only code in my script, it's a test script):
 
 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);
 
 echo $temprow[count];
 
 
 Yet, it works fine in the mysql client.  Thus, I am led to believe that 
 PHP is not capable of constructing the same kinds of SQL statements that 
 can be constructed in the mysql client.  Is this the case?
 
 
 Erik
 
 
 PS: what I am -really- trying to do is dynamically fill in a select 
 listbox with options that correspond to all of the records in a given 
 table.  Like so:
 
 form
   select
?php
foreach 
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option 
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form
 
 but I am unsure of how to grab multiple values from the mysql_query() 
 and load them into an array.  Has anyone done this before?
 
 
 -- 
 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] does this work?

2002-01-10 Thread Erik Price

I tried that... I get the same error (same line and everything).
As a side note, I haven't ever had to quote the first argument in 
mysql_query() before...
This is quite a conundrum, eh?


Erik


On Friday, January 11, 2002, at 04:25  AM, Kevin Stone wrote:

 Hmm I believe that the mysql_query() function requires quotes around the
 query statement even it it is being passed as a variable..

 mysql_query($tempsql, $db);

 -Kevin

 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements 
 that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


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




RE: [PHP] does this work?

2002-01-10 Thread Rick Emery

Show all your code.  Did you open a connection to the MYSQL server?  If so,
show the code.

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:29 PM
To: PHP
Subject: [PHP] does this work?


It seems that I have a parse error somewhere in the following code 
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that 
PHP is not capable of constructing the same kinds of SQL statements that 
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select 
listbox with options that correspond to all of the records in a given 
table.  Like so:

form
  select
   ?php
   foreach 
($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option 
value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the mysql_query() 
and load them into an array.  Has anyone done this before?


-- 
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] does this work?

2002-01-10 Thread Rick Emery

Show all your code.  Did you open a connection to the MYSQL server?  If so,
show the code.

What is the exact error that you get?

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:29 PM
To: PHP
Subject: [PHP] does this work?


It seems that I have a parse error somewhere in the following code 
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that 
PHP is not capable of constructing the same kinds of SQL statements that 
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select 
listbox with options that correspond to all of the records in a given 
table.  Like so:

form
  select
   ?php
   foreach 
($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option 
value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the mysql_query() 
and load them into an array.  Has anyone done this before?


-- 
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] does this work?

2002-01-10 Thread Rick Emery


quotes are not needed

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 3:26 AM
To: Erik Price; PHP (E-mail)
Subject: Re: [PHP] does this work?


Hmm I believe that the mysql_query() function requires quotes around the
query statement even it it is being passed as a variable..

mysql_query($tempsql, $db);

-Kevin

 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


 --
 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 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] does this work?

2002-01-10 Thread Erik Price


On Thursday, January 10, 2002, at 04:39  PM, Rick Emery wrote:

 Show all your code.  Did you open a connection to the MYSQL server?  If 
 so,
 show the code.


Okay, but I changed some personal info (that I know is definitely 
correct):

?php
// arraytest.php
$db = mysql_connect(hostname, username, password);
mysql_select_db(database_name, $db);
?

html
head
titleArray Test/title
/head
body


$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];

mysql_close($db);
?
/body
/html


-- 
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] does this work?

2002-01-10 Thread Erik Price

Wait, my bad.  Typo... all my fault.
I feel like an ass.


Erik


-- 
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] does this work?

2002-01-10 Thread LaserJetter

you have a ?PHP tag missing between body and $tempsql.  did you remove
this for the purose of this posting or is this what's causing the problem??



Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Show all your code.  Did you open a connection to the MYSQL server?  If
so,
 show the code.

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 10, 2002 3:29 PM
 To: PHP
 Subject: [PHP] does this work?


 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


 --
 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] does this work?

2002-01-10 Thread Martin Towell

is this valid in PHP?? (haven't tried it myself yet...)

$tempsql = SELECT COUNT(*) AS count
FROM divisions;

maybe it needs to be on one line???


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 8:39 AM
To: 'Erik Price'; PHP
Subject: RE: [PHP] does this work?


Show all your code.  Did you open a connection to the MYSQL server?  If so,
show the code.

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:29 PM
To: PHP
Subject: [PHP] does this work?


It seems that I have a parse error somewhere in the following code 
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that 
PHP is not capable of constructing the same kinds of SQL statements that 
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select 
listbox with options that correspond to all of the records in a given 
table.  Like so:

form
  select
   ?php
   foreach 
($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option 
value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the mysql_query() 
and load them into an array.  Has anyone done this before?


-- 
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] does this work?

2002-01-10 Thread Erik Price

But as I was writing before, what I'm really trying to do with this 
isn't just echo the COUNT of records in a table.

What do I need to separate the array $temprow into pieces so that I 
can get at the data:

$tempsql = SELECT divisions.div_name, divisions.div_id
 FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

I wonder if I'm being too ambiguous in describing this.

$temprow now contains the information extracted from $tempresult by 
mysql_fetch_array(), right?
And $tempresult was the result of the SELECT query I posted above.

So, how can I separate the information in $temprow into useable chunks 
or variables.  I'm reading about explode(), but it isn't clear to me how 
I can use this in this instance.
I would like to loop through the array $temprow and echo each record's 
contents (divisions.div_name and divisions.div_id) on each step.  This 
is to populate a select box (listbox).

Any advice, anybody?

Thank you,
Erik


On Thursday, January 10, 2002, at 05:00  PM, Erik Price wrote:

 Wait, my bad.  Typo... all my fault.
 I feel like an ass.


 Erik



-- 
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] does this work?

2002-01-10 Thread Sam Masiello


I think it will really help if you post more of your code.  It is obvious
that the parse error is not contained within the lines of code that you
pasted :)  I think more of your code will reveal the answer rather quickly
:)

HTH

Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 X289
[EMAIL PROTECTED]


- Original Message -
From: Erik Price [EMAIL PROTECTED]
To: Kevin Stone [EMAIL PROTECTED]
Cc: PHP (E-mail) [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 4:43 PM
Subject: Re: [PHP] does this work?


 I tried that... I get the same error (same line and everything).
 As a side note, I haven't ever had to quote the first argument in
 mysql_query() before...
 This is quite a conundrum, eh?


 Erik


 On Friday, January 11, 2002, at 04:25  AM, Kevin Stone wrote:

  Hmm I believe that the mysql_query() function requires quotes around the
  query statement even it it is being passed as a variable..
 
  mysql_query($tempsql, $db);
 
  -Kevin
 
  It seems that I have a parse error somewhere in the following code
  (since that's the only code in my script, it's a test script):
 
  // arraytest.php
  $tempsql = SELECT COUNT(*) AS count
  FROM divisions;
  $tempresult = mysql_query($tempsql, $db);
  $temprow = mysql_fetch_array($tempresult);
 
  echo $temprow[count];
 
 
  Yet, it works fine in the mysql client.  Thus, I am led to believe that
  PHP is not capable of constructing the same kinds of SQL statements
  that
  can be constructed in the mysql client.  Is this the case?
 
 
  Erik
 
 
  PS: what I am -really- trying to do is dynamically fill in a select
  listbox with options that correspond to all of the records in a given
  table.  Like so:
 
  form
select
 ?php
 foreach
  ($record_id_and_record_name_pair_pulled_from_mysql_query) {
 print(option
  value=\${record_id}\${record_name}/option);
 }
 ?
 /select
  /form
 
  but I am unsure of how to grab multiple values from the mysql_query()
  and load them into an array.  Has anyone done this before?
 
 
  --
  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 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] does this work?

2002-01-10 Thread Erik Price


On Thursday, January 10, 2002, at 05:16  PM, Martin Towell wrote:

 is this valid in PHP?? (haven't tried it myself yet...)

 $tempsql = SELECT COUNT(*) AS count
   FROM divisions;

 maybe it needs to be on one line???

It turns out that my problem was a typo.  I apologize for wasting 
everyone's time with that, I thought that I had checked thoroughly.

To answer your question, the extra whitespace (the newline between 
count and FROM) doesn't matter here because structured query 
language doesn't recognize whitespace.  Technically, that newline is in 
the SQL, not the PHP code itself.


-- Erik


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




Fwd: RE: [PHP] does this work?

2002-01-10 Thread [EMAIL PROTECTED]




and it would be like using the statement $a = $a;

very very useless!

bvr.


On Thu, 10 Jan 2002 15:39:27 -0600, Rick Emery wrote:


quotes are not needed



mysql_query($tempsql, $db);





-- 
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] does this work?

2002-01-10 Thread Alnisa Allgood

At 4:28 PM -0500 1/10/02, Erik Price wrote:

PS: what I am -really- trying to do is dynamically fill in a 
select listbox with options that correspond to all of the 
records in a given table.  Like so:

form
  select
   ?php
   foreach ($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the 
mysql_query() and load them into an array.  Has anyone done this 
before?


I've just recently done something very similar. The code is below. It 
looks a bit different  because I like to include very little HTML in 
my PHP. But otherwise the concept should be the same.

I should mention, that my code actually produces two pull down menu. 
My ultimate goal was to add a javascript to the sequence, so that 
when a user selects the item in the first pull down, it resubmits the 
query for the second pull down, and allows for pull down two to be 
dependent on pull down one. I haven't worked on the javascript as of 
yet.

..
$staffID=$id;
$results=mysql_query (

SELECT  staff.staffID, teamMembers.accountID, 
accounts.clientID, clients.orgID,
orgs.name AS client, accounts.description AS account

FROMstaff, clients, orgs, accounts LEFT JOIN teamMembers ON
teamMembers.accountID=accounts.accountID

WHERE   teamMembers.staffID=\$staffID\ AND
teamMembers.accountID=accounts.accountID

GROUP BYaccounts.description

ORDER BYorgs.name) or die(I've failed! Woe is ME!);

while ($row=mysql_fetch_array($results)){
$staffID= $row[staffID];
$accountID  = $row[accountID];
$clientID   = $row[clientID];
$orgID  = $row[orgID];
$client = $row[client];
$account= $row[account];

//  After the array is created, a small if elseif script is used 
to create the select menu.
//  Ideally the to menus will be separate scripts, I just want to 
test the theory first

if($clientID != ){

$selectClient .=
option value=\$clientID\ selected=\$client\$client/option\n;
} else {

$selectClient .=
select id=\clientID\ name=\client\
option value=\\ selected=\ \nbsp;/option\n;
}

//  Pull down list2, this displays the accounts pull down.

if($accountID != ){

$selectAccount .=
option value=\$accountID\ 
selected=\$account\$account/option\n;

} else {
$selectClient .=
select id=\accountID\ name=\account\
option value=\\ selected=\ \nbsp;/option\n;
}
}

?

!-- This Script is a Modification of Code Created By Joe Chellman to 
auto create pull down menus from enum (value lists). I've adjusted it 
to just pull field data --

pselect id=clientID name=client
option value=  selected= nbsp;/option
?  echo$selectClient\n; ?
   /select/p

p/p

pselect id=accountID name=account
option value=  selected= nbsp;/option
?  echo$selectAccount\n; ?
   /select/p
...

-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
transforming nonprofits through technology
   .

-- 
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] does this work?

2002-01-10 Thread DL Neil

Erik,

Two suggestions:
1 check out mysql_fetch_assoc(), and
2 make use of AS to 'set' the variable names (carried through from MySQL to PHP).

Regards,
=dn

- Original Message - 
From: Erik Price [EMAIL PROTECTED]
To: Rick Emery [EMAIL PROTECTED]; PHP [EMAIL PROTECTED]
Sent: 10 January 2002 22:15
Subject: Re: [PHP] does this work?


 But as I was writing before, what I'm really trying to do with this 
 isn't just echo the COUNT of records in a table.
 
 What do I need to separate the array $temprow into pieces so that I 
 can get at the data:
 
 $tempsql = SELECT divisions.div_name, divisions.div_id
  FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);
 
 I wonder if I'm being too ambiguous in describing this.
 
 $temprow now contains the information extracted from $tempresult by 
 mysql_fetch_array(), right?
 And $tempresult was the result of the SELECT query I posted above.
 
 So, how can I separate the information in $temprow into useable chunks 
 or variables.  I'm reading about explode(), but it isn't clear to me how 
 I can use this in this instance.
 I would like to loop through the array $temprow and echo each record's 
 contents (divisions.div_name and divisions.div_id) on each step.  This 
 is to populate a select box (listbox).
 
 Any advice, anybody?
 
 Thank you,
 Erik
 
 
 On Thursday, January 10, 2002, at 05:00  PM, Erik Price wrote:
 
  Wait, my bad.  Typo... all my fault.
  I feel like an ass.
 
 
  Erik
 
 
 
 -- 
 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] does this work?

2002-01-10 Thread Miles Thompson

Yes, the semi-colon is the command separator. Try it and echo $tempsql.

Miles Thompson

At 09:16 AM 1/11/2002 +1100, Martin Towell wrote:
is this valid in PHP?? (haven't tried it myself yet...)

$tempsql = SELECT COUNT(*) AS count
 FROM divisions;

maybe it needs to be on one line???


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 8:39 AM
To: 'Erik Price'; PHP
Subject: RE: [PHP] does this work?


Show all your code.  Did you open a connection to the MYSQL server?  If so,
show the code.

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:29 PM
To: PHP
Subject: [PHP] does this work?


It seems that I have a parse error somewhere in the following code
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
 FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that
PHP is not capable of constructing the same kinds of SQL statements that
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select
listbox with options that correspond to all of the records in a given
table.  Like so:

form
   select
?php
foreach
($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
value=\${record_id}\${record_name}/option);
}
?
/select
/form

but I am unsure of how to grab multiple values from the mysql_query()
and load them into an array.  Has anyone done this before?


--
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 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] Does PHP work with Sybase ASA?

2001-09-07 Thread Rasmus Lerdorf

Perhaps people expected you to check the docs or the code yourself.  If
you go to php.net/sybase you will find the functions you need.  If you
read the user comments on that page you will even find urls to
tutorials/faqs on how to install and configure things for PHP to talk to
Sybase ASA.

eg. http://www.finebyte.com/docs/sybase/ASA-PHP-Linux.html
http://help.webmedia.com.au/Linux-Apache-PHP-Sybase-HOWTO.txt

-Rasmus

On Fri, 7 Sep 2001, Davor Pleskina wrote:

 2nd time, seem that last time nobody saw my question...

 I mean, is there in PHP support for Sybase Adaptive Server Anywhere, any
 version, like for MySQL and some other databases?

 Thanks.






-- 
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] Does PHP work with Sybase ASA?

2001-09-07 Thread Krzysztof Kocjan

I suppose You have ASA 6.0 or later version installed on Your machine with
Linux. If it is true, then You can install Open Client for ASE 11.0.3 (it is
free) and You can communicate via Open Client to ASA. It works only with ASA
6.0 and higher. Then You need to compile PHP with Sybase Open Client. You
have to look into guides how to do it on PHP side and Sybase side. I'm not
expert about compiling PHP but it only one config file to bulid PHP, there
should be section about Sybase Open Client interface, default this is
commented. It is not very dificult. If You will have problem You can ask me
I will try to help You. We (not only me) had recompiled PHP 3.0/4.0 with
Open Client for ASA 11.0.3/11.9.2 (all the combinations).

Krzysztof Kocjan


Davor Pleskina wrote:

 I mean, is there in PHP support for Sybase Adaptive Server Anywhere, any
 version, like for MySQL and some other databases?

 Thanks.

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


---
KONKURS: Niedobre miejsca - 50 ksiazek W. Whartona do wygrania!
http://szkola.interia.pl/wharton/strona.html?co=13


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