Re: [PHP] Problem with postfield elements

2002-06-13 Thread Jason Wong

On Thursday 13 June 2002 14:18, Balaji Ankem wrote:
 Hi friend,
  Just now I have installed php 4.2.1 on my windows NT machine.

Did you read the release notes or the documentation which comes with it, or 
the manual even?

  Here I found I am not able to get the postfield values.
  What would be the reason?

register_globals is disabled. Read the manual or search the archives for more 
info.

   echo emp_id: .$emp_id;
   echo emp_pass:.$emp_pass;

Use :

  echo emp_id: .$_POST['emp_id'];

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The strong give up and move away, while the weak give up and stay.
*/


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




RE: [PHP] Problem with postfield elements

2002-06-13 Thread Balaji Ankem

Hi Jason,
 Thanks for the reply.

 Just I posted to input fields from a html form and I tried to print.

 Here I am not registering any global variables.

 I have tried echo emp_id: .$_POST['emp_id']; and able to print
succesfully.

 Every time I have to refer like this $_POST['emp_id']. Can't I refer as
$emp_id ?

Thanks and Regards
Balaji


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 13, 2002 12:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with postfield elements


On Thursday 13 June 2002 14:18, Balaji Ankem wrote:
 Hi friend,
  Just now I have installed php 4.2.1 on my windows NT machine.

Did you read the release notes or the documentation which comes with it,
or 
the manual even?

  Here I found I am not able to get the postfield values.
  What would be the reason?

register_globals is disabled. Read the manual or search the archives for
more 
info.

   echo emp_id: .$emp_id;
   echo emp_pass:.$emp_pass;

Use :

  echo emp_id: .$_POST['emp_id'];

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The strong give up and move away, while the weak give up and stay. */


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



**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


[PHP] embedded media from DB

2002-06-13 Thread Brad Wright

Hi all.. 

well i got the wav files from the mysql database and can get them to play in
a web page using the following code:



IF ($row = mysql_fetch_array($result))  {


$data = $row[wavFile];
  $name = $row[wav FileName];
  $size = $row[wav FileSize];
  $type = $row[wav FileType];
 header(Content-type: $type);
  header(Content-length: $size);
  /header(Content-Disposition: attachment; filename=$name);
  header(Content-Description: PHP Generated Data);
echo  $data;

*


BUt the problem I am having is that this code gives me a blank age with a
Quicktime control bar in the middle of it. The wav file plays fine. Any
other htm underneath this php script is ignored.

How can i get the (html) code following this to be output to the webpage
All my tags seem correct (ie the ?PHP and ? tags etc are done correctly).


Any help is greatly appreciated







Cheers,

Brad 


Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strenght, in water there are
bacteria



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




[PHP] php install error --enable-sockets

2002-06-13 Thread Rahul Bhide

Hi ,
I am trying to install php with the --enable-sockets on
a solaris2.8 machine .

and getting the following error .
Any help is appreciated .

thanks
~Rahul

sockets.c: In function `php_if_recvmsg':
sockets.c:1728: structure has no member named `msg_control'
sockets.c:1729: structure has no member named
`msg_controllen'
sockets.c:1731: structure has no member named `msg_control'
sockets.c:1732: structure has no member named
`msg_controllen'
sockets.c:1735: structure has no member named `msg_flags'
sockets.c:1741: structure has no member named `msg_control'
sockets.c:1750: warning: passing arg 3 of `add_assoc_string'
makes pointer from integer without a cast
sockets.c:1754: structure has no member named
`msg_controllen'
sockets.c:1755: structure has no member named `msg_flags'
sockets.c:1787: structure has no member named `msg_control'
sockets.c:1788: structure has no member named
`msg_controllen'
sockets.c:1790: structure has no member named `msg_control'
sockets.c:1791: structure has no member named
`msg_controllen'
sockets.c:1794: structure has no member named `msg_flags'
sockets.c:1800: structure has no member named `msg_control'
sockets.c:1810: warning: passing arg 3 of `add_assoc_string'
makes pointer from integer without a cast
sockets.c:1812: structure has no member named
`msg_controllen'
sockets.c:1814: structure has no member named `msg_flags'
*** Error code 1
make: Fatal error: Command failed for target `sockets.lo'




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




Re: [PHP] embedded media from DB

2002-06-13 Thread Miguel Cruz

On Thu, 13 Jun 2002, Brad Wright wrote:
 well i got the wav files from the mysql database and can get them to play in
 a web page using the following code:
 
 
 
 IF ($row = mysql_fetch_array($result))  {
 
 
 $data = $row[wavFile];
   $name = $row[wav FileName];
   $size = $row[wav FileSize];
   $type = $row[wav FileType];
  header(Content-type: $type);
   header(Content-length: $size);
   /header(Content-Disposition: attachment; filename=$name);
   header(Content-Description: PHP Generated Data);
 echo  $data;
 
 *
 
 
 BUt the problem I am having is that this code gives me a blank age with a
 Quicktime control bar in the middle of it. The wav file plays fine. Any
 other htm underneath this php script is ignored.
 
 How can i get the (html) code following this to be output to the webpage
 All my tags seem correct (ie the ?PHP and ? tags etc are done correctly).

Think of what a regular HTML page containing an embedded media item looks 
like. 

The embedded media and the HTML were not sent to your browser at the same 
time.

The HTML contains a REFERENCE to the media item.

When you generate content with PHP, you have to follow the same rules - 
the browser doesn't know anything about PHP, it just sees what you send 
and expects it to look like HTML or whatever.

So you need to do two things:

1) Generate the HTML page and send it to the browser. That HTML page can 
contain a reference to the embedded media item (how you do that depends on 
the type of media and it's beyond the scope of this list; I'll just use a 
JPEG image as an example).

2) Generate the media item and send it to the browser, which will request 
it when it has finished parsing the HTML from 1) above.

So, you'd have some PHP like:

? echo img src='anotherPHPfile.php/12/whatever.jpg' ?

And then in anotherPHPfile.php you'd examine PATH_INFO to get that number 
12, look up 12 in your database and retrieve the appropriate content, send 
the headers, then send the data.

Just like a JPEG file can't contain HTML, neither can the WAV file that
you send to the browser. Have you ever seen a WAV file with HTML inside
it?

miguel


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




Re: [PHP] Re: Email not getting

2002-06-13 Thread Miguel Cruz

It's trying to send a message to (somewhere)@aurica.com. But in any case, 
the output from the nslookup command suggests that your machine's DNS 
resolver is misconfigured. You'll have to get that sorted out before you 
can get much mail off the machine (not a PHP issue).

miguel

On Thu, 13 Jun 2002, Manisha wrote:
 If it is aurica.com then it is wrong as this is the name of Live server. 
 But currently I am working on local linux server. (To access the server I 
 use http://Linux-Server/index.php)
 
 Any way, following is the out put of the command
 
 
 ***Can't find server address for 'aurica.com': Host name lookup failure.
 
 Server: Linux-Server
 Address: 0.0.0.0
 
 ***Linux-Server Can't give TYPE=MX : No response from server
 
 ---
 
 Manisha
 
 At 02:06 AM 6/13/02 -0300, Manuel Lemos wrote:
 Hello,
 
 On 06/13/2002 01:59 AM, Manisha wrote:
 I gave the command at root, I got some details
 
--
 
 
 
 Q-ID Size - Q-Time- Sender/Recipient
 file name67Thu Jun 13 11.22 nobody
  (host map: look up (aurica.com): deferred)
  [EMAIL PROTECTED]
 
 
-
 
 
 What's the problem exactly? As I do not know much about Linux (Totally on 
 windows), I am unable to figure out too.
 
 It looks like the your machine DNS does not seem to be properly configured.
 
 Type in the shell this command and tell me what it shows:
 
 nslookup TYPE=MX aurica.com
 
 --
 
 Regards,
 Manuel Lemos
 
 
 --
 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] netscape wont show form result

2002-06-13 Thread Steve Fitzgerald

I know what you are both saying and it was a poor explanation from me as to what
happened. let me explain it further because although the code is working now i
would like to know what happened.
We know the code should work the same regardless of browser since the server is
interpreting the code not the browser, however;
1. the tables were all properly formatted. The script called for different includes
depending on the situation - these were all complete individual tables (remember ns
would display correctly, but only if the script excecuted to the end, ie corect
input from the user)
2. the memory cache on ns was set to 5MG and the disk cache to over7MG - ample for
this situation. I currently have the memory cache set to 1MG and it still works.
3. the only change i made between the first and second messages yesterday was to
remove the 'exit' line, which i had placed in the script at a point after user
input errors had been detected and before the email was sent.
4.ns threw up blank pages whenever i deliberately made an error on the form
5.once this line was removed ns worked as expected. ie worked as expected both
before and after the amendment

Any thoughts???
Steve
Stuart Dallas wrote:

 On Wednesday, June 12, 2002 at 5:48:02 AM, you wrote:

  An 'exit' directive had secretly sneaked into the script! which caused ns to
  abort the rest of the script (as it should) while ie blissfully ignored
  it(??). Anyway it all works now. Thanks again.

 Just thought I'd point out an error in your explanation. PHP is executed by the
 server, not by the browser. Therefore, IE cannot have blissfully ignored an
 exit directive since it never saw one. I think you've solved your problem by
 coincidence rather than logic - a very bad way to write code.

 --
 Stuart


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




[PHP] Re: how can i insert date

2002-06-13 Thread Cirstoiu Aurel Sorin

You make a variable $insert = $year./.$month./.$date(or whatever format
you wish) and insert it in the database.

--

Cirstoiu Aurel Sorin
InterAKT Support

http://www.interakt.ro

Suman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
hi
i have a date,month and an year what is the function in php that i can i use
to convert the 3 vars into a date and insert into a postgres db.

bye
suman



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




RE: [PHP] Problem with postfield elements

2002-06-13 Thread Balaji Ankem

Hi Justin ,
Thankyou. They made this change in php 4.2.1 only?? 
But I never faced this problem previously with php3, php 4.0.1.
Is it like that?

Thanks and Regards
Balaji


-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 13, 2002 12:44 PM
To: Balaji Ankem
Subject: Re: [PHP] Problem with postfield elements


on 13/06/02 4:50 PM, Balaji Ankem ([EMAIL PROTECTED]) wrote:

 Every time I have to refer like this $_POST['emp_id']. Can't I refer 
 as $emp_id ?

Yes, partly.

1. you can always turn register globals back ON, but there is a reason
(security) why they are now off by default.  In short, if you know WHERE
the var is coming from (eg POST), things should be more secure.  (eg, if
I can do something like foo.php?is_user=yes on your URL, it might have
bad consequences, but if you ONLY trust a $_COOKIE['is_user'], then the
script is already more secure.

2. at the top of the script, you can put in $emp_id = $_POST['emp_id'];


Regards,

Justin French



**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


[PHP] internationalization and gettext

2002-06-13 Thread a . h . s . boy

I developed a rather large and extensive PHP application for maintaining 
a news publishing site. All static text was, when I created it, written 
in English. Form field labels, long explanatory texts, navigational 
links, everything. The popularity of the application, however, has 
drifted outside the Anglo boundaries, and now I need to internationalize 
the code to support other languages for text output and date formatting. 
(Localization I'll leave up to those better qualified). I'm looking for 
feedback on various methods of allowing easy localization.

The date formatting stuff is easy enough with built-in PHP functions. 
All my dates are instantiated as objects anyway, so output format is 
nicely encapsulated in class methods, making that part easy.

The manner of supporting localization of text strings, however, allows 
for a few more options. I've taken note of how a few different PHP apps 
have broached the topic:

-- phpMyAdmin. Minimal static text. Loads a localized text file 
containing localized variable assignments, and always puts out text by 
variable reference rather than hard-coded text.

-- FUDforum2. Fairly large quantity of text. Also uses a text file of 
variables and their localized value, but seems to have a more indirect 
manner of putting out the variable-based text. (Part of the apparent 
indirection is that perusing the code reveals TONS of hard-coded 
English phrases that don't seem to be localized. But I haven't actually 
seen, as a web user, the FUDforum2 operating in a non-English language, 
so I can't really vouch for whether all the text is internationalized or 
not).

-- The PHP Manual speaks highly of gettext() calls, relying on a 
standard, mature UNIX function to automatically handle 
internationalization. It sounded good, and I liked the idea of it 
leveraging the power of something that was _designed_ for 
internationalization, and not a good hack job of variable 
substitutions attempting the same functionality.

So I've begun the process of modifying all of my text output from

echo (My English phrase dangles);
to
echo _(My English phrase dangles);

and the like. It's beautiful. 3 extra characters -- _() -- to wrap 
around strings, and poof! it's 90% of the way towards the United Nations.

I created a quick English string file of a few webpages worth of text, 
threw together a rough French translation, and tried viewing the site in 
French. Seemed to work wonderfully.

So, this far, I'm happy, and continuing to modify the code to 
internationalize the output. I'm only a bit wary, however, because it 
seems relatively easy, yet I haven't run into any PHP applications that 
have internationalized their interface in this way. (That doesn't mean 
there aren't any out there, but I haven't run into them). Are there any 
potential problems that I need to be aware of? Substantial performance 
hits? Bogeymen?

I'd love to hear success stories from anyone using gettext() with a 
substantial number of strings (like 500-1000).

Cheers,
spud.

---
a.h.s. boy
spud(at)nothingness.orgas yes is to if,love is to yes
http://www.nothingness.org/
PGP Fingerprint: 7B5B 2E7A FA96 865A D9D9  5D6D 54CD D2C1 3429 56B4
---


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




RE: [PHP] beginner in PHP

2002-06-13 Thread Tim Ward

From the symptoms it sounds like you're destroying the session okay but
leaving the variables
In the script. Are you sure you're unsetting them at the appropriate scope
level. 

Tim Ward
www.chessish.com http://www.chessish.com 

--
From:  Phillip Perry [SMTP:[EMAIL PROTECTED]]
Sent:  13 June 2002 05:18
To:  Martin Towell; Tom Rogers; Php
Subject:  RE: [PHP] beginner in PHP

Thanks Martin!! That really helped out a lot. And thanks to all who
tried to
help me. I appreciate it!

I have one other question that is really not so much important as it
is
annoying, but I can't figure it out myself.

I'm practicing with sessions. What I'm making..if you couldn't tell
by the
array output from before...is a test shopping cart. Now the
annoyance is
that when I click the checkout link it's just supposed to destroy
the
session and reset everything to 0 including the shopping cart. And
also if
an item is clicked, that item gets deleted. With both choices when I
click
once the session does get destroyed, but everything stays on the
page until
I refresh the page. I want the info to get reset when I click the
link.
Here's the delete and checkout code...remember they both do actually
work,
just not as I want. Any suggestions on how to make it refresh on a
click
only?

/ DELETE SHOPPING CART ITEMS

function chout(){
session_destroy();
$mycart = array();
$cart_items = 0;
echo pThank you for shopping!/p;
}

if ($action == delnow)
{
unset($mycart[$itemid]);
}

// END DELETE SHOPPING CART ITEMS

if ($action == checkout)
{
chout();
}

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:55 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


here's the revised loop


$cat_cnt = count($catalog);
while (list($key,$value) = each($mycart))
{
  for ($j = 0; $j  $cat_cnt; $j++)
if ($value == $catalog[$j][itemcd])
{
  echo $catalog[$j][unitprice];
  break;
}
}


-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:50 PM
To: '[EMAIL PROTECTED]'; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Ah! $catalog is a 2D array - any your if statement is expecting a 1D
array...

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 1:52 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


I meant Martin :) sorry.

-Original Message-
From: Phillip Perry [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


Array ( [0] = gerainiums [1] = roses [2] = roses [3] = roses [4]
=
roses [5] = roses )

1
1

Your output is different from the last print_r that Tom had me do. I
wonder
why that is

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:44 PM
To: [EMAIL PROTECTED]; Php
Subject: RE: [PHP] beginner in PHP


Hi
Then I guess you will have to add some debug code
try this before the while loop and make sure your if ($value ==
$catalog[itemcd]) will produce a match (and you do need the quotes
really
:)

echo pre.print_r($catalogue).br.print_r($mycart)./pre;
Tom

At 11:31 PM 12/06/2002 -0400, Phillip Perry wrote:
Thanks, but that didn't work either

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:32 PM
To: [EMAIL PROTECTED]; Php
Subject: Re: [PHP] beginner in PHP


Hi
itemcd and unitprice should be in quotes I think if they are keys
in an
array.
$catalog[itemcd]
$catalog[unitprice]

Tom

At 10:56 PM 12/06/2002 -0400, Phillip Perry wrote:
 Can someone tell me why this doesn't work?
 The $mycart array is fine and the $catalog array is also fine but
nothing
 inside the if statement prints. I've tried other echo statements
but
nothing
 prints at all.
 
 while (list($key,$value) = each($mycart))
  {
  if ($value == $catalog[itemcd])
  

Re: [PHP] Problem with postfield elements

2002-06-13 Thread Jason Wong

On Thursday 13 June 2002 16:06, Balaji Ankem wrote:
 Hi Justin ,
 Thankyou. They made this change in php 4.2.1 only??
 But I never faced this problem previously with php3, php 4.0.1.
 Is it like that?

Since 4.1.X. 

This issue comes with monotonous regularity (probably once a day). It is 
explained in the release notes, the manual, and has been covered many, many 
times on the list. Please refer to the documentation or search the list 
archives.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Carson's Consolation:
Nothing is ever a complete failure.
It can always be used as a bad example.
*/


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




Re: [PHP] netscape wont show form result

2002-06-13 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 I know what you are both saying and it was a poor explanation from me as to what
 happened. let me explain it further because although the code is working now i
 would like to know what happened.
 We know the code should work the same regardless of browser since the server is
 interpreting the code not the browser, however;
 1. the tables were all properly formatted. The script called for different includes
 depending on the situation - these were all complete individual tables (remember ns
 would display correctly, but only if the script excecuted to the end, ie corect
 input from the user)
 2. the memory cache on ns was set to 5MG and the disk cache to over7MG - ample for
 this situation. I currently have the memory cache set to 1MG and it still works.
 3. the only change i made between the first and second messages yesterday was to
 remove the 'exit' line, which i had placed in the script at a point after user
 input errors had been detected and before the email was sent.
 4.ns threw up blank pages whenever i deliberately made an error on the form
 5.once this line was removed ns worked as expected. ie worked as expected both
 before and after the amendment
 
 Any thoughts???
 Steve
 Stuart Dallas wrote:
 
  On Wednesday, June 12, 2002 at 5:48:02 AM, you wrote:
 
   An 'exit' directive had secretly sneaked into the script! which caused ns to
   abort the rest of the script (as it should) while ie blissfully ignored
   it(??). Anyway it all works now. Thanks again.
 
  Just thought I'd point out an error in your explanation. PHP is executed by the
  server, not by the browser. Therefore, IE cannot have blissfully ignored an
  exit directive since it never saw one. I think you've solved your problem by
  coincidence rather than logic - a very bad way to write code.

As I am sure has been pointed out previously on this list, Netscape 
handled poorly formatted tables differently from IE. If the exit() caused 
a malformed table to be sent to Netscape, NS would not render the table, 
whereas IE will make an attempt to render based on the information 
received.

You can demonstrate this by replacing the exit() and do a view source in 
both browsers. You will find the source is the same, but is rendered 
differently.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Email - Php !

2002-06-13 Thread Chris Hewitt

If you can send mail to/from the server as an ordinary user, the the 
sendmail configuration is OK, but if this is a new linux installation 
(e.g. RH 7.2 or 7.3) then it might need updating. The firewall may also 
prevent smtp.

HTH
Chris

Septic Flesh wrote:

I use the following php.ini config.

Do I need to configure the sendmail seperatly to successfully send an email
? with Linux ?

In my win32 os email works ok..but in the linux box nothing is sent..



~~php.ini

[mail function]
; For Win32 only.
SMTP = [EMAIL PROTECTED]

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

; For Unix only.  You may supply arguments as well (default:
sendmail -t -i).
  sendmail_path =/usr/sbin/sendmail -t
~~~




code
?php


if (@mail( '[EMAIL PROTECTED]', 'subject', 'kafrila opa ligo ' ))

{
echo  mail sent;
}

else
{
echo  shit nothing sent;
}

echo pemail test . . ./p;

?





Any idea ? Thanks in advance..


--


Sapilas@/dev/pinkeye








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




[PHP] POST/GET vars in apache

2002-06-13 Thread Webmaster do Aborla.net

Hello everybody,

I used to use IIS and now I moved to apache. I use PHP, too. But now, in
order to get a POST/GET var I need to use $HTTP_POST_VARS[var] and with IIS
I simply call $var.
Why this happens??? Do I need to modify all my scripts to $HTTP_POST_VARS???


Thanking in advance,
Nuno Lopes



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




RE: [PHP] POST/GET vars in apache

2002-06-13 Thread Brian McGarvie

it;s todo with the ini file an option register_globals

Off - you need to use the $HTTP_POST_VARS[var] method
On - you dont

Pro - more secure.
Con - more to type!

 -Original Message-
 From: Webmaster do Aborla.net [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 11:32 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] POST/GET vars in apache
 
 
 Hello everybody,
 
 I used to use IIS and now I moved to apache. I use PHP, too. 
 But now, in
 order to get a POST/GET var I need to use 
 $HTTP_POST_VARS[var] and with IIS
 I simply call $var.
 Why this happens??? Do I need to modify all my scripts to 
 $HTTP_POST_VARS???
 
 
 Thanking in advance,
 Nuno Lopes
 
 
 
 -- 
 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




[PHP] Controlling CVS with PHP...

2002-06-13 Thread d gibbs

hi, I was wondering if any one had managed to controll CVS with php.
I'm wanting to add/update/remove/checkin/checkout files not just view.

cheers
dan



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




[PHP] Re: F5 problem...

2002-06-13 Thread blue

I'm currently having the same problem, but I've found a quick fix for it.
maybe it will be appropriate for what your doing.

First, I consider it to be bad code to have more than one page process form
data, so this example will incorporate just one page called FORM.PHP.  i'll
use a small example that ask for your name.

when the page loads, you want your PHP code to check for two things: 1) is
this the first load of the page? or has it been POSTED using the submit
button? 2) is the $_POST['firstname'] variable already set? (click here for
info on predefined variables:
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.serve
r)

now in order for them not to be able to repost the data you have to clear
the value of the variable.  There are a few ways to do this, but i like
using UNSET().
after you post the data when the SUBMIT button is pressed, you'll use unset
to clear the value of the.  You can see that if the variable is empty, then
the if statement will not allow for the data to be reposted.  see below for
a snippet of code.   if the IF statement isnt satisfied, then the form will
show. the only way for them to resubmit the data would be to fill out the
form again.




if ($_SERVER['REQUEST_METHOD'] == POST   !empty($_POST['firstname']))
{
//sql code to submit data to database.

unset($_POST['firstname']; //clear variables after data has been posted

//here you can  redirect to another page upon successful posting
}

form method=post action=form.php //notice how form references itself

input type=textfield name=firstname

input type=submit name=submit value=submit
/form



Wista.Pl [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello group,

 I need a good solution to prevent sending form data to server after hiting
 refresh. How can PHP know  that user hit refresh and sent data that
already
 have been  stored in database (without querying database)?

 Remek





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




[PHP] Table management insert/update/delete/search

2002-06-13 Thread José León Serna

Hello:
   I'm looking for a script like phpmyAdmin, but much more simple, 
targeted to a single database to offer management capabilities, 
insert/update/delete/search, etc. Do you know of any?

Best regards.



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




[PHP] Newbie problem with POST vars

2002-06-13 Thread Sear, Mick

Sorry if this is a bit simple:

I'm trying to loop through $_POST vars in a function, which I understand to
be an autoglobal associative array.  Here's the code I'm using:

foreach($_POST as $item = $value){
echo $item, $valuebr;
}

However, I only get the first element of the array echoed, even though I
know there to be other elements (I can access them as $_POST[element])

Any ideas?

Cheers,
Mick

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




[PHP] passing name / value pairs in URL

2002-06-13 Thread blue

Until the recent version of PHP i've enjoyed being able to pass variables as
name/value pairs within my URL.  this has been essential for accessing my
mysql database.  here is an example of a url.

getAd.php?id=1

of course that link tells the script to fetch all associated data from a
particular table where the ad id = 1.  you knew that.

now here is my problem.  I just upgraded to the newest version of PHP.  Now
passing name/value pairs isn't an option.  I've read the security issues
involved, and that's all fine and dandy, but how do pass these values from
one page to the other (w/o turning register_globals back on).

using a form and posting the value to the next page and accessing the value
with $_POST[] isn't an option.  there are over 100 links per page
dynamically generated using a while loop.  the output looks like this:

getAd.php?id=1
getAd.php?id=2
getAd.php?id=3

etc...

any thoughts?



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




[PHP] php-speed

2002-06-13 Thread Philipp Melab

I have a simple newbie question...
Whats better (faster?):

- embedding PHP in HTML
- or printing HTML via PHP
...?

yours Philipp

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




[PHP] duplicate entries mystery

2002-06-13 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone

I have what I think is a very simple function, but I'm getting double
entries in my database? I think my php is okay but I'll post how I call
this function at the end. It's probably something stupid but I can't see
it!

/* update, insert or edit */
function update() {

$settings=new settings;

if($this-id) {

$qry=UPDATE news SET title = ;
$qry.='$this-title', text = '$this-text' ;
$qry.=WHERE id = '$this-id' ;
print(1);

} else {

$qry=INSERT INTO news  ;
$qry.=VALUES (NULL, NULL, '$this-title', '$this-text');
print(2);

}

$link=mysql_connect($settings-host, $settings-user, 
$settings-pass);

if(!$link) {
return FALSE;
}

$db=mysql_select_db($settings-db);

if(!($result=mysql_query($qry))) {
print(3);
return FALSE;
}

print(4);
return TRUE;

}

heres what I do:

$new=new news();
$news-set_title($title);
$news-set_text($text);
$news-update();

it prints out '2' and '4' but leaves to identical records in the db?

Many thanks...

- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9CIp0HpvrrTa6L5oRAgmJAJ9Vn6gfnPNVpPnurzTejgDXrKXQDgCdFopw
FVqUcS+nyaFxIUUzoNdRF3Q=
=v9y6
-END PGP SIGNATURE-

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




RE: [PHP] php-speed

2002-06-13 Thread Niklas Lampén

Embedding PHP in HTML, since I think HTML is ignored by php, just passed
thru.


Niklas


-Original Message-
From: Philipp Melab [mailto:[EMAIL PROTECTED]] 
Sent: 13. kesäkuuta 2002 14:55
To: [EMAIL PROTECTED]
Subject: [PHP] php-speed


I have a simple newbie question...
Whats better (faster?):

- embedding PHP in HTML
- or printing HTML via PHP
...?

yours Philipp

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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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




[PHP] Re: Controlling CVS with PHP...

2002-06-13 Thread l0t3k

check out Chora by the folks at Horde.org . its the code that powers
cvs.php.net


D Gibbs [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi, I was wondering if any one had managed to controll CVS with php.
 I'm wanting to add/update/remove/checkin/checkout files not just view.

 cheers
 dan





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




Re: [PHP] Table management insert/update/delete/search

2002-06-13 Thread José León Serna

José León Serna wrote:

 Hello:
   I'm looking for a script like phpmyAdmin, but much more simple, 
 targeted to a single database to offer management capabilities, 
 insert/update/delete/search, etc. Do you know of any?

 Best regards.


Sorry, I meant a single 'table', instead a single 'database'.

Regards.



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




RE: [PHP] php-speed

2002-06-13 Thread Niklas Lampén

On which part was I wrong?

Printing HTML via PHP is slower than inserting PHP into HTML. Maybe
we're just having communicational problems. :)

English is not my native language, so I might have understood it wrong,
but I understand embedding php opposite to echoing html. Am I understood
now? ;)

Btw. everyone else, check that link below too, if this issue is in your
interest.


Niklas


-Original Message-
From: Pradeep Dsouza [mailto:[EMAIL PROTECTED]] 
Sent: 13. kesäkuuta 2002 15:21
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php-speed


See this
And maybe you might change your impression

http://www.phpbeginner.com/columns/jason/echo

Pradeep

www.naharonline.com





- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 5:38 PM
Subject: RE: [PHP] php-speed


Embedding PHP in HTML, since I think HTML is ignored by php, just passed
thru.


Niklas


-Original Message-
From: Philipp Melab [mailto:[EMAIL PROTECTED]]
Sent: 13. kesäkuuta 2002 14:55
To: [EMAIL PROTECTED]
Subject: [PHP] php-speed


I have a simple newbie question...
Whats better (faster?):

- embedding PHP in HTML
- or printing HTML via PHP
...?

yours Philipp

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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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



###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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




[PHP] possible to add a record number to a query?

2002-06-13 Thread Jeff Field

I would like to have a column returned in a query that tells you which
record I'm looking at?  Sort of like an auto_increment?  IOW, the query
results would look like:

record   first   last

  1  johndoe
  2  joe blow
  3  carol   fisher

The table only has first and last, but I want the results to add something
like record to tell me which record it is.  Thanks for any help!

Jeff

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





[PHP] goto

2002-06-13 Thread Stephen Brewster

I am wirting a code seperation engine for PHP, the idea of which is it will
remove the need for me to have to build the majority of the websites at my
company. The designers will be able to build the html in dreamweaver or
similar and then insert custom tags into their code. The engine will parse
the code and insert the necessary PHP code. For the most part this engine is
working. However under some cirtumstances (like the one shown below) I need
to be able to perfom a loop or if statement. This is proving to be
incredably difficult since I would end up with code like below. For obvious
reasons the compiler does not like this code. This would be simple if PHP
had GOTO's. Does anyone know of a way around this situation?

HTML

table
   products type=loop
   tr
  tdproducts type=text field=name/td
  tdproducts type=text field=price/td
   /tr
   products type=endloop
/tr


PHP
---

if($type == 'LOOP') {
   $sql = 'SELECT * FROM products';
   $result = mysql_query($sql, $db);
   $record = $mysql_fetch_array($result, MYSQL_ASSOC);
   {
}

if($type == 'TEXT')
   echo($record[$field]);

if($type == 'ENDLOOP') {
   }
}

--

--
Stephen Brewster
Email: [EMAIL PROTECTED]
Tel: 0116 2335545
Mobile: 07776 475849
ICQ: 383095
--

UNIX SEX
unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep




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




[PHP] Re: php-speed

2002-06-13 Thread Leon Mergen


Philipp Melab [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 - embedding PHP in HTML
 - or printing HTML via PHP

With embedding PHP in HTML, do you mean using server side includes or do you
mean by having a .php file and having a layout like this:

html
head
title?=$title;?/title
body
?
code();
?
/body
/html

Regards,

Leon Mergen



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




Re: [PHP] Newbie problem with POST vars

2002-06-13 Thread Remy Dufour

Put reset($_POST) before foreach loop

 I'm trying to loop through $_POST vars in a function, which I understand
to
 be an autoglobal associative array.  Here's the code I'm using:

 foreach($_POST as $item = $value){
 echo $item, $valuebr;
 }

 However, I only get the first element of the array echoed, even though I
 know there to be other elements (I can access them as $_POST[element])




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




[PHP] Re: php-speed

2002-06-13 Thread Philipp Melab

Yes


Leon Mergen wrote:

 
 Philipp Melab [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 - embedding PHP in HTML
 - or printing HTML via PHP
 
 With embedding PHP in HTML, do you mean using server side includes or do
 you mean by having a .php file and having a layout like this:
 
 html
 head
 title?=$title;?/title
 body
 ?
 code();
 ?
 /body
 /html
 
 Regards,
 
 Leon Mergen


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




RE: [PHP] php-speed

2002-06-13 Thread Brian McGarvie

I believe it also depends on the quote types used...

Place string/text/html code etc with in single quotes  '  if the string contains no 
$var's to be parsed,
andif it does need to parse $var's.

 -Original Message-
 From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 1:25 PM
 To: Php-General
 Subject: RE: [PHP] php-speed
 
 
 On which part was I wrong?
 
 Printing HTML via PHP is slower than inserting PHP into HTML. Maybe
 we're just having communicational problems. :)
 
 English is not my native language, so I might have understood 
 it wrong,
 but I understand embedding php opposite to echoing html. Am I 
 understood
 now? ;)
 
 Btw. everyone else, check that link below too, if this issue 
 is in your
 interest.
 
 
 Niklas
 
 
 -Original Message-
 From: Pradeep Dsouza [mailto:[EMAIL PROTECTED]] 
 Sent: 13. kesäkuuta 2002 15:21
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] php-speed
 
 
 See this
 And maybe you might change your impression
 
 http://www.phpbeginner.com/columns/jason/echo
 
 Pradeep
 
 www.naharonline.com
 
 
 
 
 
 - Original Message -
 From: Niklas Lampén [EMAIL PROTECTED]
 To: Php-General [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 5:38 PM
 Subject: RE: [PHP] php-speed
 
 
 Embedding PHP in HTML, since I think HTML is ignored by php, 
 just passed
 thru.
 
 
 Niklas
 
 
 -Original Message-
 From: Philipp Melab [mailto:[EMAIL PROTECTED]]
 Sent: 13. kesäkuuta 2002 14:55
 To: [EMAIL PROTECTED]
 Subject: [PHP] php-speed
 
 
 I have a simple newbie question...
 Whats better (faster?):
 
 - embedding PHP in HTML
 - or printing HTML via PHP
 ?
 
 yours Philipp
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ###
 This message has been scanned by F-Secure Anti-Virus for 
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 ###
 This message has been scanned by F-Secure Anti-Virus for 
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 ###
 This message has been scanned by F-Secure Anti-Virus for 
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 ###
 This message has been scanned by F-Secure Anti-Virus for 
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 -- 
 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] php-speed

2002-06-13 Thread Niklas Lampén

I don't think so. The difference is (IMHO + the article linked below) if
you use

...a href=?=$Var?Foo/a... (faster)
or
? print ...a href=\$Var\Foo/a...; ? (slower)


Niklas


-Original Message-
From: Brian McGarvie [mailto:[EMAIL PROTECTED]] 
Sent: 13. kesäkuuta 2002 15:29
To: [EMAIL PROTECTED]
Cc: Php-General
Subject: RE: [PHP] php-speed


I believe it also depends on the quote types used...

Place string/text/html code etc with in single quotes  '  if the
string contains no $var's to be parsed, andif it does need to
parse $var's.

 -Original Message-
 From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 1:25 PM
 To: Php-General
 Subject: RE: [PHP] php-speed
 
 
 On which part was I wrong?
 
 Printing HTML via PHP is slower than inserting PHP into HTML. Maybe 
 we're just having communicational problems. :)
 
 English is not my native language, so I might have understood
 it wrong,
 but I understand embedding php opposite to echoing html. Am I 
 understood
 now? ;)
 
 Btw. everyone else, check that link below too, if this issue
 is in your
 interest.
 
 
 Niklas
 
 
 -Original Message-
 From: Pradeep Dsouza [mailto:[EMAIL PROTECTED]]
 Sent: 13. kesäkuuta 2002 15:21
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] php-speed
 
 
 See this
 And maybe you might change your impression
 
 http://www.phpbeginner.com/columns/jason/echo
 
 Pradeep
 
 www.naharonline.com
 
 
 
 
 
 - Original Message -
 From: Niklas Lampén [EMAIL PROTECTED]
 To: Php-General [EMAIL PROTECTED]
 Sent: Thursday, June 13, 2002 5:38 PM
 Subject: RE: [PHP] php-speed
 
 
 Embedding PHP in HTML, since I think HTML is ignored by php,
 just passed
 thru.
 
 
 Niklas
 
 
 -Original Message-
 From: Philipp Melab [mailto:[EMAIL PROTECTED]]
 Sent: 13. kesäkuuta 2002 14:55
 To: [EMAIL PROTECTED]
 Subject: [PHP] php-speed
 
 
 I have a simple newbie question...
 Whats better (faster?):
 
 - embedding PHP in HTML
 - or printing HTML via PHP
 ?
 
 yours Philipp
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ###
 This message has been scanned by F-Secure Anti-Virus for
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 ###
 This message has been scanned by F-Secure Anti-Virus for
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 ###
 This message has been scanned by F-Secure Anti-Virus for
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 ###
 This message has been scanned by F-Secure Anti-Virus for
 Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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




[PHP] Re: php-speed

2002-06-13 Thread Philipp Melab

Yes, Ithought that embedding must be faster too. But I was confused because 
in nearly every PHP-Beginner Tutorial/Book I've seen the Hello-World 
Example looks like this:

?
echo html;
echo head;
echo title.../title;
echo /head; 

echo body;
echo pHello World!/p;
echo /body;
echo /html;
?

funny, isn't it?

yours, Philipp

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




[PHP] view source with opera

2002-06-13 Thread Angelo Marcos Rigo

Hi list
I am using php on the company´s website  that i work
and now someone told me that  you can view the php source with
the opera browser
he says he done it by himself .

Anybody can tell me if it´s true or not ?
or in wich conditions this can happen! how to fix this?

Thank´s
 

Ângelo Marcos Rigo
Webmaster Colégio Anchieta
http://www.colegioanchieta.g12.br


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




Re: [PHP] Newbie problem with POST vars

2002-06-13 Thread Sear, Mick

I've tried this, but it's still doing the same thing.  Is there something
special about this particular variable that I need to know?  I've tried it
with $HTTP_POST_VARS as well, declaring $HTTP_POST_VARS as global in the
function first.

Put reset($_POST) before foreach loop

 I'm trying to loop through $_POST vars in a function, which I
understand
to
 be an autoglobal associative array.  Here's the code I'm using:

 foreach($_POST as $item = $value){
 echo $item, $valuebr;
 }

 However, I only get the first element of the array echoed, even
though I
 know there to be other elements (I can access them as
$_POST[element])




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




Re: [PHP] view source with opera

2002-06-13 Thread Adam Voigt

Nope, he's lying. PHP is server side, a browser is well,
browser side. So, no. The only possible way is if you had
your PHP actually printing (by say an accidentally closed ?php)
which would cause it to be show, but since thats a programming
mistake, thats not really a fault of the language.

Adam
[EMAIL PROTECTED]

On Thu, 2002-06-13 at 09:12, Angelo Marcos Rigo wrote:
 Hi list
   I am using php on the company´s website  that i work
   and now someone told me that  you can view the php source with
 the opera browser
   he says he done it by himself .
 
   Anybody can tell me if it´s true or not ?
   or in wich conditions this can happen! how to fix this?
   
   Thank´s
  
 
 Ângelo Marcos Rigo
 Webmaster Colégio Anchieta
 http://www.colegioanchieta.g12.br
 
 
 -- 
 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] view source with opera

2002-06-13 Thread Christoph Starkmann

I'm quite sure that this won't work...
The server isn't delivering the php source, so the client
will not get the source code but only the resulting code
the script generated.
So IMHO this is a hoax.

 Hi list
   I am using php on the company´s website  that i work
   and now someone told me that  you can view the php source with
 the opera browser
   he says he done it by himself .
 
   Anybody can tell me if it´s true or not ?
   or in wich conditions this can happen! how to fix this?

Let him show you...

Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




Re: [PHP] passing name / value pairs in URL

2002-06-13 Thread Stuart Dallas

Thursday, June 13, 2002, 1:37:03 AM, you wrote:

 Until the recent version of PHP i've enjoyed being able to pass variables as
 name/value pairs within my URL.  this has been essential for accessing my
 mysql database.  here is an example of a url.

Why can't you continue to enjoy it?

 getAd.php?id=1

The variable can be found in the $_GET array, as in $_GET['id'].

Or have I misunderstood your problem?

-- 
Stuart


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




Re: [PHP] view source with opera

2002-06-13 Thread Adam Voigt

Oh, one other possibility besides my previous statement, if PHP is not
properly configured on the server hosting the .php pages, it probably
would just pass the PHP right to the browser since it doesn't know it's
supposed to execute the PHP block of code. Ofcourse, PHP wouldn't work
anywhere if this is the case, which is usally caught pretty quick.

Adam Voigt
[EMAIL PROTECTED]

On Thu, 2002-06-13 at 09:12, Angelo Marcos Rigo wrote:
 Hi list
   I am using php on the company´s website  that i work
   and now someone told me that  you can view the php source with
 the opera browser
   he says he done it by himself .
 
   Anybody can tell me if it´s true or not ?
   or in wich conditions this can happen! how to fix this?
   
   Thank´s
  
 
 Ângelo Marcos Rigo
 Webmaster Colégio Anchieta
 http://www.colegioanchieta.g12.br
 
 
 -- 
 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




[PHP] Re: php-speed

2002-06-13 Thread Leon Mergen


Philipp Melab [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Yes, Ithought that embedding must be faster too. But I was confused
because
 in nearly every PHP-Beginner Tutorial/Book I've seen the Hello-World
 Example looks like this:

 ?
 echo html;
 echo head;
 echo title.../title;
 echo /head;

 echo body;
 echo pHello World!/p;
 echo /body;
 echo /html;
 ?

Hello Philipp,

I think that must be because it's the most easy to explain... It's very easy
for people having experience with Perl, since Perl works that way...

I personally only use templates (I even wrote a caching template engine) ,
so that would be the last step in layout I think ;)

Regards,

Leon Mergen



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




Re: [PHP] possible to add a record number to a query?

2002-06-13 Thread Jason Wong

On Thursday 13 June 2002 20:27, Jeff Field wrote:
 I would like to have a column returned in a query that tells you which
 record I'm looking at?  Sort of like an auto_increment?  IOW, the query
 results would look like:

 record   first   last

   1  johndoe
   2  joe blow
   3  carol   fisher

 The table only has first and last, but I want the results to add something
 like record to tell me which record it is.  Thanks for any help!

Is there any reason why you need/want to do this? Data are stored in a db in 
no particular order. If you want a particular order add an ORDER BY clause. 
If you want 'row' numbers then just fudge it in php -- assign a row number to 
each record you retrieve from the query.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
There's such a thing as too much point on a pencil.
-- H. Allen Smith, Let the Crabgrass Grow
*/


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




Re: [PHP] Newbie problem with POST vars

2002-06-13 Thread Jason Wong

On Thursday 13 June 2002 21:16, Sear, Mick wrote:
 I've tried this, but it's still doing the same thing.  Is there something
 special about this particular variable that I need to know?  I've tried it
 with $HTTP_POST_VARS as well, declaring $HTTP_POST_VARS as global in the
 function first.

   Put reset($_POST) before foreach loop

I'm trying to loop through $_POST vars in a function, which I

 understand
   to

be an autoglobal associative array.  Here's the code I'm using:
   
foreach($_POST as $item = $value){
echo $item, $valuebr;
}
   
However, I only get the first element of the array echoed, even

 though I

know there to be other elements (I can access them as

 $_POST[element])


What do you get if you do:

 print_r($_POST);



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
I gave up Smoking, Drinking and Sex.  It was the most 
*__horrifying* 20
minutes of my life!
*/


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




Re: [PHP] Newbie problem with POST vars

2002-06-13 Thread Remy Dufour

If you do this, it should work

function foo()
{
global $_POST;
reset($_POST);
foreach($_POST as $item = $value){
echo $item, $valuebr;
}
}

Thats work for me.


 I've tried this, but it's still doing the same thing.  Is there something
 special about this particular variable that I need to know?  I've tried it
 with $HTTP_POST_VARS as well, declaring $HTTP_POST_VARS as global in the
 function first.




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




Re: [PHP] goto

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002, 1:22:07 PM, Stephen Brewster wrote:
 HTML
 
 table
products type=loop
tr
   tdproducts type=text field=name/td
   tdproducts type=text field=price/td
/tr
products type=endloop
 /tr


 PHP
 ---
 if($type == 'LOOP') {
$sql = 'SELECT * FROM products';
$result = mysql_query($sql, $db);
$record = $mysql_fetch_array($result, MYSQL_ASSOC);
{
 }

 if($type == 'TEXT')
echo($record[$field]);

 if($type == 'ENDLOOP') {
}
 }

Ok, I'm not entirely sure what you're trying to do, but your loop should
probably look something like this...

if ($type == 'LOOP')
{
$sql = 'SELECT * FROM products';
$result = mysql_query($sql, $db);
$record = $mysql_fetch_array($result, MYSQL_ASSOC);

while ($type != 'ENDLOOP')
{
if($type == 'TEXT')
echo($record[$field]);
}
}

That's going by your code. However, it still doesn't make sense and will result
in an endless loop since $type never changes.

For the record, a goto would be the worst way to implement something like this!

I hope that helps a bit.

-- 
Stuart


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




Re: [PHP] php-speed

2002-06-13 Thread Stuart Dallas

Thursday, June 13, 2002, 2:09:23 PM, you wrote:
 I don't think so. The difference is (IMHO + the article linked below) if
 you use

 ...a href=?=$Var?Foo/a... (faster)
 or
 ? print ...a href=\$Var\Foo/a...; ? (slower)

Actually, Brian is right. PHP parses text contained within s whereas it
doesn't do so with text contained within 's. However, neither will be quicker
than inline HTML since PHP completely ignores that as previously mentioned.

-- 
Stuart


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




Re: [PHP] view source with opera

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002, 2:20:29 PM, you wrote:

 I'm quite sure that this won't work...
 The server isn't delivering the php source, so the client
 will not get the source code but only the resulting code
 the script generated.
 So IMHO this is a hoax.

Unless your server has phps (source view) enabled. If it has then you can see
the source of any file by using the extension .phps.

-- 
Stuart


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




RE: [PHP] view source with opera

2002-06-13 Thread Christoph Starkmann

  I'm quite sure that this won't work...
  The server isn't delivering the php source, so the client
  will not get the source code but only the resulting code
  the script generated.
  So IMHO this is a hoax.
 
 Unless your server has phps (source view) enabled. If it has 
 then you can see
 the source of any file by using the extension .phps.

Awright! But then it would be possible with any browser...

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




Re: [PHP] view source with opera

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002, 2:49:56 PM, you wrote:

  I'm quite sure that this won't work...
  The server isn't delivering the php source, so the client
  will not get the source code but only the resulting code
  the script generated.
  So IMHO this is a hoax.
 
 Unless your server has phps (source view) enabled. If it has 
 then you can see
 the source of any file by using the extension .phps.

 Awright! But then it would be possible with any browser...

Unless I missed it, the OP never said it *only* happened in Opera.

-- 
Stuart


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




[PHP] Database Abstraction Suite

2002-06-13 Thread David Russell

Hi all

I am busy developing a PHP DB application. I obviously want this to be 
as portable as possible - and then went to the Zend pages.

I have looked at the DB abstraction Applications. There are five or so 
which have all been rated as a four dot (I presume out of 5).

Does anyone have any experience with DB Absteraction suites. If so, I 
need one that supports InterBase/Firebird and also supports MySQL. I 
would like to know what they are like in terms of ease of learning the 
generic things, etc, etc.

Thanks in advance

David Russell


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




[PHP] next and previous buttons performing on a query

2002-06-13 Thread Wilbert Enserink

Hi all,


I have this mySQL query giving me my result back.

The info about the current db-record is showing. 
Now I want to display ' view next ' and ' view previous ' buttons on my website. which 
takes you to the same page but with the next record in the query result.
Is there a clever way to do this? 

Any tips are welcome!

Many regards 

Wilbert Enserink

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


RE: [PHP] possible to add a record number to a query?

2002-06-13 Thread Jeff Field

Yes, there is a particular reason.  The actual query I do pulls information
from two tables and has both ORDER BY and GROUP BY clauses.  The
auto_increment column (think of the query results as a table) will give me
the rank of the results.  I know how to manipulate the data in PHP to
accomplish what I need.  I just thought there might be a way in which the
query could do it up front.  Sort of like when you want to know how many
times a particular record exists, you can do a COUNT(*).  I just want the
results to basically give me a column in the query that lists the results 1,
2, 3, etc.  Make sense?

Thanks for your help!

Jeff

 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 8:30 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] possible to add a record number to a query?


 On Thursday 13 June 2002 20:27, Jeff Field wrote:
  I would like to have a column returned in a query that tells you which
  record I'm looking at?  Sort of like an auto_increment?  IOW, the query
  results would look like:
 
  record   first   last
 
1  johndoe
2  joe blow
3  carol   fisher
 
  The table only has first and last, but I want the results to
 add something
  like record to tell me which record it is.  Thanks for any help!

 Is there any reason why you need/want to do this? Data are stored
 in a db in
 no particular order. If you want a particular order add an ORDER
 BY clause.
 If you want 'row' numbers then just fudge it in php -- assign a
 row number to
 each record you retrieve from the query.

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 There's such a thing as too much point on a pencil.
   -- H. Allen Smith, Let the Crabgrass Grow
 */


 --
 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] view source with opera

2002-06-13 Thread Dan Hardiker

In short I think what everyone is trying to say is: it depends on how your
server is setup.

If you host your own servers then you need to read up on how PHP works in
the chain of command and how its configured. If not, then reading up on
the whole request and deliver process of HTTP where a scripting language
like PHP / ASP is involved would be useful... but its unlikely that a
commerical hoster would allow .php files to have their source viewd.

To clear things up - if the extension you are using is being parsed by PHP
(eg .php files are working correctly and a phpinfo() executes as expected)
then there is *no known exploit* to get the source from that page. Thats
not to say there isnt one we dont know about - and if your friend /
collegue who informed you that it is possible, can ... then I would be (as
would most of us on this list) most eager to find out how. If he can
replicate the exploit, I have an open mind.

For the record, there are only 3 ways of outputing PHP source on a
properly configured webserver running PHP.

1. Placing a show_source PHP command in your PHP parsed script

2. Using .phps (only works on Unix AFAIK)

3. Outputing the code yourself using echo's / having badly formed code
(eg: missing out the ?php at the begining exposing your php code as raw
html).

In all 3 cases it would be quite obvious (as your site would not function
as intended). Also - for the record - if you cannot view the PHP source
inside IE, then you cannot inside netscape, opera nor any other web
browser as IE gets the same data as the rest of them (unless your doing
some fancy stuff, by which you will already know the answer to most of
your questions).

Hope I havent been to confusing


- Dan


 On Thursday, June 13, 2002, 2:20:29 PM, you wrote:

 I'm quite sure that this won't work...
 The server isn't delivering the php source, so the client
 will not get the source code but only the resulting code
 the script generated.
 So IMHO this is a hoax.

 Unless your server has phps (source view) enabled. If it has then you
 can see the source of any file by using the extension .phps.

 --
 Stuart


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


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



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




RE: [PHP] php-speed

2002-06-13 Thread Brian McGarvie

the best answer to this is that it's down to persona preferance as well... some people 
might
find it easier to read/write code that is in a more 'traditional' layout which is where
using  or ' would help. I personally use a mixture of all 3 'methods' of using php. 
While in-line
is fastest i sometimes find using lots of ?= ? all over a pain. So I will drop in 
and out of methods
according to how much php code/complexity of code vs ammount of HTML with/without 
generated content.


 -Original Message-
 From: Stuart Dallas [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 2:44 PM
 To: Niklas Lampén
 Cc: Php-General
 Subject: Re: [PHP] php-speed
 
 
 Thursday, June 13, 2002, 2:09:23 PM, you wrote:
  I don't think so. The difference is (IMHO + the article 
 linked below) if
  you use
 
  ...a href=?=$Var?Foo/a... (faster)
  or
  ? print ...a href=\$Var\Foo/a...; ? (slower)
 
 Actually, Brian is right. PHP parses text contained within s 
 whereas it
 doesn't do so with text contained within 's. However, neither 
 will be quicker
 than inline HTML since PHP completely ignores that as 
 previously mentioned.
 
 -- 
 Stuart
 
 
 -- 
 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] view source with opera

2002-06-13 Thread Dan Hardiker

 Unless your server has phps (source view) enabled. If it has
 then you can see
 the source of any file by using the extension .phps.

 Awright! But then it would be possible with any browser...

 Unless I missed it, the OP never said it *only* happened in Opera.

but unless we are assuming the OP is a complete idiot, we can assume that
it would be more than obvious! As the PHP script wouldnt execute at all!
Also, this only works on a unix host, and I doubt that anyone would
purposly name their files .phps  blah blah.

In short the answer is still no, you cannot gain the source from a
functional PHP script unless it has been setup to. There is no exploit to
do this with any browser.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



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




Re: RES: [PHP] view source with opera

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002, 2:59:35 PM, you wrote:
 yes the bad guy says it only happen in opera
 i ask to show me how but give no response until now 

Let us know what he says. I think we'd all be interested.

-- 
Stuart


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




Re: [PHP] possible to add a record number to a query?

2002-06-13 Thread Chris Hewitt

Jeff,

You don't tell us which database. If its Oracle then there is ROWID. 
Using some sort of record number is good for linking tables as it a 
primary/foreign key, but otherwise why would you want it? If you do not 
have such a field as this at present (and want one), you could always 
add one (ALTER TABLE ADD ColName).

This really is a pure sql question, not relevant to php and this list.

HTH
Chris

Jeff Field wrote:

I would like to have a column returned in a query that tells you which
record I'm looking at?  Sort of like an auto_increment?  IOW, the query
results would look like:

record   first   last

  1  johndoe
  2  joe blow
  3  carol   fisher

The table only has first and last, but I want the results to add something
like record to tell me which record it is.  Thanks for any help!

Jeff




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




RE: [PHP] Database Abstraction Suite

2002-06-13 Thread SP

Hi David

I am using adodb for my database abstraction http://php.weblogs.com/adodb

I got it up and running in no time.  Just go through this manual
http://php.weblogs.com/ADOdb_manual or this tutorial
http://php.weblogs.com/adodb_tutorial.

It has a RecordCount since some database don't return the number of rows, it
has a SelectLimit since databases do the limit syntax differently, it has
GenID since some database don't support auto incrementing ids, it lets you
do rollbacks for those databases that support it ...

There's a whole bunch more functions so just try it out.



-Original Message-
From: David Russell [mailto:[EMAIL PROTECTED]]
Sent: June 13, 2002 10:05 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Database Abstraction Suite


Hi all

I am busy developing a PHP DB application. I obviously want this to be
as portable as possible - and then went to the Zend pages.

I have looked at the DB abstraction Applications. There are five or so
which have all been rated as a four dot (I presume out of 5).

Does anyone have any experience with DB Absteraction suites. If so, I
need one that supports InterBase/Firebird and also supports MySQL. I
would like to know what they are like in terms of ease of learning the
generic things, etc, etc.

Thanks in advance

David Russell


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




[PHP] Help! authorization question...

2002-06-13 Thread Robin Bouwhuis

Hello,

I am new to PHP and trying to learn.  I am trying a tutorial and this is the
script.  It is supposed to pop up a box requiring a username and pass.  but
all I get is

'Authorization Required'

Any suggestions?  I am running PHP3 and 4 and on an IIS server (it is just
for testing, normally it would be apache)

Thanks in advance!!!

?php

 // File Name: auth02.php

 // Check to see if $PHP_AUTH_USER already contains info

 if (!isset($PHP_AUTH_USER)) {

  // If empty, send header causing dialog box to appear

  header('WWW-Authenticate: Basic realm=My Private Stuff');
  header('HTTP/1.0 401 Unauthorized');
  echo 'Authorization Required.';
  exit;

 } else if (isset($PHP_AUTH_USER)) {

  if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != abc123)) {

   header('WWW-Authenticate: Basic realm=My Private Stuff');
   header('HTTP/1.0 401 Unauthorized');
   echo 'Authorization Required.';
   exit;

  } else {
   echo 
   PYou're authorized!/p
   ;
  }
 }



?


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




[PHP] PCRE Problem

2002-06-13 Thread Erick Lee

$string = [b]Test[/b]
I want to change it to 
$string = bTest/b
How?



Re: [PHP] next and previous buttons performing on a query

2002-06-13 Thread Chris Hewitt

Wilbert,

Use the LIMIT tag in your select statement. You can also choose which 
matching record to start from.

Another pure database question...

HTH
Chris

Wilbert Enserink wrote:

Hi all,


I have this mySQL query giving me my result back.

The info about the current db-record is showing. 
Now I want to display ' view next ' and ' view previous ' buttons on my website. 
which takes you to the same page but with the next record in the query result.
Is there a clever way to do this? 

Any tips are welcome!

Many regards 

Wilbert Enserink

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-




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




[PHP] Extracting Variables

2002-06-13 Thread Steve Buehler

I hope that someone will be kind enough to help me on this.
I have some variables on a page that are dynamic.  I can run this to view 
the variables (from a POST) for testing:

Foreach($HTTP_POST_VARS as $key=$value) echo($key = $valuebr);

and the results are:
-results-
team_number_1 = 5
sub1_1 = 10
sub2_1 = B
team_number_2 = 7
sub1_2 = 10
sub2_2 = B
team_number_3 = 29
sub1_3 = 10
sub2_3 = B
team_number_4 = 23
sub1_4 = 10
sub2_4 = B
team_number_5 = 8
sub1_5 = 10
sub2_5 = B
team_number_6 = 20
sub1_6 = 10
sub2_6 = B
team_number_7 = 9
sub1_7 = 10
sub2_7 = B
team_number_8 = 11
sub1_8 = 10
sub2_8 = B
i = 8
action = Update
-end results-

I want to do something like the following, but it does not work:
testinput();
function testinput(){
GLOBAL $HTTP_POST_VARS;
extract($HTTP_POST_VARS);
echo i = $ibr;
for($c=1;$c=$i;$c++){
echo team_number $team_number_$cbr;
echo sub1_$c = $sub1_$cbr;
echo sub2_$c = $sub2_$cbr;
echo sub3_$c = $sub3_$cbr;
echo sub4_$c = $sub4_$cbr;
echo sub5_$c = $sub5_$cbr;
}
}

The above gives me these results:
---results--
i = 8
team_number 1
sub1_1 = 1
sub2_1 = 1
sub3_1 = 1
sub4_1 = 1
sub5_1 = 1
team_number 2
sub1_2 = 2
sub2_2 = 2
sub3_2 = 2
sub4_2 = 2
sub5_2 = 2
team_number 3
sub1_3 = 3
sub2_3 = 3
sub3_3 = 3
sub4_3 = 3
sub5_3 = 3
team_number 4
sub1_4 = 4
sub2_4 = 4
sub3_4 = 4
sub4_4 = 4
sub5_4 = 4
team_number 5
sub1_5 = 5
sub2_5 = 5
sub3_5 = 5
sub4_5 = 5
sub5_5 = 5
team_number 6
sub1_6 = 6
sub2_6 = 6
sub3_6 = 6
sub4_6 = 6
sub5_6 = 6
team_number 7
sub1_7 = 7
sub2_7 = 7
sub3_7 = 7
sub4_7 = 7
sub5_7 = 7
team_number 8
sub1_8 = 8
sub2_8 = 8
sub3_8 = 8
sub4_8 = 8
sub5_8 = 8
end results


Thank You in Advance
Steve


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




RE: [PHP] next and previous buttons performing on a query

2002-06-13 Thread Brian McGarvie

you need to keep track of the last record and number to display to work out the values 
for limit.

 -Original Message-
 From: Chris Hewitt [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 3:32 PM
 To: Wilbert Enserink
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] next and previous buttons performing on a query
 
 
 Wilbert,
 
 Use the LIMIT tag in your select statement. You can also choose which 
 matching record to start from.
 
 Another pure database question...
 
 HTH
 Chris
 
 Wilbert Enserink wrote:
 
 Hi all,
 
 
 I have this mySQL query giving me my result back.
 
 The info about the current db-record is showing. 
 Now I want to display ' view next ' and ' view previous ' 
 buttons on my website. which takes you to the same page but 
 with the next record in the query result.
 Is there a clever way to do this? 
 
 Any tips are welcome!
 
 Many regards 
 
 Wilbert Enserink
 
 -
 Pas de Deux
 Van Mierisstraat 25
 2526 NM Den Haag
 tel 070 4450855
 fax 070 4450852
 http://www.pdd.nl
 [EMAIL PROTECTED]
 -
 
 
 
 
 -- 
 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] PCRE Problem

2002-06-13 Thread Brian McGarvie

$string = '[b]Test[/b]';
$bbcode_string = str_replace(, [, str_replace(, ], $string));

or look into regular expressions...

 -Original Message-
 From: Erick Lee [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 3:25 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PCRE Problem
 
 
 
 I want to change it to 
 $string = bTest/b
 How?
 

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




[PHP] security advice...

2002-06-13 Thread Jas

I am wondering if anyone out there knows of a good and quick way to test the
security of a site for multiple vulnerabilities; cross site scripting, etc.
Of course any examples of secure coding techniques might be a better
question to ask, so if anyone knows of some good resources for this please
let me know where I can do some good research on this subject.  Thanks in
advance,
Jas



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




RE: [PHP] Newbie problem with POST vars

2002-06-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Remy Dufour [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 14:34
 
 If you do this, it should work
 
 function foo()
 {
 global $_POST;

That's unnecessary -- the $_ arrays are automatically global (superglobal).

 reset($_POST);

That's unnecessary -- foreach always traverses the whole of an array, regardless of 
the current position of its internal pointer.

 foreach($_POST as $item = $value){
 echo $item, $valuebr;
 }
 }

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] Help! authorization question...

2002-06-13 Thread Julie Meloni

RB I am new to PHP and trying to learn.  I am trying a tutorial and this is the
RB script.  It is supposed to pop up a box requiring a username and pass.  but
RB all I get is

If you are using the CGI version of PHP, HTTP-based authentication
will not work.  That is stated in the tutorial.


- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




[PHP] Instantiating Objects ?

2002-06-13 Thread Kevin Caporaso

Is it possible to instantiate an object from one of my c++ shared libraries
(goo.so) and then call methods on that object?

How efficient is PHP's way of doing it? (if possible)
Also, can I pass things like the querystring and form data into that
instantiated object?

Thanks for any response!
$Kevin




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




[PHP] $HTTP_USER_AGENT

2002-06-13 Thread Webmaster do Aborla.net

Hello,

Why $HTTP_USER_AGENT don't work?? I can't get it's value, but in phpinfo the
value appears. why this???


Thanking in advance,
Nuno Lopes



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




RE: [PHP] Extracting Variables

2002-06-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Steve Buehler [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 15:54
 
 I hope that someone will be kind enough to help me on this.

snip

 I want to do something like the following, but it does not work:
 testinput();
 function testinput(){
 GLOBAL $HTTP_POST_VARS;
 extract($HTTP_POST_VARS);
 echo i = $ibr;
 for($c=1;$c=$i;$c++){
   echo team_number $team_number_$cbr;
   echo sub1_$c = $sub1_$cbr;
   echo sub2_$c = $sub2_$cbr;
   echo sub3_$c = $sub3_$cbr;
   echo sub4_$c = $sub4_$cbr;
   echo sub5_$c = $sub5_$cbr;
   }
 }

I don't think you can do this directly in a single string (at least, I haven't been 
able to!).  However, either of the following formats should work for you:

echo sub1_$c =  . ${sub1_$c} . 'br';

echo sub1_$c =  . ${'sub1_'.$c} . 'br';

But -- erm -- can I just ask why you're not using arrays, which might make life 
somewhat easier?!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] $HTTP_USER_AGENT

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002, 4:36:29 PM, you wrote:
 Why $HTTP_USER_AGENT don't work?? I can't get it's value, but in phpinfo the
 value appears. why this???

Try $_SERVER['HTTP_USER_AGENT']. If that works, read
http://www.php.net/manual/en/language.variables.predefined.php.

-- 
Stuart


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




[PHP] IE 6 is Doing Something Weird

2002-06-13 Thread Liam Gibbs

It seems I can't set cookies in IE 6. Well, I haven't
tried myself, as I'm a little bit wary of installing
this over my current version of IE (and won't be able
to downgrade afterward, thanks to Microsoft logic).

Reported from a couple of the users on my site who use
IE 6, they can't log in, presumably because of the
cookie not being set. Their settings seem all okay,
but they still can't log in.

Does anyone have a possible solution to this?

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




RE: [PHP] PHP with No Web Server?

2002-06-13 Thread Brian McGarvie

PHP is an application that generates HTML code similar to Perl. Which is what is 
served to the Client(Browser). Therefore no, you need to use IIS/Apache/other 
webserver in order to use PHP...

Unless you are using it as a scripting language for shell scripts... or using GTK to 
create graphical applications.

 -Original Message-
 From: Kevin Caporaso [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 5:00 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP with No Web Server?
 
 
 
 In other words.. Can PHP serve as the Web Server or is 
 another web server
 required to handle the socket connections, etc.?
 
 Thanks for any response.
 $Kevin
 
 
 
 -- 
 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] PHP with No Web Server?

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002, 5:00:23 PM, you wrote:
 In other words.. Can PHP serve as the Web Server or is another web server
 required to handle the socket connections, etc.?

PHP can serve as a web server, but you would need to write (find) the code to
do it - I'm sure there is plenty out there. However, to answer the question I
think you were asking, PHP does not come with a ready-to-run web server.

-- 
Stuart


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




[PHP] Re: IE 6 is Doing Something Weird

2002-06-13 Thread Kevin Caporaso

My experience with cookies on IE 6.0 are that if there is no privacy
policy cookies will not get installed.
They need to specifically override cookie handling in their browser.
Not sure if they have done that already or not but it's under Tools,
Internet Options, Privacy(tab), Advanced button.
That's all I have right now.
Good Luck

Liam Gibbs [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It seems I can't set cookies in IE 6. Well, I haven't
 tried myself, as I'm a little bit wary of installing
 this over my current version of IE (and won't be able
 to downgrade afterward, thanks to Microsoft logic).

 Reported from a couple of the users on my site who use
 IE 6, they can't log in, presumably because of the
 cookie not being set. Their settings seem all okay,
 but they still can't log in.

 Does anyone have a possible solution to this?

 __
 Do You Yahoo!?
 Yahoo! - Official partner of 2002 FIFA World Cup
 http://fifaworldcup.yahoo.com



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




[PHP] PCRE question

2002-06-13 Thread Batch

I am trying to write a small piece of code that looks for repeating digits
or symbols...such as  $$, %%, 99

Here is what I have come up with...although I dont think this is the
complete Regex.

$pass = test99ing;
if (preg_match(/[^a-zA-Z]{2,}/,$pass, $match)){
echo(You cant have repeating symbols: $match)

However this doesnt seem to work at all.

Any help is greatly appreciated.

Scott



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




Re: [PHP] PHP with No Web Server?

2002-06-13 Thread Clay Loveless

Here's a cool little PHP app ... Requires PHP to be compiled as a standalone
CGI with --enable-pcntl as a config option.

http://nanoweb.si.kz/

Nanoweb is a modular http server written in PHP 4.2.

Nanoweb's main features are :
*Decent performance
*HTTP/1.1 compliant
*CGI support 
*Name based virtual hosts
*Authentication
*Keep-alive connections
*Server Side Includes
*Apache combined and MySQL logging
*gzip compression support

Fun code. : )

-Clay


 From: Stuart Dallas [EMAIL PROTECTED]
 Organization: SharedServer.net
 Reply-To: Stuart Dallas [EMAIL PROTECTED]
 Date: Thu, 13 Jun 2002 17:08:41 +0100
 To: Kevin Caporaso [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP with No Web Server?
 
 On Thursday, June 13, 2002, 5:00:23 PM, you wrote:
 In other words.. Can PHP serve as the Web Server or is another web server
 required to handle the socket connections, etc.?
 
 PHP can serve as a web server, but you would need to write (find) the code to
 do it - I'm sure there is plenty out there. However, to answer the question I
 think you were asking, PHP does not come with a ready-to-run web server.
 
 -- 
 Stuart
 
 
 -- 
 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




[PHP] Value of variable with name stored in another variable

2002-06-13 Thread Daniele Baroncelli

How can I access the value of a variable whose name is stored in another
variable?

Example:
$field=artist;

How can I access the value of $artist ?



Thanks

Daniele



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




RE: [PHP] Value of variable with name stored in another variable

2002-06-13 Thread Ford, Mike [LSS]

 -Original Message-
 From: Daniele Baroncelli [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 17:27
 
 How can I access the value of a variable whose name is stored 
 in another
 variable?
 
 Example:
 $field=artist;
 
 How can I access the value of $artist ?

$$field

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] Value of variable with name stored in another variable

2002-06-13 Thread John Holmes

Echo $$field;

--John Holmes...

 -Original Message-
 From: Daniele Baroncelli [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 12:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Value of variable with name stored in another variable
 
 How can I access the value of a variable whose name is stored in
another
 variable?
 
 Example:
 $field=artist;
 
 How can I access the value of $artist ?
 
 
 
 Thanks
 
 Daniele
 
 
 
 --
 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] PHP with No Web Server?

2002-06-13 Thread John Holmes

 In other words.. Can PHP serve as the Web Server or is another web
server
 required to handle the socket connections, etc.?
 
 Thanks for any response.
 $Kevin

Warning: Undefined variable $Kevin

You can run PHP on the command line without a web server, but it doesn't
do much good. For anyone else to see your PHP creations, yes, you need a
web server.

---John Holmes...


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




RE: [PHP] Re: how can i insert date

2002-06-13 Thread John Holmes

INSERT INTO table (date_column) VALUES ('$insert');

If you're using a varchar() type column, then that'll work. If it's a
DATE/DATETIME/etc... column in your DB, then you have to format it in
the DB format...

What DB are you using?

---John Holmes...

 -Original Message-
 From: Cirstoiu Aurel Sorin [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 4:03 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: how can i insert date
 
 You make a variable $insert = $year./.$month./.$date(or whatever
 format
 you wish) and insert it in the database.
 
 --
 
 Cirstoiu Aurel Sorin
 InterAKT Support
 
 http://www.interakt.ro
 
 Suman [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi
 i have a date,month and an year what is the function in php that i can
i
 use
 to convert the 3 vars into a date and insert into a postgres db.
 
 bye
 suman
 
 
 
 --
 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] Varible Varibles

2002-06-13 Thread John Holmes

I think you're missing the point of variable variables.

?
$a = 'foo';
$$a = 'bar';

echo $a $$a;
?

After the first use of $$a, you now have a variable called $foo with a
value of 'bar'.

So your echo would be echo $a $foo;

I kind of consider variable variables the poor mans array. Most any
solution you think of with variable variables could be better solved by
using arrays.

---John Holmes...

 -Original Message-
 From: Peter [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, June 12, 2002 10:42 PM
 To: Php
 Subject: [PHP] Varible Varibles
 
 howdy,
 I'm just curious here about varible varibles ... I know that you can,
well
 it's documented that you can, do the following
 
 ?
 $a = foo;
 $$a = bar;
 
 echo $a $$a;
 ?
 
 which will produce  foo bar
 
 now what I am curious about is, how much of a difference does that
really
 make when you compare it to..
 
 ?
 $a = foo;
 $a .= bar;
 
 echo $a;
 ?
 
 
 
 
 Cheers
 
 Peter
 the only dumb question is the one that wasn't asked
 
 
 
 --
 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] possible to add a record number to a query?

2002-06-13 Thread John Holmes

You can do it with two queries.

SELECT @a:=0;

SELECT @a:=@a+1, * FROM table;

This would be better taken to a MySQL list, though. Actually, you never
said what DB you were using. This works in MySQL.

---John Holmes...

 -Original Message-
 From: Jeff Field [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 10:01 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] possible to add a record number to a query?
 
 Yes, there is a particular reason.  The actual query I do pulls
 information
 from two tables and has both ORDER BY and GROUP BY clauses.  The
 auto_increment column (think of the query results as a table) will
give
 me
 the rank of the results.  I know how to manipulate the data in PHP
to
 accomplish what I need.  I just thought there might be a way in which
the
 query could do it up front.  Sort of like when you want to know how
many
 times a particular record exists, you can do a COUNT(*).  I just want
the
 results to basically give me a column in the query that lists the
results
 1,
 2, 3, etc.  Make sense?
 
 Thanks for your help!
 
 Jeff
 
  -Original Message-
  From: Jason Wong [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 13, 2002 8:30 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] possible to add a record number to a query?
 
 
  On Thursday 13 June 2002 20:27, Jeff Field wrote:
   I would like to have a column returned in a query that tells you
which
   record I'm looking at?  Sort of like an auto_increment?  IOW, the
 query
   results would look like:
  
   record   first   last
  
 1  johndoe
 2  joe blow
 3  carol   fisher
  
   The table only has first and last, but I want the results to
  add something
   like record to tell me which record it is.  Thanks for any help!
 
  Is there any reason why you need/want to do this? Data are stored
  in a db in
  no particular order. If you want a particular order add an ORDER
  BY clause.
  If you want 'row' numbers then just fudge it in php -- assign a
  row number to
  each record you retrieve from the query.
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.com.hk
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications
Development *
 
  /*
  There's such a thing as too much point on a pencil.
  -- H. Allen Smith, Let the Crabgrass Grow
  */
 
 
  --
  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


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




[PHP] Printer friendly version script

2002-06-13 Thread Angelo Marcos Rigo

Hi 
Anybody knows a good printer friendly version php script
thank´s in advance 

Ângelo Marcos Rigo
Webmaster Colégio Anchieta
http://www.colegioanchieta.g12.br


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




RE: [PHP] possible to add a record number to a query?

2002-06-13 Thread John Holmes

You can use

SET @a=0;

Instead of the first SELECT, too.

---John Holmes...

 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 12:44 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] possible to add a record number to a query?
 
 You can do it with two queries.
 
 SELECT @a:=0;
 
 SELECT @a:=@a+1, * FROM table;
 
 This would be better taken to a MySQL list, though. Actually, you
never
 said what DB you were using. This works in MySQL.
 
 ---John Holmes...
 
  -Original Message-
  From: Jeff Field [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 13, 2002 10:01 AM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP] possible to add a record number to a query?
 
  Yes, there is a particular reason.  The actual query I do pulls
  information
  from two tables and has both ORDER BY and GROUP BY clauses.  The
  auto_increment column (think of the query results as a table) will
 give
  me
  the rank of the results.  I know how to manipulate the data in PHP
 to
  accomplish what I need.  I just thought there might be a way in
which
 the
  query could do it up front.  Sort of like when you want to know how
 many
  times a particular record exists, you can do a COUNT(*).  I just
want
 the
  results to basically give me a column in the query that lists the
 results
  1,
  2, 3, etc.  Make sense?
 
  Thanks for your help!
 
  Jeff
 
   -Original Message-
   From: Jason Wong [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, June 13, 2002 8:30 AM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] possible to add a record number to a query?
  
  
   On Thursday 13 June 2002 20:27, Jeff Field wrote:
I would like to have a column returned in a query that tells you
 which
record I'm looking at?  Sort of like an auto_increment?  IOW,
the
  query
results would look like:
   
record   first   last
   
  1  johndoe
  2  joe blow
  3  carol   fisher
   
The table only has first and last, but I want the results to
   add something
like record to tell me which record it is.  Thanks for any help!
  
   Is there any reason why you need/want to do this? Data are stored
   in a db in
   no particular order. If you want a particular order add an ORDER
   BY clause.
   If you want 'row' numbers then just fudge it in php -- assign a
   row number to
   each record you retrieve from the query.
  
   --
   Jason Wong - Gremlins Associates - www.gremlins.com.hk
   Open Source Software Systems Integrators
   * Web Design  Hosting * Internet  Intranet Applications
 Development *
  
   /*
   There's such a thing as too much point on a pencil.
 -- H. Allen Smith, Let the Crabgrass Grow
   */
  
  
   --
   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
 
 
 --
 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] Newbie problem with POST vars

2002-06-13 Thread Sear, Mick

print_r($_POST); shows all the elements in the array as I expect them to be.
That foreach loop is only picking the first element, though.  At least it's
reassured me that I'm not going mad, though, so thanks for that.

Mick

 I've tried this, but it's still doing the same thing.  Is there something
 special about this particular variable that I need to know?  I've tried it
 with $HTTP_POST_VARS as well, declaring $HTTP_POST_VARS as global in the
 function first.

   Put reset($_POST) before foreach loop

I'm trying to loop through $_POST vars in a function, which I

 understand
   to

be an autoglobal associative array.  Here's the code I'm using:
   
foreach($_POST as $item = $value){
echo $item, $valuebr;
}
   
However, I only get the first element of the array echoed, even

 though I

know there to be other elements (I can access them as

 $_POST[element])


What do you get if you do:

 print_r($_POST);



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
I gave up Smoking, Drinking and Sex.  It was the most 
*__horrifying* 20
minutes of my life!
*/


-- 
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] PHP with No Web Server?

2002-06-13 Thread Brian McGarvie

Would that work?

Surley it'd not be a particularly efficiant webserver if written in PHP?

Would be interesting to try.. I had a quick look for such code but could'nt see any... 
perhaps a PHP-GTK app could work I suppose... if you were that way inclined! :)

 -Original Message-
 From: Stuart Dallas [mailto:[EMAIL PROTECTED]]
 Sent: 13 June 2002 5:09 PM
 To: Kevin Caporaso
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP with No Web Server?
 
 
 On Thursday, June 13, 2002, 5:00:23 PM, you wrote:
  In other words.. Can PHP serve as the Web Server or is 
 another web server
  required to handle the socket connections, etc.?
 
 PHP can serve as a web server, but you would need to write 
 (find) the code to
 do it - I'm sure there is plenty out there. However, to 
 answer the question I
 think you were asking, PHP does not come with a ready-to-run 
 web server.
 
 -- 
 Stuart
 
 
 -- 
 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] Varible Varibles

2002-06-13 Thread Pushkar Pradhan

I'm trying to use variable variables to work on arrays:
$forest = array(a, b, c, ...);

$layer[$l]= forest;

Now I want to access all array members of $forest using $$layer:
e.g.
for($c = 0; $c  $$layer[$l]; $l++) {
   echo $$layer[$l][$c];
}
But this doesn't work, gives syntax error,
So my workaround is:
$new = $$layer[$l];
$new[$c] refers all elements of array $forest
Is this the best workaround or am I missing something?

 I think you're missing the point of variable variables.

 ?
 $a = 'foo';
 $$a = 'bar';

 echo $a $$a;
 ?

 After the first use of $$a, you now have a variable called $foo with a
 value of 'bar'.

 So your echo would be echo $a $foo;

 I kind of consider variable variables the poor mans array. Most any
 solution you think of with variable variables could be better solved by
 using arrays.

 ---John Holmes...

  -Original Message-
  From: Peter [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, June 12, 2002 10:42 PM
  To: Php
  Subject: [PHP] Varible Varibles
 
  howdy,
  I'm just curious here about varible varibles ... I know that you can,
 well
  it's documented that you can, do the following
 
  ?
  $a = foo;
  $$a = bar;
 
  echo $a $$a;
  ?
 
  which will produce  foo bar
 
  now what I am curious about is, how much of a difference does that
 really
  make when you compare it to..
 
  ?
  $a = foo;
  $a .= bar;
 
  echo $a;
  ?
 
 
 
 
  Cheers
 
  Peter
  the only dumb question is the one that wasn't asked
 
 
 
  --
  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


-Pushkar S. Pradhan


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




[PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Jason Soza

Just curious...

If I have a site that stores information about people in a database, 
including e-mail addresses, and that information is only viewable when 
called via a user-specific variable, i.e. their alias, can spambots 
still harvest those e-mail addresses?

So for instance I have a page called 'users.php' and to find the e-mail 
address for John Smith, you'd follow a link that directs you to 
users.php?alias=johnsmith - I guess my main question is, can spambots 
follow those types of links, get the resulting page, and harvest the 
address off that?

Is there any way to combat this? Any PHP scripts, classes, functions 
that can 'hide' e-mail addresses? The site I'll be building needs to 
have the e-mail addresses available, but I don't want to subject users 
to more spam than they probably already get.

Jason Soza


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




Re[2]: [PHP] PHP with No Web Server?

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 5:18:31 PM, you wrote:

 Would that work?

 Surley it'd not be a particularly efficiant webserver if written in PHP?

 Would be interesting to try.. I had a quick look for such code but could'nt see 
any... perhaps a PHP-GTK app could work I suppose... if you were that way inclined! :)

As previously mentioned, there is one: http://nanoweb.si.kz/

-- 
Stuart


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




[PHP] string to array?

2002-06-13 Thread Leston Drake

Hi all,

I have a string something like 10.2.3
I want to be able to use the . as a delimiter to reference the elements 
(10, 2, and 3).
My thought was to create an array, using . as the delimiter.
Is there a function that will create an array out of a string, using a 
delimiter you specify?
I seem to have read something like that, but I can't find it now.

Any other ideas would be welcome.

TIA
--Leston 


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




Re: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Analysis Solutions

On Thu, Jun 13, 2002 at 09:10:35AM -0800, Jason Soza wrote:
 
 users.php?alias=johnsmith - I guess my main question is, can spambots 
 follow those types of links, get the resulting page, and harvest the 
 address off that?

No reason why not.



 Is there any way to combat this? Any PHP scripts, classes, functions 
 that can 'hide' e-mail addresses?

If you don't need the address to be hyperlinkable, you can put the user, 
and domain in different table cells.  Or even put each letter in a
separate cell.  Could even set the border, cellspacing and cellpadding to
0 to make it not look like a table.

While that deterrent isn't insurmountable, I suspect most, if not all,
harvesting programs don't go to that length.

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 6:10:35 PM, you wrote:
 If I have a site that stores information about people in a database,
 including e-mail addresses, and that information is only viewable when 
 called via a user-specific variable, i.e. their alias, can spambots 
 still harvest those e-mail addresses?
snip
 Is there any way to combat this? Any PHP scripts, classes, functions
 that can 'hide' e-mail addresses? The site I'll be building needs to 
 have the e-mail addresses available, but I don't want to subject users 
 to more spam than they probably already get.

Basic fact: If a normal (anonymous) visitor can get at the email addresses, so
can a bot. It all depends on the bot, but there's no getting around that basic
fact.

-- 
Stuart


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




Re: [PHP] string to array?

2002-06-13 Thread Analysis Solutions

On Thu, Jun 13, 2002 at 11:17:50AM -0600, Leston Drake wrote:
 
 I have a string something like 10.2.3
 I want to be able to use the . as a delimiter to reference the elements 
 (10, 2, and 3).

http://www.php.net/manual/en/function.explode.php

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Ashley M. Kirchner

Analysis  Solutions wrote:

 If you don't need the address to be hyperlinkable, you can put the user, @
 and domain in different table cells.  Or even put each letter in a
 separate cell.  Could even set the border, cellspacing and cellpadding to
 0 to make it not look like a table.

Assuming the address does have to be a link people can just click on, is
there any way of preventing spambot from harvesting it?

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




Re: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Jason Soza

So basically, to keep the address away from bots, keep it away from 
normal users. Okay, so something like this would be more effective:

Have a form with a hidden input of the user's alias, and an input of E-
mail me!, that form posts to an email.php script that uses the user's 
alias to pull the e-mail address out of the db and I suppose I could 
use JavaScript to popup a new window to enter the text of the e-mail 
and use mail() to send. Would displaying the e-mail address in that new 
window again be just as bad as displaying it on the main page?

I realize this isn't a new idea, but I'm assuming it's more secure than 
just keeping a mailto:[EMAIL PROTECTED] link around.

Thanks,

Jason Soza

- Original Message -
From: Stuart Dallas [EMAIL PROTECTED]
Date: Thursday, June 13, 2002 9:23 am
Subject: Re: [PHP] Spam Bots/E-mail Addys

 Basic fact: If a normal (anonymous) visitor can get at the email 
 addresses, so
 can a bot. It all depends on the bot, but there's no getting 
 around that basic
 fact.
 
 -- 
 Stuart



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




Re[2]: [PHP] Spam Bots/E-mail Addys

2002-06-13 Thread Stuart Dallas

On Thursday, June 13, 2002 at 6:24:17 PM, you wrote:
 Analysis  Solutions wrote:
 If you don't need the address to be hyperlinkable, you can put the user, 
 and domain in different table cells.  Or even put each letter in a
 separate cell.  Could even set the border, cellspacing and cellpadding to
 0 to make it not look like a table.
 Assuming the address does have to be a link people can just click on, is
 there any way of preventing spambot from harvesting it?

You can create a javascript function that takes the place of the link and
builds the mailto: link at runtime. Google should be able to point you in the
right direction.

-- 
Stuart


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




Re: [PHP] Varible Varibles

2002-06-13 Thread Jason Wong

On Friday 14 June 2002 00:38, John Holmes wrote:
 I think you're missing the point of variable variables.

Quite :-)

 I kind of consider variable variables the poor mans array. Most any
 solution you think of with variable variables could be better solved by
 using arrays.

Actually variable variables are extremely powerful in the cases where they 
_really_ are needed. However some people mistakenly use variable variables 
when they really should be using arrays.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If I can have honesty, it's easier to overlook mistakes.
-- Kirk, Space Seed, stardate 3141.9
*/


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




  1   2   3   >