Re: [PHP] Call-time pass by reference has deprecated

2001-05-10 Thread Aaron Tuller

ummm, not to be insensitive but that error told you everything you 
want to know.

passing by reference at call time is putting an  in front of a 
variable.  if you want to make it work, either modify your script to 
not need call time pass by reference (you can change the function 
declaration to force a pass by reference) or you can simply (and I'm 
just cutting and pasting here from your message):

If you would like to enable call-time pass-by-reference, you can set 
allow_call_time_pass_reference to true in your INI file

by INI file it means the php.ini file.  you can find where this file 
is in phpinfo()

-aaron

At 2:04 AM +0100 5/11/01, Mr. Adam ALLEN. wrote:
I have just recevied the following error, on version 4.0.3pl1. ( Linux
sustain5.cobalt.com )

I have not seen the error while running the same script on version 4.05
(Win32), 4.0RC1, R.0PL1 or 3.0.14

I'm not sure what the error is trying to tell me, or how to fix it (or make
the error go away)

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of [runtime function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer. in
/home/sites/site91/web/globalc.lib on line 767

I've enclosed a snip of the file and indicated line 767
function
getstats($server,$user,$password,$apop,$cntmessg,$from,$subject,$date)
  {
   $pop3_connection=new pop3_class;
   $pop3_connection-hostname=$server;
   if(($error=$pop3_connection-Open())==)
   {
if(($error=$pop3_connection-Login($user,$password,$apop))==)
{
 this next line is 767
  if(($error=$pop3_connection-Statistics($messages,$size))==)


$cntmessg =$messages;
for($i=1;$i=$messages;$i++)
 {

if(($error=$pop3_connection-RetrieveMessage($i,$headers,$body,-1))==)
  {
for($line=0;$linecount($headers);$line++)
{
 $line_data=strstr($headers[$line],:);
 $line_data=substr($line_data,1,strlen($line_data));

$line_key=substr($headers[$line],0,(strlen($headers[$line])-strlen($line_dat
a))-1);
 $line_key=trim(strtoupper($line_key));
 if($line_key==FROM)
  {
 $from[$i]=trim($line_data);
  }

 if($line_key==SUBJECT)
  {
 $subject[$i]=trim($line_data);
  }
 if($line_key==DATE)
 {
   $line_data=explode(,,$line_data);
 $tmp_data=explode( ,trim($line_data[1]));
   unset($tmp_data[count($tmp_data)-1]);
   $date[$i]=implode(-,$tmp_data);
 }
 }
   }
  else
  {
 return 0;
  }
}
  }
  else
  {
return 0;
  }
}
else
{
  return 0;
}
  }
  else
   {
return 0;
   }

  $pop3_connection-Close();
  return 1;
}


Yours
Mr. Adam ALLEN.
[EMAIL PROTECTED]
http://www.dynamicinteraction.co.uk



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


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




Re: [PHP] PHP 4.0.5 is out (output compression)

2001-04-30 Thread Aaron Tuller

At 12:12 AM +0300 5/1/01, Zeev Suraski wrote:
- Implemented high-performance zlib-based output compression - see
   zlib.output_compression INI directive. (Zeev)

is this different from ob_gzhandler()?  if so, how is it different?  thanks.

-aaron

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




Re: [PHP] Global variables

2001-04-18 Thread Aaron Tuller

At 1:16 AM + 4/19/01, Philip Olson wrote:
   pre
 ?php var_dump($GLOBALS) ?
   /pre

don't do that, at least I think it will recursively traverse the 
$GLOBALS arrary (since $GLOBALS itself is $GLOBAL) and you will never 
end.

-aaron

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




Re: [PHP] doubt in ob_*() functions

2001-04-05 Thread Aaron Tuller

umm, no, you assigned $string to the output and you flushed it and 
you echoed $string.  maybe you mean ob_end_clean()?

-aaron

At 12:22 AM -0300 4/6/01, Christian Dechery wrote:
take a look at this small code:

ob_start();
echo "somethingbr";
echo "something elsebr";
$string=ob_get_contents();
ob_end_flush();

echo $string."br";

shouldn't this be the output?

something
something else

so why it outputs this?

something
something else
something
something else

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


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


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




Re: [PHP] URL parsing

2001-03-25 Thread Aaron Tuller

why can't you str_replace the $QUERY_STRING frm the $REQUEST_URI?

give an example of what you are trying to do?  (I'm sorry if you did 
and I missed it)

-aaron

At 9:06 PM -0500 3/25/01, Jaxon wrote:
K, read em all, and understood more than I thought I :)


I still don't see how you can 'sanitize' a URI, eg discard anything
including and after "//" or "??".  I think this is needed if you want to
discard a query string or irregular syntax from your URI.

ereg's don't work reliably, due to the possibility of special chars in the
URI.

regards,
jaxon

On 3/25/01 3:18 PM, "Philip Olson" [EMAIL PROTECTED] wrote:

  Hi!

  Check out these two related articles (and user comments) :

  Building Dynamic Pages With Search Engines in Mind :
  
* http://phpbuilder.com/columns/tim19990117.php3
* http://phpbuilder.com/columns/tim2526.php3

  Also check phpinfo() for available predefined variables and plan
  accordingly.

  Predefined Variables   :
  
* http://www.php.net/manual/en/language.variables.predefined.php

  And for the brave, check out mod_rewrite :

  Mod-Rewrite:
  
* http://httpd.apache.org/docs/mod/mod_rewrite.html
* http://www.engelschall.com/pw/apache/rewriteguide/
* http://marc.theaimsgroup.com/?l=php-generals=mod_rewrite


  Regards,

  Philip Olson
  http://www.cornado.com/




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


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




Re: [PHP] indirectly call function?

2001-03-24 Thread Aaron Tuller

$module = "mod_news";

echo $module();

i think that's it.

or:

$module = "mod_news()";

eval("echo ".$module);

I think the former is faster.

-aaron

At 7:16 PM -0500 3/24/01, Jaxon wrote:
hi all, I'm trying to change which function is called at runtime:

e.g.
page1.php:

include "functions_def.inc.php"; //contains definition for mod_news()
$module = "mod_news()"; //for example - gets assigned by case statement
include page2.inc.php


page2.inc.php:

?php echo $module; ?


the page shows "mod_news()" instead of calling my function :(
It works if I use ?php echo mod_news(); ? but not if I'm trying to hold
the function name in the variable.

I've tried
?php echo $module; ?
?php eval $module; ?
?php print $module; ?

all to no avail.

any ideas?

tks!
jaxon



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


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




Re: [PHP] Shopping Carts and Sessions

2001-03-16 Thread Aaron Tuller

or you can use Apache to ForceType bar to use PHP.

then just write a generic URL parsing script and you're done.

if you want it for all of your URL's, make DocumentRoot a PHP script. 
you might tricky problems with images and other non-script files, but 
that's ok because you can just check for the file extensions, echo he 
mie tpye and readfile() it.

-aaron

At 1:15 PM -0500 3/16/01, [EMAIL PROTECTED] wrote:
In a message dated 3/16/01 9:39:16 AM Eastern Standard Time,
[EMAIL PROTECTED] writes:


  I thought Search engines couldnt spyder dynamic pages such as
  "1.php?foo=bar"


True - but with the magic of Apache's mod_rewrite -- you can make a URL
appear to a browser as: http://www.yourdomain.com/bar -- but on your server,
it can be rewritten as: http://www.yourdomain.com/1.php?foo=bar.

mod_rewrite is extremely cool. you can read more about it at:
http://httpd.apache.org/docs/mod/mod_rewrite.html

don


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




Re: [PHP] Can CONSTANT's be made persistent?

2001-03-16 Thread Aaron Tuller

put your defines in an include that all your pages include.

-aaron

At 2:28 PM -0700 3/16/01, Johnson, Kirk wrote:
Can a defined()'d CONSTANT be made persistent between pages? According to my
experiments, the answer is "no". Am I missing something?

TIA

Kirk

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


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




Re: [PHP] Dynamic pages

2001-03-15 Thread Aaron Tuller

you don't have to use fwrite() if you use output buffering.

just ob_start(), ob_get_contents(), and ob_end_clean()

and leave your code how it is.

-aaron

At 1:02 AM -0600 3/16/01, Richard Lynch wrote:
You can use PHP to write out the HTML to a file, instead of using
echo/print.

You'll have to fwrite() *ALL* your HTML, however.

I did this for a site that got burned into a CD once.

There are also some tools "out there" to "walk" a site and "steal" it, that
you could use on your "work" site to snag all the HTML output.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Jason Mockler [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Tuesday, March 13, 2001 7:45 AM
Subject: [PHP] Dynamic pages


  I have some dynamic pages which pull
  content from a DB using a PHP function.

  I have just found out that the production server
  for the project won't allow MySQL/PHP.

  The editors will need to use the input tool
  on a test server and then FTP to the
  production server.

  What I need to know is how do I save each
  page as static HTML when the page update has
  taken place (html is in DB)

  Code in each page(body text) is:

  ?
   require("lib/dbconnect.html");
   dbConnect();

   require("lib/echocontent.html");;
   echoContent(1);
  ?

  Thanks in advance,

  JM

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



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


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




[PHP] my page is in the error log

2001-03-14 Thread Aaron Tuller

anyone run into this?

I was checking my error log and the entire post-PHP contents of a 
page was in my error log.  I checked the access log and the page was 
requested but the client got back 0 bytes.  very strange.

It looks like it happened a few times.

I'm using Apache 1.3.14 on RH 7.0 with PHP 4.0.4pl1.

any ideas?

thanks.

-aaron

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




Re: [PHP] Cache Database-driven site

2001-03-12 Thread Aaron Tuller

At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
To create the HTML-cache page i need to build the whole HTML-page content in
memory, instead of echoing it back to the user's browser, and finally write
it to disk. That means, i have to write all HTML in php-code. I can't just
embed php-parts in html tags.

that's not true.  see the output buffering functions.

-aaron

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




Re: [PHP] payment

2001-03-12 Thread Aaron Tuller

At 2:32 PM -0800 3/12/01, Mark Maggelet wrote:
I'm leaning towards verisign/payflow pro. has anyone had trouble with
these guys?

no.  it's good stuff.  Verisign is not going out of business anytime 
soon.  and it's flat rate.  you can't beat it.

-aaron

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




Re: AW: [PHP] Cache Database-driven site

2001-03-12 Thread Aaron Tuller

all you need to do is wrap your pages in:

ob_start();

// your code

$page = ob_get_contents();

// write $page to a file or whatever you want to do

and then depending on if this script is being called by cron or just 
when people load the page you can either do an ob_end_flush() or 
ob_end_clean()

it's easy.

At first I didn't beleive output buffering was that cool, now I thnk 
it's one of the best things PHP has to offer.  You can use it for a 
lot of things, check it out.

-aaron

At 12:40 AM +0100 3/13/01, Joe Maier wrote:
Aaron,
i would love to believe what you say.
But i couldn't find any buffering functions in the online docs.

Could you please gimme a pointer on where i can find these functions
and what's their name. Are they available in php3?

Thanks a lot,
Joe

-Ursprungliche Nachricht-
Von: Aaron Tuller [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 12. Marz 2001 23:26
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re: [PHP] Cache Database-driven site


At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
To create the HTML-cache page i need to build the whole HTML-page content
in
memory, instead of echoing it back to the user's browser, and finally write
it to disk. That means, i have to write all HTML in php-code. I can't just
embed php-parts in html tags.

that's not true.  see the output buffering functions.

-aaron

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


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




Re: [PHP] file upload tutorial.

2001-03-09 Thread Aaron Tuller

does anyone look at the manual anymore?

there's TONS of info at:

http://www.php.net/manual/en/features.file-upload.php

-aaron

At 1:10 PM -0800 3/9/01, Jerry Lake wrote:
Anyone know where I can find a file upload
tutorial ?

Jerry Lake- [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online- http://www.pacifier.com



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


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




Re: [PHP] conjecate a variable to a string in a function

2001-03-09 Thread Aaron Tuller

At 1:42 PM -0500 3/9/01, Mike wrote:
Whats wrong with this?
$MaxID="select Max($Table.'ID') from $Table";

I assume you want to do:

$MaxID="select Max($TableID) from $Table";

as long as you don't have a variable called $TableID that is.  if you 
do then do:


$MaxID="select Max(".$Table."ID) from $Table";

the . operator for concat only works when you're not in a stting 
variable.  for example:

$var = "Hello ".$user;

you could also just do:

$var = "Hello $user";

PHP is smart enough to notice variables in strings.  but periods in 
strings are just periods.

-aaron

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




Re: [PHP] payment

2001-03-09 Thread Aaron Tuller

I use Virisign PayFlow Pro and it's so easy.  ust the built in 
functions or just call parse_str() on the output and you're set.

-aaron

At 5:27 PM -0500 3/9/01, Rick St Jean wrote:
How to people typically integrate payment processors with PHP?
And what processors are used most often?  I know that a number
of people are scrambling after cybercash died.  There is a site out
there www.opay.com that says it supports payment processors
on any platform, anyone ever use it?

Rick
##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


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


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




Re: [PHP] payment

2001-03-09 Thread Aaron Tuller

Umm, I'm not sure what you mean.  You do need a an acquiring bank, we 
use Wells Fargo, they're pretty cheap, and knowledgeable about the 
internet.

PayFlow supports any bank that uses FDMS Nashville plus others.

http://biz.wellsfargo.com/products/merchant/internet/internet.jhtml

if you want sample PayFlow code, just ask, or use the built in functions.

-aaron

At 5:45 PM -0500 3/9/01, Rick St Jean wrote:
It says it is not a gateway but a method between code and the 
processor. One piece of code is supposed to
work for 150 payment processors.  If you need a new processor then 
you buy some driver from them.


At 02:28 PM 3/9/01 -0800, Aaron Tuller wrote:
I use Virisign PayFlow Pro and it's so easy.  ust the built in 
functions or just call parse_str() on the output and you're set.

-aaron

At 5:27 PM -0500 3/9/01, Rick St Jean wrote:
How to people typically integrate payment processors with PHP?
And what processors are used most often?  I know that a number
of people are scrambling after cybercash died.  There is a site out
there www.opay.com that says it supports payment processors
on any platform, anyone ever use it?

Rick
##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


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

##
#  Rick St Jean,
#  [EMAIL PROTECTED]
#  President of Design Shark,
#  http://www.designshark.com/
#  Quick Contact:  http://www.designshark.com/messaging.ihtml
#  Tel: 905-684-2952
##


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


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




Re: [PHP] How to protect my scripts ???

2001-03-09 Thread Aaron Tuller

use Zend Encoder.

-aaron

At 8:51 PM -0300 3/9/01, Marco Aurlio wrote:
Hello!


My case:

My users have ftp access to their directories, then if I put my scripts
inside it, they will br able to stole!

Is possible to use directory alias and forcetype on Apache to protect my
scripts or which's the better solution for it, any ideas ???


Regards,

marcoBR


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


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




Re: [PHP] payment

2001-03-09 Thread Aaron Tuller

At 12:27 AM -0600 3/10/01, Jeffrey Greer wrote:
With paypal's business account there are no credit checks and the rate
is 2.2% for cc payments.

except you can't really integrate it into your web site.  who knows 
how long paypal will be around.  it shoes up as paypal on people's 
credit card statements, that's not very proffesional.  you can't do 
recurrent billing.  you are forcing your customer to give their info 
to a third party.

there's no time delay between the authorization of a card and the 
capture of the funds which means you need to ship the product right 
away, which sometimes, is impossible.

paypal might be good for ebay.  it's not good for e-commerce sites. 
I don't think so anyway.

-aaron

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




Re: [PHP] newbie: ye ol' nemesis using mysql_fetch_array to loaddata

2001-03-08 Thread Aaron Tuller

At 3:37 PM -0800 3/8/01, Nicole Lallande wrote:
$len = mysql_num_rows($result);
for ($i=0; $i=$len; $i++) {
   echo "option value=\"$catid[$i]\"$catid/option";
}

I believe your problem is in that code becuase it's ambiguous and 
because $catid is an array and you're treating it as a regular 
variable.

what you should do is something like:

while ($row = mysql_fetch_array($result)) {
  $rowid[] = $row["dnaProd_ID"];
  $catid[] = $row["Cat_ID"];
  $desc[] = $row["Description"];
  $size[] = $row["Pkg_size"];
  $price[] = $row["Price"];
}

for($i = 0; $i  sizeof($catid); $i++)
{
$cat = $catid[$i];
echo "option value=\"$cat\"$cat/option";
}

or you could build this up during your first loop:

$optionValues = "";
while ($row = mysql_fetch_array($result)) {

$cat = $row["Cat_ID"];

$optionValues .= "option value=\"$cat\"$cat/option\n";
}

then just echo $optionValues whenever you want.

OR

you can create a generic function you can use anytime you want to 
make an option list, just pass in an array of options:

GenerateOptionValues($optionArr)
{
$string = "";
foreach($optionArr as $option}
{
$string .= "option value=\"$option\"$option/option\n";
}

return $string;
}

or if you need different values from the options, pass in an 
associateive array:

GenerateOptionValues($optionArr)
{
$string = "";
foreach($optionArr as $option = $value}
{
$string .= "option value=\"$value\"$option/option\n";
}

return $string;
}

alright, sorry for going on and on.

-aaron

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




Re: [PHP] Error codes from 'mysql_error()'

2001-03-08 Thread Aaron Tuller

mysql_query($sql) or die("there was an error: ".mysql_error());

-aaron

At 3:16 PM -0800 3/8/01, Dennis Gearon wrote:
I do an insert using phpadmin, and i get back the error message (or
maybe it's a warning?) The insert is of a duplicate on a unique field. I
expected an error, but when I do mysql_error() or mysql_errno(), nothing
comes back(and I do it the next line in the script). the
'mysql_query($sql, $link)' function DOES insert when the value is
unique, DOES return false, but I'd like to inform the user what the
error was. PHP Admin can get the 'error' why can't I?

Please reply to me as well, OK? I'm trying to finish this script at work
today.
[EMAIL PROTECTED]

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


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




Re: [PHP] (URL Translating) Apache, PHP, and the love of itall.... well, maybe not.

2001-03-03 Thread Aaron Tuller

that's easy.

don't redirect, just do an include() on the PHP file you actually 
want, or if you're using some fancy caching system and alrady have 
the output in a file, do a readfile().

then use Apache's ForceType.

I think it's like:

Location /news
ForceType application/x-httpd-php
/Location

something like that.

then make a file called "news" in the DocumentRoot directory that's like:

$path_array = explode('/', $REQUEST_URI);
$numPathElements = count($path_array);

then loop through the elements and do what you need, you might need 
to use strtok() if you're expecting slashes in your arguments.

put the name of the script in a var, either do a regex or parse_str() 
on the rest of the URI to set the vars you need (like aid=3911)

and then do a include() with the script name.

the URL will never change in the browser, it's one request, and you 
can make a very generic URL parsing script to make your URLs pretty. 
you can set DocumentRoot to this script and then you can have URLs 
like:

http://www.myserver.com/index.html

where actually your script is doing the work.  maybe it includes a 
file called index.html and adds ads on the top or something.  and 
with output buffering you can get even more power, i use output 
buffering to change all my image tags on the fly to a different 
server, but for the people who write the HTML code, they don't need 
to care about it.  PHP is good stuff.

ask if you need more help.

-aaron

At 9:13 AM +1300 3/4/01, Jenni /or Patrick wrote:
I'm going to start with a nice simple, hopefully, questions.

Some of you may have seen PCWorld.com - and its urls that are like
http://www.pcworld.com/news/view/0,aid,3911,00.asp. This is achieved with a
product called XCache (for IIS, visit www.xcache.com), wich translates this
url into http://www.pcworld.com/news/view.asp?aid=3911.

Now, you can probably do this in regex, and use the mod_rewrite, but this is
not available to me, so we can all forget that one right away ;-).

I have created a 404-processor that does the conversion (and even checks if
the resultant page exsists, by using a simple file_exists();).

Apache (or was it PHP? Or a combination of the above?) used to, when you
said Header ("Location: /localpath"), just serve up the content, without
doing a redirect. Under Apache/1.3.17  PHP/4.0.4 this does not happen.

Is there a way to do this redirect internally - ie. the browser is not even
aware that the URL is different from the one it requested, let alone the
visitor.

And no, frames are not really an option: because it would defeat one of the
reasons I want  to do this internally, which is to prevent the need to do
two requests.

Hopefully someone will understand this (I'm sure there will be many), and be
able to guide towards something that will work.

Thanks,
Patrick.


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


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




Re: [PHP] Class methods in PHP

2001-02-24 Thread Aaron Tuller

that's not true.

you can call a static method with the "::" notation.

like ClassName::method();

there's doesn't need to be an instance to do that.

not sure if that's true for all of PHP4 or just 4.04 or whatnot.

-aaron

At 11:56 AM -0500 2/24/01, Kevin Beckford wrote:
Well I meant class functions that do not need an object to be declared...
but don't worry about it - I found out. There are none in php.

- Original Message - From: "Christian Reiniger" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]out
Sent: Saturday, February 24, 2001 11:49 AM
Subject: Re: [PHP] Class methods in PHP


: On Saturday 24 February 2001 17:05, Kevin Beckford wrote:
:  Is there class methods in php?
:
: Well, there are classes, classes can have methods, there are methods to
: handle classes, methods to inspect methods, methods to inspect classes
: and propably more.
:
: I have no idea what you mean with your question, but I hope that some
: part of the above answers it...
:
: --
: Christian Reiniger
: LGDC Webmaster (http://sunsite.dk/lgdc/)
:
: "The number of Unix installations has grown to 10, with more expected."
:  -- The Unix Programmer's Manual, 2nd Edition, June 1972
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
: To contact the list administrators, e-mail: [EMAIL PROTECTED]



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


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




Re: [PHP] Files only available via HTTPS

2001-02-08 Thread Aaron Tuller

HTTPS is set to "on", at least on my Apache when SSL is enabled. 
it's undefined when it's not.

this is what I would do (untested code below):

function UsingHTTPS()
{
$HTTPS = getenv("HTTPS");

return ($HTTPS == "on");
}

function UsingHTTP() // might be useful?
{
return !UsingHTTPS();
}


function ChangeTransport($transport)
{
$vars = array("REQUEST_URI", "SERVER_NAME");

foreach ($vars as $var)
{
$$var = getenv("$var");
}

$newURL = "Location: $transport://".$SERVER_NAME.$REQUEST_URI;
header($newURL);
exit();
}

and then do a:

if (!UsingHTTPS())
{
ChangeTansport("https");
}

-aaron

At 4:29 PM -0800 2/1/01, Michael Conley wrote:
I have several PHP files that I only want users to be able to access via
HTTPS.  How can I control that on an Apache 1.3.14 server running on RedHat
7?  I have openssl and mod_ssl working fine.  Currently, I can access all of
the files on my site via either http or https.  I want to keep certain files
(with interesting information) from being accessed via http.  I realize this
isn't really a PHP question, but I have no idea how to do this.

Thanks.

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


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




Re: [PHP] parent constructor

2001-02-07 Thread Aaron Tuller

At 12:13 PM +0100 2/7/01, Christian Reiniger wrote:
On Wednesday 07 February 2001 05:14, Aaron Tuller wrote:
   $parentClass = get_parent_class($this);
  eval("$parentClass::$parentClass();");

  still, I think I should be able to do what I wrote below.

Um, you know the name of your parent class, so why do you use
get_parent_class() at all?

so that way I can have a general purpose way of calling a parent 
constructor like "super()" or whatever. It seems silly to hardcode 
the name of my parent class into the code of the class besides in the 
"extends" part in the definition.  that way if I change the 
hierarchy, I don't have to worry about changing the constructor, it 
just always points to the parent.

sorry if that isn't clear.

-aaron

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




[PHP] parent constructor

2001-02-06 Thread Aaron Tuller

why doesn't this work?

$parentClass = get_parent_class($this);
parent::{$parentClass}();

I get a parse error.  can I not use variable functions with the "::" syntax?

I tried eval() and it loses the context.

thanks for the help!

-aaron

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




Re: [PHP] parent constructor

2001-02-06 Thread Aaron Tuller

ok, I == dumb.  this works:

$parentClass = get_parent_class($this);
eval("$parentClass::$parentClass();");

still, I think I should be able to do what I wrote below.

-aaron

At 8:05 PM -0800 2/6/01, Aaron Tuller wrote:
why doesn't this work?

$parentClass = get_parent_class($this);
parent::{$parentClass}();

I get a parse error.  can I not use variable functions with the "::" syntax?

I tried eval() and it loses the context.

thanks for the help!

-aaron

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


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