Re: [PHP] Email Body

2003-10-29 Thread micro brew
Marek,

Thanks for the tip.  str_pad() worked like a charm. 
I've never had a text email look so nice.  Thanks
again.  :)

Mike

--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> I use str_pad() for this, it can handle strings that
> vary in length much 
> better then tabs:
> 
> tab way:
> echo "long long name\t1000\t200.00\n";
> echo "name\t10\t2.00\n";
> 
> output:
> long long name1000200.00
> name  10  2.00
> 
> str_pad way:
> echo str_pad('long long name', 20,' ').
>   str_pad('1000', 10,' ',STR_PAD_LEFT).
>   str_pad('200.00', 10,' ',STR_PAD_LEFT).
>   "\n";
> echo str_pad('name', 20,' ').
>   str_pad('10', 10,' ',STR_PAD_LEFT).
>   str_pad('2.00', 10,' ',STR_PAD_LEFT).
>   "\n";
> 
> output:
> long long name1000200.00
> name10  2.00
> 
> Marek
> 
> micro brew wrote:
> 
> > I am sending an email using mail() and it works
> fine. 
> > But the formatting of the body of the email is
> wrong. 
> > I want to format part of it in columns sort of
> like
> > this:
> > Name   Quantity  Price
> > 
> > Can this be done neatly without using an html
> email?
> > 
> > Also what is the trick to making line returns
> display
> > properly in the email client?  I've tried using
> \r\n
> > with no luck.  I also tried \n.  The characters
> show
> > in the email but no line breaks.  Any suggestions?
> > 
> > TIA,
> > 
> > Mike
> > 
> > __
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product
> search
> > http://shopping.yahoo.com
> > 
> 


__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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



Re: [PHP] Copying an uploaded file...

2003-10-29 Thread John Nichel
René Fournier wrote:
I've added a path, but still no success
Does your webserver (Apache?) have write permission to the directory 
you're trying to move the file too?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Object Undefinded index

2003-10-29 Thread Al
> I am just learning to use objects. I am messing around with a shopping
cart
> object, but am having confusing problems. I am getting an undefined index
> error when trying to assign a key value pair to an array variable within
an
> object. I am confused becuase I believe this is how you assign array
> variables outside an object. It acts like the variable is undefined.
Thanks
> for the help.

My last post didn't actually address the error you mentioned though, so I
might as well do that now... :)

>From your example, the warning you received is cause by the add_item( )
method because it's attempting to add 1 to the value of $cart->items['10'].
The only problem is that $cart->items['10'] hasn't been defined yet.

Now PHP is smart enough to realise that if $cart->items['10'] doesn't exist,
it should simply create the key and assign it a blank value (i.e. 0) and
*then* add 1. So any subsequent calls to $cart->add_item("10", 1) won't
generate an warning.

It's also important to note that you only received a warning, not an error,
and that code finished executing properly. You only received the warning
because you had rerror reporting set to strict, which is normally a very
good idea to help keep your code clean and bug free. The reason the code
didn't work as expected was because of the bug addressed in my last post.

To code the add_item( ) method in a way that won't trigger this warning, you
can change it to:

function add_item ($product_id, $quantity = 1)
{
if (!isset($this->items[$product_id]))
{
$this->items[$product_id] = 0;
}
$this->items[$product_id] += $quantity;
}

You can see that the code checks to see if the the key exists, and if it
doesn't sets it to 0, before attempting to add to it's value. This is
essentially replicating what PHP was doing anyway.

Cheers,

Al

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



[PHP] Re: Object Undefinded index

2003-10-29 Thread Al
> foreach ($cart as $product_id => $quantity)
> {
> echo $product_id . "" . $quantity;
> }

The way you are accessing the array is incorrect. The $items array is a
property of the Cart object. Since the Cart object may have many different
array properties, the foreach statement above has to be sepcific about which
array you want to iterate through.

So the correct code would be:

foreach ($cart->items as $product_id => $quantity)
{
echo $product_id . "" . $quantity;
}

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



Re: [PHP] Undefined Index - is this how you "declare" get & post?

2003-10-29 Thread John W. Holmes
Terence wrote:

Since I started using error_reporting(E_ALL), I havent found (in my opinion)
a good way to declare GET and POST variables when getting them from a form
or querystring. I have searched google and the docs for several hours now
without much luck.

if ($HTTP_GET_VARS["i"] == "") {
 include("myfile.php");
}
?>
Is there a better way?
I have tried var $i (only for classes I've discovered)
settype($i, "integer")
Thanks in advance.

isset() is your friend.

if(isset($HTTP_GET_VARS['i']) && $HTTP_GET_VARS['i'] == '')
{ include('myfile.php'); }
This will not trigger any warning, even under E_ALL.

In response to some of the other posts, developing at E_ALL is a good 
idea as it'll help you spot potential problem areas.

Also, even though you have a form element defined, it may not always 
appear in $HTTP_GET_VARS/$_GET (post, etc). One example are checkboxes. 
If no boxes are checked, the variable is never created and this is the 
way to check.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
I've added a path, but still no success

On Wednesday, October 29, 2003, at 05:11 PM, John Nichel wrote:

René Fournier wrote:
Thanks John. I've simplified and improved the quote per your   
suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is  
the  code:
 // MOVE FILE
 if   
(move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile' 
][ 'name'])) {
 echo "Success!";
 } else {
 echo "NO!!!";
 }
 Here are the results:
Give it a path for the file to be moved too...

if(move_uploaded_file($_FILES['userfile']['tmp_name'],  
"/path/to/save/" . $_FILES['userfile']['name'])) {

 NO!!!
 Array ( [img_photo] => Array ( [name] =>   
apache_pb.gif [type] => image/gif [tmp_name]  
=>  /var/tmp/phpvnTFqr [error] => 0 [size] =>  
2326  )  )
Should the tmp directory maybe be set elsewhere? (If so, how can that  
 be done? I've looked at the httpd.conf file, but there is no entry  
for  upload tmp directory.)
Many thanks in advance.
...Rene
--
By-Tor.com
It's all about the Rush
http://www.by-tor.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


[PHP] Tristan Pretty is out of the office.

2003-10-29 Thread Tristan . Pretty




I will be out of the office starting  23/10/2003 and will not return until
11/11/2003.

I will respond to your message when I return.
Please contact Fiona or Alan for any issues.



*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



Re: [PHP] Echo issue RESOLVED!

2003-10-29 Thread David Otton
On Thu, 30 Oct 2003 10:00:51 +1100, you wrote:

>> I would be very interested in learning more about this issue. Would you happen
>> to be able to provide an example HTTP transaction that Safari mishandles?
>
>If you use a 'proper' html file it works OK. If you simply create a text
>file (with .html extension) with less than 16 characters it returns nothing.

Hmm. If it's not too much trouble, could we see a copy of the HTTP
transaction for the PHP file, and the equivalent HTML file?

(eg "echo ("abc")" against "abc")

I'm wondering if there are different or missing headers on the PHP file that
are giving the Safari browser headaches.

>

Um. Why is your post full of Euros?

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



[PHP] Trying to craft a regexp

2003-10-29 Thread Manuel Vázquez Acosta
Hi all:

I'm trying to find every simple mail address in an HTML that is not inside
an A tag.

I have tried this regexp:
(?)

But its not working as I expect cause the only address in my tested HTML is:

mailto:[EMAIL PROTECTED] class="link-home">My address



Any tips?
Manu.

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



Re: [PHP] php: file upload program limitation..

2003-10-29 Thread Justin French
On Thursday, October 30, 2003, at 01:40  PM, Louie Miranda wrote:

Im made a file upload program. I limit my php.ini to accept only 5mb 
but i
told on my website that it is 2mb only. Now here's my problem.

I only upload a 1.5mb and a 1.7mb file when ever i submit it the 
browser
displays

"the page cannot be displayed" but when ever i upload a file lower 
than 1mb
it uploads it.

Where the problem anyway?
there are a few factors... more than likely it's the maximum execution 
time of either PHP (set in php.ini) or perhaps apache.

See these three directives in php.ini:

max_execution_time = 30
max_input_time = 60
memory_limit = 8M
and this one you've already played with:

post_max_size = 8M

Obviously, for you to upload a 5 meg file over to a server is going to 
take more than 30 seconds, and may *possibly* consume more than 8M of 
memory (not sure there), so these settings need to be carefully 
modified to suit your needs.

Justin French

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


Re: [PHP] SESSIONMANAGEMENT -- gute php mailing list / gute leute

2003-10-29 Thread Jonathan Villa
Wenn Sie nicht Plätzchen benutzen möchten, können Sie es in die Frage
Zeichenkette mit einschließen... Das PHP Handbuch gibt Beispiele von
diesem... zum Beispiel, PHPSESSID/SID etwas wie das. Ideal was Sie tun
möchten, soll diese alle möglichen Formdaten oder -verbindungen in Ihrer
Anwendung voranstellen < Eingang type="hidden "name="PHPSESSID" Wert =
"" > oder < ein href="page.php?PHPSESSID=$PHPSESSID"> oder etwas mögen
das...

On Tue, 2003-10-28 at 14:16, christoph lockingen wrote:
> Hallo !
> 
> Ich bin auf der Suche nach einer guten PHP Mailing-Liste, am besten in
> Deutsch...Falls ich hier falsch bin, bitte ich um Entschuldigung.
> 
> 
> Problem:
> 
> SESSION-MANAGEMENT
> 
> Achtung!
> !! session.use_cookies=0 !! (und sollen es auch bleiben)
> 
> 1. Wieso kann ich nicht per $_GET['lid'] auf
>$_POST['lid']=lf_session_id();
>zugreifen? (Danach ist ein Header("Location"... drin -> der
> überschreibt?)
> 
> 2. Wie bekomme ich ein vernünftiges Sessionmanagement OHNE COOKIES hin?
> Eingesetzt wird PHP 4.2.2. Bei dieser PHP-Version funktioniert das nicht,
> wie beschrieben. Bug? (scheint so, schonmal nach gegoogled)
> session_start();
> liefert immer neue werte... es wird keine session übernommen.
> 
> 3. Probiert habe ich bereits auch eine CLASS zu schaffen, diese ist jedoch
> nicht global erreichbar (nach Redirect)
> 
> 
> 
> Ich bin für jeden Tipp dankbar, der mich weniger verzweifeln läßt.
> 
> 
> Tausend Dank !
> 
> 
> Christoph Lockingen

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



[PHP] Object Undefinded index

2003-10-29 Thread Steve Turner
I am just learning to use objects. I am messing around with a shopping cart
object, but am having confusing problems. I am getting an undefined index
error when trying to assign a key value pair to an array variable within an
object. I am confused becuase I believe this is how you assign array
variables outside an object. It acts like the variable is undefined. Thanks
for the help.

Steve Turner

//--
class Cart
{
var $items;  // Items in shopping cart

// Add $quantity articles of $product_id to the cart

function add_item ($product_id, $quantity = 1)
{
$this->items[$product_id] += $quantity;
}

// Take $quantity articles of $product_id out of the cart

function remove_item ($product_id, $quantity)
{
if ($this->items[$product_id] > $quantity)
  {
$this->items[$product_id] -= $quantity;
return true;
}
  else
  {
return false;
}
}
}

//I am interacting with the object with the following code
$cart = new Cart;
$cart->add_item("10", 1);

foreach ($cart as $product_id => $quantity)
{
echo $product_id . "" . $quantity;
}

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



[PHP] php: file upload program limitation..

2003-10-29 Thread Louie Miranda
Hello,

Im made a file upload program. I limit my php.ini to accept only 5mb but i
told on my website that it is 2mb only. Now here's my problem.

I only upload a 1.5mb and a 1.7mb file when ever i submit it the browser
displays

"the page cannot be displayed" but when ever i upload a file lower than 1mb
it uploads it.

Where the problem anyway?


-- -
Louie Miranda
http://www.axishift.com

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



[PHP] Re: PHP Script Output as HTML Mail

2003-10-29 Thread Manuel Lemos
Hello,

On 10/29/2003 11:05 PM, Ebestel wrote:
I want to send HTML output from a php script as HTML E-Mail "ONLINE" Like
Send this page by email feature.
You may just capture the HTML of the pages, maybe with ob_start() and 
ob_getcontents() functions and then send the HTML in an e-mail messages. 
Since you probably have relative URLs to images on the site, you need to 
use the  tag in your page header so the mail programs that receive 
the message can locate the images in the site.

Now, to send the actual message you should not send it like some people 
do just adding a Content-type: text/html header to the message, as many 
spam filters will discard your message before it gets to the recipients.

You need to compose an multipart/alternative message, that consists of 
your message HTML part and an alternative text part that is shown by 
mail programs that do not support displaying HTML messages.

You can put anything in the alternative text part, even if it is just a 
message saying: this is an HTML message, you need an HTML capable mail 
program to read it. What matters is that providing a text/plain 
alternative part using multipart messages is mandatory if want to 
prevent that your message gets filtered.

Composing multipart/alternative messages is not trivial, but fortunately 
you can resort to ready to use classes like this one that simplifies the 
composition of multipart messages:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Undefined Index - is this how you "declare" get & post?

2003-10-29 Thread Terence

- Original Message - 
From: "Chris W. Parker" <[EMAIL PROTECTED]>


> Terence 
> on Wednesday, October 29, 2003 4:40 PM said:
>
> > Since I started using error_reporting(E_ALL), I havent found (in my
> > opinion) a good way to declare GET and POST variables when getting
> > them from a form or querystring. I have searched google and the docs
> > for several hours now without much luck.
>
> Why would you want to declare a GET or POST variable in the first place?
> You'd be overwriting whatever value was stored from the form.

error_reporting(E_ALL) tells me that I have an indefined index, but as Jon
Kriek pointed out,
perhaps reporting "all" the errors is not such a "good thing".

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



Re: [PHP] multiple entries for a variable passed with GET

2003-10-29 Thread Larry E . Ullman
I've got a form with a text entry list allowing the visitor to select  
more
than one entry. The multiple entries are passed in the URL properly  
(see
below) but the QUERY is only using the last one listed. What's up?

URL being passed...
http://www.cancerreallysucks.org/RobesonWeb/robeson1searchB.php? 
manufacturer=JUKI&manufacturer=REECE&manufacturer=WELDTRON&Submit=Submi 
t
The problem is that $manufacture (or $_GET['manufacture']) is a scalar  
variable, meaning it can only have a single value. The last value  
assigned to it (WELDTRON) will override the others. Turn manufacture  
into an array (by making the HTML form input name "manufacture[]") and  
you'll be good to go.

Larry

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


Re: [PHP] quotes in php.ini

2003-10-29 Thread - Edwin -
On Tue, 28 Oct 2003 22:28:12 -0800
Evan Nemerson <[EMAIL PROTECTED]> wrote:

> On Wednesday 29 October 2003 12:30 am, - Edwin - wrote:
> > On Tue, 28 Oct 2003 22:05:56 -0800
> >
> > Evan Nemerson <[EMAIL PROTECTED]> wrote:
> > > On Tuesday 28 October 2003 11:59 pm, - Edwin - wrote:
> > > > Hi,
> > > >
> > > > On Wed, 29 Oct 2003 02:10:49 -0500
> > > >
> > > > Leif K-Brooks <[EMAIL PROTECTED]> wrote:
> > > > > Curt Zirzow wrote:
> > > > > >Try reversing the quotes:
> > > > > > error_prepend_string = "";
> > > > >
> > > > > Not valid XHTML (not sure if it's even valid HTML).
> > > >
> > > > Why not?
> > >
> > > Because W3C says so. The closest thing I found to an
> > > answer is http://www.w3.org/TR/xhtml1/#h-4.4 although I
> > > really didn't dig deeply. validator.w3.org doesn't like
> > > it, tidy doesn't like it. Opera doesn't like it.
> >
> > What "it"?
> 
> The it we're talking about- an HTML entity masquerading as
> a quote around an attribute.
> >

?? Look up again and you'll see the Curt was talking about
"reversing the quotes" and nothing about "entity
masqueraders" ;)

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] quotes in php.ini

2003-10-29 Thread - Edwin -
On Wed, 29 Oct 2003 03:29:13 -0500
Leif K-Brooks <[EMAIL PROTECTED]> wrote:

> - Edwin - wrote:
> 
> >Interesting. Where?
> >  
> >
> www.w3.org

? Sorry, *won't* find it there...

In fact, a quick Google search gives you this:

  http://www.w3.org/TR/REC-html32

[quote]
Attribute values can be quoted using double or single quote
marks (ASCII decimal 34 and 39 respectively). Single quote
marks can be included within the attribute value when the
value is delimited by double quote marks, and vice versa.
[/quote]

Similar info can be found here:

  http://www.w3.org/TR/html401/html40.txt

I'm sure the above applies to XHTML as well. Curt pointed
this out earlier and, yes, using 'single quotes' (which is
what this portion of this thread is all about) is valid
(X)HTML. In fact, it even validates as XHTML "Strict".

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



[PHP] multiple entries for a variable passed with GET

2003-10-29 Thread Robb Kerr
I've got a form with a text entry list allowing the visitor to select more
than one entry. The multiple entries are passed in the URL properly (see
below) but the QUERY is only using the last one listed. What's up?

URL being passed...
http://www.cancerreallysucks.org/RobesonWeb/robeson1searchB.php?manufacturer=JUKI&manufacturer=REECE&manufacturer=WELDTRON&Submit=Submit

Thanx,
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] PHP Script Output as HTML Mail

2003-10-29 Thread Justin French
On Thursday, October 30, 2003, at 12:05  PM, eBestel wrote:

I want to send HTML output from a php script as HTML E-Mail "ONLINE" 
Like
Send this page by email feature.
Typically this feature just sends a link in an email, but if you think 
it's a good idea to send the whole page as HTML, then here's the steps 
I think you need to take.

1. emailme.php recieves a referrer URL as a GET variable [click an 
'email this' link]

2. emailme.php asks for a target email address, etc -- and also passes 
the referrer url around as a hidden form field [click submit]

3. emailme.php grabs the output of a URL via something like the 3rd 
example on http://www.php.net/manual/en/function.fread.php

4. emailme.php uses a mime mail email class (like the one on 
phpclasses.org by manuel lemmos, or the examples found on 
http://php.net/mail) to send the email to the target address

So, start researching each step, and come back with specific questions 
as you need to.

Justin

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


[PHP] PHP and java

2003-10-29 Thread David Miller
I have written PHP code to upload and download files to my server through my browser. 
  On the local side I have generated a java applet to do a few things that I just 
can't do with a browser.  There are some things that I need the java on the local 
machine to have access to on the server.  I started to generate a java servlet to do 
this when I found out that my service provider doesn't support servlets.
For example, I need for the java to be able to make a request of the server for a 
directory listing, then fetch an image from the directory to display in the applet. 
I am a little new to java applets.

Any ideas on how to do this?

JDM

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


[PHP] PHP Script Output as HTML Mail

2003-10-29 Thread eBestel
I want to send HTML output from a php script as HTML E-Mail "ONLINE" Like
Send this page by email feature.

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



RE: [PHP] conditional within SELECT

2003-10-29 Thread Martin Towell
Try something like this:

$sql = "SELECT robeson_inv.manufacturer, robeson_inv.model,";
$sql .= " robeson_inv.specs, robeson_inv.qty, robeson_inv.ID";
$sql .= " FROM robeson_inv";
$sql .= " WHERE robeson_inv.manufacturer = 'vManufacturer'";
if ($vKeywords)
  $sql .= " AND MATCH (robeson_inv.specs) AGAINST ('$vKeywords')";
$sql .= " ORDER BY robeson_inv.model";

Martin

-Original Message-
From: Robb Kerr [mailto:[EMAIL PROTECTED]
Sent: Thursday, 30 October 2003 11:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] conditional within SELECT


Here's another newbie question. The SELECT statement below gets its values
from the URL of the page. When something is entered for "vKeywords" the
SELECT works fine and returns the correct records. However, if nothing is
entered for "vKeywords" (which should return all records matching the other
criteria), the results are NO records. How do I make the "MATCH
(robeson_inv.specs) AGAINST ('vKeywords')" part of the SELECT statement
conditional?

SELECT robeson_inv.manufacturer, robeson_inv.model, robeson_inv.specs,
robeson_inv.qty, robeson_inv.ID
FROM robeson_inv
WHERE MATCH (robeson_inv.specs) AGAINST ('vKeywords') AND
robeson_inv.manufacturer = 'vManufacturer'
ORDER BY robeson_inv.model

Thanx,
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org

-- 
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] conditional within SELECT

2003-10-29 Thread Robb Kerr
Here's another newbie question. The SELECT statement below gets its values
from the URL of the page. When something is entered for "vKeywords" the
SELECT works fine and returns the correct records. However, if nothing is
entered for "vKeywords" (which should return all records matching the other
criteria), the results are NO records. How do I make the "MATCH
(robeson_inv.specs) AGAINST ('vKeywords')" part of the SELECT statement
conditional?

SELECT robeson_inv.manufacturer, robeson_inv.model, robeson_inv.specs,
robeson_inv.qty, robeson_inv.ID
FROM robeson_inv
WHERE MATCH (robeson_inv.specs) AGAINST ('vKeywords') AND
robeson_inv.manufacturer = 'vManufacturer'
ORDER BY robeson_inv.model

Thanx,
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



RE: [PHP] Undefined Index - is this how you "declare" get & post?

2003-10-29 Thread Chris W. Parker
Terence 
on Wednesday, October 29, 2003 4:40 PM said:

> Since I started using error_reporting(E_ALL), I havent found (in my
> opinion) a good way to declare GET and POST variables when getting
> them from a form or querystring. I have searched google and the docs
> for several hours now without much luck.

Why would you want to declare a GET or POST variable in the first place?
You'd be overwriting whatever value was stored from the form.

Also, depending on your version of PHP you should be using $_GET and
$_POST and not $HTTP_GET_VARS or $HTTP_POST_VARS.


hth,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Re: Undefined Index - is this how you "declare" get & post?

2003-10-29 Thread Jon Kriek
settype(), isset(), and empty() checks will all bypass this, but there is no
need to have error reporting set that high ...

error_reporting(2047);

-- 
Jon Kriek
http://phpfreaks.com

"Terence" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi List,
>
> Since I started using error_reporting(E_ALL), I havent found (in my
opinion)
> a good way to declare GET and POST variables when getting them from a form
> or querystring. I have searched google and the docs for several hours now
> without much luck.
>
>  error_reporting(E_ALL);
> // This line stops the error reporting, else I get - Notice: Undefined
> index: i in.
> $HTTP_GET_VARS["i"]="";
>
> if ($HTTP_GET_VARS["i"] == "") {
>  include("myfile.php");
> }
> ?>
>
> Is there a better way?
> I have tried var $i (only for classes I've discovered)
> settype($i, "integer")
>
> Thanks in advance.

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



[PHP] Undefined Index - is this how you "declare" get & post?

2003-10-29 Thread Terence
Hi List,

Since I started using error_reporting(E_ALL), I havent found (in my opinion)
a good way to declare GET and POST variables when getting them from a form
or querystring. I have searched google and the docs for several hours now
without much luck.



Is there a better way?
I have tried var $i (only for classes I've discovered)
settype($i, "integer")

Thanks in advance.

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Pablo Luis Zorzoli
El mi? 29-10-2003 a las 17:38, Marek Kilimajer escribió:
> Can you connect from your server to the other server?
> 

yes Marek, both files are under the same domain(and server) now. 

I'm using the remote inclusion, because when it works they'll be on
separate domains.

Pablo

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



Re: [PHP] Copying an uploaded file...

2003-10-29 Thread John Nichel
René Fournier wrote:
Thanks John. I've simplified and improved the quote per your  
suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the  
code:

 // MOVE FILE
 if  
(move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile'][ 
'name'])) {
 echo "Success!";
 } else {
 echo "NO!!!";
 }

 Here are the results:
Give it a path for the file to be moved too...

if(move_uploaded_file($_FILES['userfile']['tmp_name'], "/path/to/save/" 
. $_FILES['userfile']['name'])) {

 NO!!!
 Array ( [img_photo] => Array ( [name] =>  
apache_pb.gif [type] => image/gif [tmp_name] =>  
/var/tmp/phpvnTFqr [error] => 0 [size] => 2326   
   )  )

Should the tmp directory maybe be set elsewhere? (If so, how can that  
be done? I've looked at the httpd.conf file, but there is no entry for  
upload tmp directory.)

Many thanks in advance.

...Rene
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problems with remote include

2003-10-29 Thread Pablo Luis Zorzoli
El mi? 29-10-2003 a las 16:49, Evan Nemerson escribió:
> Don't be insulted he asked. You'd be amazed at the level of idiocy around 
> here, and you're not known on the list... He meant no disrespect.
> >

NOOO..i'm sorry if MY answer seemed ugly..i'm impressed by the amount of
help i received. By no means i meant to be rude.

I'm sorry for it, i just tried to be brief with the answer.

Pablo

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



Re: [PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
Thanks John. I've simplified and improved the quote per your  
suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the  
code:

 // MOVE FILE
 if  
(move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile'][ 
'name'])) {
 echo "Success!";
 } else {
 echo "NO!!!";
 }

 Here are the results:

 NO!!!
 Array ( [img_photo] => Array ( [name] =>  
apache_pb.gif [type] => image/gif [tmp_name] =>  
/var/tmp/phpvnTFqr [error] => 0 [size] => 2326   
   )  )

Should the tmp directory maybe be set elsewhere? (If so, how can that  
be done? I've looked at the httpd.conf file, but there is no entry for  
upload tmp directory.)

Many thanks in advance.

...Rene

On Wednesday, October 29, 2003, at 12:41 PM, John Nichel wrote:

René Fournier wrote:
I'm trying to get a little upload script working... But I can't seem  
to copy the tmp file to my local web directory (btw, do I really need  
to specify the path, or can I just use a filename, and the file will  
be written to the same directory as the PHP script??).  Anyway, here  
is the code:
$realname = $_FILES['userfile']['name'];
if(copy($_FILES['userfile']['tmp_name'],
'/Users/rene/Sites/renefournier/titan/res/'.$realname)) {
echo $realname.' uploaded';
} else {
echo $realname.' could not be uploaded';
}
PHP has built in functions to move the temp file for you

http://us3.php.net/manual/en/function.move-uploaded-file.php

echo '';
echo "name: ".$_FILES[$fld]['name'];
echo '';
echo "type: ".$_FILES[$fld]['type'];
echo '';
echo "size: ".$_FILES[$fld]['size'];
echo '';
echo "tmp: ".$_FILES[$fld]['tmp_name'];
echo '';
Do you know about print_r?




--
By-Tor.com
It's all about the Rush
http://www.by-tor.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] Echo issue RESOLVED!

2003-10-29 Thread Jason Wong
On Thursday 30 October 2003 06:03, Ryan A wrote:
> If I have said it once I have said it a thousand times..MAC's are evil.
> Step away from it and leave the darkness behind.come towards the light
> and thePC
>
> :-D
>
> Cheers,
> -Ryan
> (P.S in case you hav'nt guesseda PC user)

Define 'PC' and 'PC user'. BTW it's OT and a rhetorical question so don't 
bother.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Here comes the orator, with his flood of words and his drop of reason.
*/

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



Re: [PHP] Echo issue RESOLVED!

2003-10-29 Thread Kim Kohen
G'day Chris
 
> I would be very interested in learning more about this issue. Would you happen
> to be able to provide an example HTTP transaction that Safari mishandles?

If you use a 'proper' html file it works OK. If you simply create a text
file (with .html extension) with less than 16 characters it returns nothing.

The html doesn't bother me much - and realistically most people will never
see the problem - but I often use short echo statements for debugging in
php.

> do you know if Apple is aware of this bug?

They are now:)
 
> By the way, I would recommend developing with something like Mozilla if you
> can't use Safari. IE is about the worst choice for testing.

Mozilla is fine also - I just happened to have IE open and tested it
there...

cheers

kim

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



Re: [PHP] Copying an uploaded file...

2003-10-29 Thread David T-G
Rene --

...and then René Fournier said...
% 
% Thanks John. I've simplified and improved the quote per your  
% suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the  
% code:
% 
%  // MOVE FILE
%  if  
% (move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile'][ 
% 'name'])) {
%  echo "Success!";
%  } else {
%  echo "NO!!!";
%  }

1) Are you working with multiple files or just one?  Here's how my
similar code looks:

  move_uploaded_file($_FILES[uploads][tmp_name][$k],"$file.jpg")
or die("Could not move file '$_FILES[uploads][tmp_name][$k]! $!\n") ;

Note the $k in there; it iterates through the files.

2) Let's take one step at a time and just move the file to some name of
your choosing rather than depending on the name it had on the remote
system.

3) BTW, when you print_r() an array you may find  helpful :-)


HTH & HAND & good luck

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
Thanks John. I've simplified and improved the quote per your  
suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the  
code:

 // MOVE FILE
 if  
(move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile'][ 
'name'])) {
 echo "Success!";
 } else {
 echo "NO!!!";
 }

 Here are the results:

 NO!!!
 Array ( [img_photo] => Array ( [name] =>  
apache_pb.gif [type] => image/gif [tmp_name] =>  
/var/tmp/phpvnTFqr [error] => 0 [size] => 2326   
   )  )

Should the tmp directory maybe be set elsewhere? (If so, how can that  
be done? I've looked at the httpd.conf file, but there is no entry for  
upload tmp directory.)

Many thanks in advance.

...Rene

On Wednesday, October 29, 2003, at 12:41 PM, John Nichel wrote:

René Fournier wrote:
I'm trying to get a little upload script working... But I can't seem  
to copy the tmp file to my local web directory (btw, do I really need  
to specify the path, or can I just use a filename, and the file will  
be written to the same directory as the PHP script??).  Anyway, here  
is the code:
$realname = $_FILES['userfile']['name'];
if(copy($_FILES['userfile']['tmp_name'],
'/Users/rene/Sites/renefournier/titan/res/'.$realname)) {
echo $realname.' uploaded';
} else {
echo $realname.' could not be uploaded';
}
PHP has built in functions to move the temp file for you

http://us3.php.net/manual/en/function.move-uploaded-file.php

echo '';
echo "name: ".$_FILES[$fld]['name'];
echo '';
echo "type: ".$_FILES[$fld]['type'];
echo '';
echo "size: ".$_FILES[$fld]['size'];
echo '';
echo "tmp: ".$_FILES[$fld]['tmp_name'];
echo '';
Do you know about print_r?




--
By-Tor.com
It's all about the Rush
http://www.by-tor.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] function question

2003-10-29 Thread CPT John W. Holmes
From: "Brian V Bonini" <[EMAIL PROTECTED]>

> function splitPageResults($query, $max_rows, $count_key = '*',
> $page_holder = 'page') {
> 
> Am I wrong in assuming that $count_key is being explicitly set to '*' in
> this instance?

Only if no value is passed when the function is called. 

splitPageResults('some query',32)

will result in $count_key and $page_holder getting the defaults listed. 

splitPageResults('some query',32,'foo','bar')

will now results in $count_key => foo and $page_holder => bar

More examples in the manual, I'm sure...

---John Holmes...

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



Re: [PHP] Echo issue RESOLVED!

2003-10-29 Thread Chris Shiflett
--- Kim Kohen <[EMAIL PROTECTED]> wrote:
> I'm glad to report this is not a PHP issue. It turns out to be a
> Safari problem with Mac OSX (Safari was updated with OSX 10.3).
> 
> All my PHP stuff is working correctly in IE so it looks like
> development will proceed there until Apple gets a fix.

I would be very interested in learning more about this issue. Would you happen
to be able to provide an example HTTP transaction that Safari mishandles? Also,
do you know if Apple is aware of this bug?

By the way, I would recommend developing with something like Mozilla if you
can't use Safari. IE is about the worst choice for testing. Of course, you will
want to test with IE at some point, simply because so many people use it, but
something like Mozilla (or Safari) are much closer to being standards-compliant
and can help you identify mistakes as you create them.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] Tristan Pretty is out of the office.

2003-10-29 Thread Tristan . Pretty




I will be out of the office starting  23/10/2003 and will not return until
11/11/2003.

I will respond to your message when I return.
Please contact Fiona or Alan for any issues.



*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP] function question

2003-10-29 Thread Brian V Bonini
 function splitPageResults($query, $max_rows, $count_key = '*',
$page_holder = 'page') {

Am I wrong in assuming that $count_key is being explicitly set to '*' in
this instance?

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



Re: [PHP] include problem

2003-10-29 Thread Allex
Few days ago I asked the same question and got several excellent answers 
that helped me to solve the same problem - check the mailing list for 
'including files from different sub directories' on 24-10-2003.

Nevertheless all those suggestions helped me to solve the problem from a 
normal browser point of view, I still have some troubles with avoiding 
the same error messages while editing my php staff, that means the 
development environment which I use (Eclipse + some plugins) can't 
handle the include/require directives correctly.

Perhaps you may face the same issue .. ??

Allex

Pablo S. Torralba wrote:
Hi,

I have a weird problem which must be stupid for sure. I'm trying to do
an include in my code run as a cgi. The include works fine in the
form:
include ("directory/file");

even it works as:

include ("directory/../directory/file");

but it doesn't work as:

include ("./directory/file");

nor

include ("../current/directory/file").

Of course, the obvious thinking is I have a perms problem but they are
the same for '.' and for 'directory' so it makes no sense for me (755
if you wonder).
If I execute the script it works without problem but it doesn't upon
web request reporting:
Warning: main(./db/db.tables.php) [function.main]: failed to create stream: No 
such file or directory in /home/psanchez/tests/hola.php on line 8

Warning: main() [function.main]: Failed opening './db/db.tables.php' for 
inclusion (include_path='.') in /home/psanchez/tests/hola.php on line 8

I need to know what the problem is because I have a software that
should work but it doesn't.
Any ideas?

Thanks

Pablo S. Torralba

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


Re: [PHP] Echo issue RESOLVED!

2003-10-29 Thread Ryan A
If I have said it once I have said it a thousand times..MAC's are evil.
Step away from it and leave the darkness behind.come towards the light
and thePC

:-D

Cheers,
-Ryan
(P.S in case you hav'nt guesseda PC user)



G'day Adam, David, John etc

>> I have spent about an hour looking at this and have found I can't echo
>> anything with 16 characters or less!

I'm glad to report this is not a PHP issue. It turns out to be a Safari
problem with Mac OSX (Safari was updated with OSX 10.3).

All my PHP stuff is working correctly in IE so it looks like development
will proceed there until Apple gets a fix.

Cheers and many thanks for the replies

kim

-- 
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] Echo issue RESOLVED!

2003-10-29 Thread Kim Kohen
G'day Adam, David, John etc

>> I have spent about an hour looking at this and have found I can't echo
>> anything with 16 characters or less!

I'm glad to report this is not a PHP issue. It turns out to be a Safari
problem with Mac OSX (Safari was updated with OSX 10.3).

All my PHP stuff is working correctly in IE so it looks like development
will proceed there until Apple gets a fix.

Cheers and many thanks for the replies

kim

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



Re: [PHP] Favorite Online Language Guide

2003-10-29 Thread Evan Nemerson
The php.net site is great. It has a manual in tons of languages which is very 
easy to get at. For instance, to look up the file function, you can just go 
to php.net/file. Your language should be automagically detected. The user 
comments fill in any blanks in the documentation.

php.net/language.basic-syntax has a syntax guide



On Wednesday 29 October 2003 01:40 pm, Robb Kerr wrote:
> What's your favorite online Php language guide? I'm a newbie and most
> interested in a syntax guide.
>
> Thanx,

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
"If you would be a real seeker after truth, you must at least once in your 
life doubt, as far as possible, all things."

-Rene Descartes

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



Re: [PHP] Favorite Online Language Guide

2003-10-29 Thread Chris Shiflett
--- Robb Kerr <[EMAIL PROTECTED]> wrote:
> What's your favorite online Php language guide?

http://www.php.net/manual/

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] Parsing a tab delimited log file

2003-10-29 Thread Evan Nemerson
You're using a lot of memory here... Try using fgets for each line instead of 
one big file(). That way, you're only working with one line at a time and can 
forget it when you're done.


On Wednesday 29 October 2003 01:12 pm, John wrote:
> (I'm reposting this as it didn't seem to take the first time. If it's a
> dupe, I apologize.)
>
> Hey all. I'm attempting to count the number of unique message IDs from a
> Microsoft Exchange 2000 tracking log. While the code below works, it takes
> forever to run. Running through a 16mb log file takes like 10 minutes.
>
> If anyone could suggest a better way of doing this, that would be great.
> Also, below the PHP code, is an example of an Exchange tracking log (Which
> is tab delimited).
>
> Thanks in advance for the help.
>
> John
>
> Here is the code I'm using:
>
>  ini_set("max_execution_time", 1200);
> $filename="20031025.log";
>
> $file=file($filename, "r");
>
> $count=count($file);
>
> $array=array();
>
> //first 6 lines of the log are header and empty lines
> $i=5;
> while ($i<=$count)
> {
>
> $line=explode("\t",$file[$i]);
>
> //the MSGID is always the ninth entry in the array
> $data=$line[9];
>
> //Exchange puts a blank line between each entry in the log file, this
> creates an empty entry in the array
> if (!empty($data))
> {
> if (!in_array ($data, $array))
> $array[]=$data;
> }
>
> $i++;
> }
>
> $arraycount=count($array);
> echo $arraycount,"";
> ?>
>
> Here is an example of the Exchange tracking logs:
>
> 2003-10-26  0:0:35 GMT  10.0.0.1file-server -
> Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1019
> [EMAIL PROTECTED]0   0   799
> 1   2003-10-26 0:0:35 GMT   0   Version: 5.0.2195.5329  -   -
> [EMAIL PROTECTED]-
>
> 2003-10-26  0:0:35 GMT  10.0.0.1file-server -
> Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1025
> [EMAIL PROTECTED]0   0   799
> 1   2003-10-26 0:0:35 GMT   0   Version: 5.0.2195.5329  -   -
> [EMAIL PROTECTED]-
>
> 2003-10-26  10:13:43 GMT-   -   -   Exchange-Server -
> [EMAIL PROTECTED] 1020
> [EMAIL PROTECTED]  0
> 0   952 1   2003-10-26 10:13:42 GMT 0   -   -   -
> [EMAIL PROTECTED]   -
>
> 2003-10-26  10:13:43 GMT-   -   SMTP-Server
> Exchange-Server -   [EMAIL PROTECTED] 1031
> [EMAIL PROTECTED]  0
> 0   952 1   2003-10-26 10:13:42 GMT 0   -   -   -
> [EMAIL PROTECTED]   -
>
> 2003-10-26  0:45:59 GMT 192.168.1.2 SMTP-Server.domain.com  -
> Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1019
> [EMAIL PROTECTED]  0   015188
> 1   2003-10-26 0:45:59 GMT  0   Version:
> 95.5329  -   -   [EMAIL PROTECTED]   -
>
> 2003-10-26  0:45:59 GMT 192.168.1.2 SMTP-Server.domain.com  -
> Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1025
> [EMAIL PROTECTED]  0   015188
> 1   2003-10-26 0:45:59 GMT  0   Version:
> 95.5329  -   -   [EMAIL PROTECTED]   -

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
"Businesses may come and go, but religion will last forever, for in no other 
endeavor does the consumer blame himself for product failure."

-Harvard Lamphoon

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Marek Kilimajer
Can you connect from your server to the other server?

Pablo Zorzoli wrote:
On Wed, 2003-10-29 at 17:17, Chris Shiflett wrote:

That seems right, unless I'm missing something obvious. I think you already
mentioned that you have configured to allow URL opens.


yes that parameter is 'On'


So, can you tell us what something like this produces?

http://www.google.com/');
?>
That should basically take Google's HTML and make it your own. The image will
obviously not work, but it should otherwise look like Google's home page.


yes i get Google's HTML.

pablo

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


[PHP] Favorite Online Language Guide

2003-10-29 Thread Robb Kerr
What's your favorite online Php language guide? I'm a newbie and most
interested in a syntax guide.

Thanx,
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



RE: [PHP] $HTTP_SERVER_VARS["HTTP_PC_REMOTE_ADDR"] returns no value

2003-10-29 Thread Wouter van Vliet
$_SERVER['REMOTE_ADDR'] 
$HTTP_SERVER_VARS['REMOTE_ADDR']

= what you want :P

-Original Message-
From: Randall Perry [mailto:[EMAIL PROTECTED] 
Sent: Wednesday 29 October 2003 15:54
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] $HTTP_SERVER_VARS["HTTP_PC_REMOTE_ADDR"] returns no value

Want to grab the client IP after client agrees to a contract, but am getting
no value from the $HTTP_SERVER_VARS["HTTP_PC_REMOTE_ADDR"] var.

Anyone know why this might happen?

--
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.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



[PHP] Parsing a tab delimited log file

2003-10-29 Thread John
(I'm reposting this as it didn't seem to take the first time. If it's a
dupe, I apologize.)

Hey all. I'm attempting to count the number of unique message IDs from a
Microsoft Exchange 2000 tracking log. While the code below works, it takes
forever to run. Running through a 16mb log file takes like 10 minutes.

If anyone could suggest a better way of doing this, that would be great.
Also, below the PHP code, is an example of an Exchange tracking log (Which
is tab delimited).

Thanks in advance for the help.

John

Here is the code I'm using:

";
?>

Here is an example of the Exchange tracking logs:

2003-10-26  0:0:35 GMT  10.0.0.1file-server -
Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1019
[EMAIL PROTECTED]0   0   799
1   2003-10-26 0:0:35 GMT   0   Version: 5.0.2195.5329  -   -
[EMAIL PROTECTED]-

2003-10-26  0:0:35 GMT  10.0.0.1file-server -
Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1025
[EMAIL PROTECTED]0   0   799
1   2003-10-26 0:0:35 GMT   0   Version: 5.0.2195.5329  -   -
[EMAIL PROTECTED]-

2003-10-26  10:13:43 GMT-   -   -   Exchange-Server -
[EMAIL PROTECTED] 1020
[EMAIL PROTECTED]  0
0   952 1   2003-10-26 10:13:42 GMT 0   -   -   -
[EMAIL PROTECTED]   -

2003-10-26  10:13:43 GMT-   -   SMTP-Server
Exchange-Server -   [EMAIL PROTECTED] 1031
[EMAIL PROTECTED]  0
0   952 1   2003-10-26 10:13:42 GMT 0   -   -   -
[EMAIL PROTECTED]   -

2003-10-26  0:45:59 GMT 192.168.1.2 SMTP-Server.domain.com  -
Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1019
[EMAIL PROTECTED]  0   015188
1   2003-10-26 0:45:59 GMT  0   Version:
95.5329  -   -   [EMAIL PROTECTED]   -

2003-10-26  0:45:59 GMT 192.168.1.2 SMTP-Server.domain.com  -
Exchange-Server 10.0.0.50   [EMAIL PROTECTED] 1025
[EMAIL PROTECTED]  0   015188
1   2003-10-26 0:45:59 GMT  0   Version:
95.5329  -   -   [EMAIL PROTECTED]   -

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



[PHP] Re: Web Service in PHP/XML

2003-10-29 Thread Alexandru COSTIN
Hello,
everything was finished.  I have done very little with CURL, I'm not sure if
there are any tutorials or anything else that I could see to get some good
examples of both ends of the process anyone know of any?  Anyone know of a
better way?  I'm also looking into XML or Java on the authorization end but
If you want to use PHP with SOAP, you might also want to read about the 
Krysalis platform here : 
http://www.interakt.ro/products/documentation_10.html

Alexandru

--
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: How to deal with XML?

2003-10-29 Thread Alexandru COSTIN
Hello Simon,

I think I've missed something somewhere, but how do I use XML? 
Everywhere, there are big hypes about XML. I could proably google quite 
a bit on this, but could someone give me a hint on how to use it in, say 
datahandling? Or to parse a website (like the php docs).
XML has its role and is not a replacement for the rest of the languages 
or datasources. What we've seen XML usage was for either creating 
communication streams between heterogenous applications (replacing CORBA 
or RMI), or for keeping information in a structured way.

We (InterAKT) use XML in our Krysalis platform for describing a web 
application controller, and also to create a data structure between the 
application logic and the presentation layer.

http://www.interakt.ro/products/Krysalis/

Alexandru

--
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] gzcompress/gzdeflate default compression level?

2003-10-29 Thread Marek Kilimajer
I think the default is 6, but you will need a very long string to get 
any benefit from higher numbers.

Gerard Samuel wrote:
The docs do not state what the defaults are, and from tests, 
it seems the values 4 - 9 return the same output as with no value, 
on the string I tested with.
Does anyone know what the default compression levels are?
Thanks

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


Re: [PHP] gzcompress/gzdeflate default compression level?

2003-10-29 Thread Evan Nemerson
On Wednesday 29 October 2003 11:29 am, Gerard Samuel wrote:
> The docs do not state what the defaults are, and from tests,
> it seems the values 4 - 9 return the same output as with no value,
> on the string I tested with.
> Does anyone know what the default compression levels are?

IIRC the default value is -1, which zlib currently converts to 6.

> Thanks

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
"To think is to differ."

-Clarence Darrow

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Chris Shiflett
--- Pablo Zorzoli <[EMAIL PROTECTED]> wrote:
> >  > include('http://www.google.com/');
> > ?>
> > 
> > That should basically take Google's HTML and make it your own.
> > The image will obviously not work, but it should otherwise look
> > like Google's home page.
> 
> yes i get Google's HTML.

OK, so this proves that this method works in your environment. Given this, can
you identify the differences between this code and your own? Maybe if you try
to break it down into its simplest case, you will reveal some subtle error that
we all missed.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] PDFlib not working with explorer based on PHP created file in memory

2003-10-29 Thread Larry Brown
My apologies for waisting anyone's time.  I found the posting in the
archives that had the correct code to use.

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 29, 2003 3:39 PM
To: PHP List
Subject: [PHP] PDFlib not working with explorer based on PHP created
file in memory


If anyone can help, please...

I have a page that points to a PHP page that dynamically creates a pdf file
using PDFlib.  The page uses a link such as
site.com/page.php?variable=value.  That in turn executes the script that
uses the variable/value to pull info from the db and generate the page.  The
result is that when you click the link you are prompted to save or open the
document.  By openning the document you are presented with the pdf by
acrobat.  This is seemless with Mozilla.  However, on IE it hangs with the
message "Getting File information:".  If you try to save it you get another
error.  I have read some information indicating that the problem is with the
length parameter not being sent.  However, the page I'm using was off an
example someone provided and it already has what seems to be the fix for
page length.  The code that creates the file is as follows...


$p = PDF_new();
if(PDF_open_file($p, "") == 0) {
die("Error: ".PDF_get_errmsg($p));
}

...body goes here...

PDF_end_page($p);
PDF_close($p);

$buf = PDF_get_buffer($p);
$len = strlen($buf);

header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=filename.pdf");
print $buf;

PDF_delete($p);

Again, this is only a problem with m$ IE.  I know this is one of the largest
toolkits (PDFlib) in use for creating well defined printable documents so I
can't believe that this is not a common problem or that I am doing something
really wrong.

Someone on PDFlib's mailing list once mentioned sending the document for
download via "chunks" instead of getting the length except he wrote
something in C/C++ to accomplish it in his app.  Is there some way to tell
the browser to accept via "chunks" in php?  Does the above header look right
for IE?

Any help would be greatly appreciated...

--
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] PDFlib not working with explorer based on PHP created file in memory

2003-10-29 Thread Larry Brown
If anyone can help, please...

I have a page that points to a PHP page that dynamically creates a pdf file
using PDFlib.  The page uses a link such as
site.com/page.php?variable=value.  That in turn executes the script that
uses the variable/value to pull info from the db and generate the page.  The
result is that when you click the link you are prompted to save or open the
document.  By openning the document you are presented with the pdf by
acrobat.  This is seemless with Mozilla.  However, on IE it hangs with the
message "Getting File information:".  If you try to save it you get another
error.  I have read some information indicating that the problem is with the
length parameter not being sent.  However, the page I'm using was off an
example someone provided and it already has what seems to be the fix for
page length.  The code that creates the file is as follows...


$p = PDF_new();
if(PDF_open_file($p, "") == 0) {
die("Error: ".PDF_get_errmsg($p));
}

...body goes here...

PDF_end_page($p);
PDF_close($p);

$buf = PDF_get_buffer($p);
$len = strlen($buf);

header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=filename.pdf");
print $buf;

PDF_delete($p);

Again, this is only a problem with m$ IE.  I know this is one of the largest
toolkits (PDFlib) in use for creating well defined printable documents so I
can't believe that this is not a common problem or that I am doing something
really wrong.

Someone on PDFlib's mailing list once mentioned sending the document for
download via "chunks" instead of getting the length except he wrote
something in C/C++ to accomplish it in his app.  Is there some way to tell
the browser to accept via "chunks" in php?  Does the above header look right
for IE?

Any help would be greatly appreciated...

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



Re: [PHP] gzcompress/gzdeflate default compression level?

2003-10-29 Thread David T-G
Gerard, et al --

...and then Gerard Samuel said...
% 
% On Wednesday 29 October 2003 03:27 pm, David T-G wrote:
% >
% > ...and then Gerard Samuel said...
% > %
% > % on the string I tested with.
% >
% > With what sort of data are you working?  How are you gzipping (PEAR
% > module, class, system call, ...)?
% 
% Right now, Im compressing large serialized strings using the php functions 

That sounds good; you probably have enough material there to get some
good compression, and ASCII is always easy.  So perhaps you may only get
better performance with higher numbers if you have a LOT of data.


% gzcompress/gzdeflate.

OK.


% 
% > % Does anyone know what the default compression levels are?
% >
% > My gzip man page says it's -6; I'd suspect it would be the same for any
% > library call.
% 
% Didn't think to check man pages, but it says the same here, so I guess its 
% a good assumption...

It's a good place to start :-)


% 
% Thanks

Sure thing!


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] gzcompress/gzdeflate default compression level?

2003-10-29 Thread Gerard Samuel
On Wednesday 29 October 2003 03:27 pm, David T-G wrote:
> Gerard --
>
> ...and then Gerard Samuel said...
> %
> % The docs do not state what the defaults are, and from tests,
> % it seems the values 4 - 9 return the same output as with no value,
> % on the string I tested with.
>
> With what sort of data are you working?  How are you gzipping (PEAR
> module, class, system call, ...)?

Right now, Im compressing large serialized strings using the php functions 
gzcompress/gzdeflate.

>
> % Does anyone know what the default compression levels are?
>
> My gzip man page says it's -6; I'd suspect it would be the same for any
> library call.

Didn't think to check man pages, but it says the same here, so I guess its 
a good assumption...

Thanks

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



Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Ok, this gives me an error. I guess what I was asking early is there 
away to print an echo without doing myrow? Why can I do echo $result 
without getting Resource id # My thinking is if you look at my first 
e-mail, my code is trying to fetch multi-rows from the database, I don't 
need multi row,  I thinking becaue fetch calls the database multi time 
that it defects the rand() function.

Payne

Chris W. Parker wrote:

Payne 
   on Wednesday, October 29, 2003 11:54 AM said:
 

Try ->
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;


 

I did that same thing.
   

SELECT url FROM sponsors ORDER BY column RAND() LIMIT 1;

How about that one?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
 

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


Re: [PHP] redirect

2003-10-29 Thread Marek Kilimajer
alain dhaene wrote:
But I get the following warning:

Warning: Cannot modify header information - headers already sent by (output
started at
/home/schoolre/public_html/Hitek/Online/Registratie/registratieFuncties.php:
1) 
The warning states it clearly, output started on line 1 in 
registratieFuncties.php. Output means any output that is send to the 
browser, and there are many ways you can output something - echo, print, 
anything outside , error ...

in
/home/schoolre/public_html/Hitek/Online/Registratie/registratieData.php on
line 30
In registratieData there is a include file to registratieFuncties.php. And
in the file registratieFuncties.php there is a include file to
Connecties.inc for the connectiestring to the database
Alain



"Gregory Kornblum" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
ing.com...
header("Location: registratie.html");
That is exactly how you do the PHP version of a response.redirect().
Regards.


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


Re: [PHP] gzcompress/gzdeflate default compression level?

2003-10-29 Thread David T-G
Gerard --

...and then Gerard Samuel said...
% 
% The docs do not state what the defaults are, and from tests, 
% it seems the values 4 - 9 return the same output as with no value, 
% on the string I tested with.

With what sort of data are you working?  How are you gzipping (PEAR
module, class, system call, ...)?


% Does anyone know what the default compression levels are?

My gzip man page says it's -6; I'd suspect it would be the same for any
library call.


% Thanks


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Problems with remote include

2003-10-29 Thread Pablo Zorzoli
On Wed, 2003-10-29 at 17:17, Chris Shiflett wrote:
> That seems right, unless I'm missing something obvious. I think you already
> mentioned that you have configured to allow URL opens.

yes that parameter is 'On'

>  So, can you tell us what something like this produces?
> 
>  include('http://www.google.com/');
> ?>
> 
> That should basically take Google's HTML and make it your own. The image will
> obviously not work, but it should otherwise look like Google's home page.

yes i get Google's HTML.

pablo

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Chris Shiflett
--- Pablo Zorzoli <[EMAIL PROTECTED]> wrote:
> i see one line containing the expected html code.The scrip is a
> counter that outputs the img tags to fecth the images:
> 
> 
> 
> that's all i get, and all i would like to get with the remote
> include.

That seems right, unless I'm missing something obvious. I think you already
mentioned that you have configured to allow URL opens. So, can you tell us what
something like this produces?

http://www.google.com/');
?>

That should basically take Google's HTML and make it your own. The image will
obviously not work, but it should otherwise look like Google's home page.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Pablo Zorzoli
On Wed, 2003-10-29 at 16:36, Chris Shiflett wrote:
> The results you expect might not be right. This doesn't help me help you.
> 
> Is it valid PHP? Can you show us *exactly* what you see when you view source in
> your browser?

i see one line containing the expected html code.The scrip is a counter
that outputs the img tags to fecth the images:



that's all i get, and all i would like to get with the remote include.

pablo

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



RE: [PHP] ORDER BY RAND()....

2003-10-29 Thread Chris W. Parker
Payne 
on Wednesday, October 29, 2003 11:54 AM said:

>> Try ->
>> SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;
>> 
>> 
>> 
> I did that same thing.

SELECT url FROM sponsors ORDER BY column RAND() LIMIT 1;

How about that one?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Gerard Samuel wrote:

On Wednesday 29 October 2003 02:24 pm, Payne wrote:
 

Hi,

I have been working on a simple PHP script that called to a mysql
database, where I  do the following
SELECT url FROM sponsors ORDER BY RAND();
   

Try ->
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;
 

I did that same thing.

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


RE: [PHP] redirect

2003-10-29 Thread Chris W. Parker
alain dhaene 
on Wednesday, October 29, 2003 11:29 AM said:

> I have check my code.
> I haven't use a echo in my code.
> It's very strange. I will search more on the manule.

PHP has so far been very good to me with reporting this error. I would
trust the error message and look carefully at the file and line it
reports as being the offender.

"/home/schoolre/public_html/Hitek/Online/Registratie/registratieData.php
on line 30"


Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] redirect

2003-10-29 Thread Chris Shiflett
--- alain dhaene <[EMAIL PROTECTED]> wrote:
> I have check my code.
> I haven't use a echo in my code.
> It's very strange. I will search more on the manule.

I don't think the manual will help you here. You *do* have output in your
script prior to the call to header(). Trust me. :-)

One way to find out is to put this directly above the call to header():

exit;

Then, call the script with your browser, view source, and select all
(control-A). If *anything* is highlighted, even whitespace, then that's your
output. Get rid of it, or buffer it (as per another suggestion).

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] redirect

2003-10-29 Thread Chris Shiflett
--- alain dhaene <[EMAIL PROTECTED]> wrote:
> Is there in php something as a redirect to another page like in asp?

Yes, and as with ASP, there are several methods.

Make an example script that has only this:

http://www.google.com/'); ?>

As for your error about headers already being sent, this is because you
generate output prior to the call to header(). You can't do this due to a
protocol restriction. The same applies to ASP, although it might buffer output
or something for you.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Gerard Samuel
On Wednesday 29 October 2003 02:24 pm, Payne wrote:
> Hi,
>
> I have been working on a simple PHP script that called to a mysql
> database, where I  do the following
>
> SELECT url FROM sponsors ORDER BY RAND();

Try ->
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;

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



[PHP] gzcompress/gzdeflate default compression level?

2003-10-29 Thread Gerard Samuel
The docs do not state what the defaults are, and from tests, 
it seems the values 4 - 9 return the same output as with no value, 
on the string I tested with.
Does anyone know what the default compression levels are?
Thanks

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



Re: [PHP] redirect

2003-10-29 Thread alain dhaene
I have check my code.
I haven't use a echo in my code.
It's very strange. I will search more on the manule.
thx


"Pablo Zorzoli" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> On Wed, 2003-10-29 at 16:17, alain dhaene wrote:
> > But I get the following warning:
> >
> > Warning: Cannot modify header information - headers already sent by
(output
> > started at
> >
/home/schoolre/public_html/Hitek/Online/Registratie/registratieFuncties.php:
> > 1) in
> > /home/schoolre/public_html/Hitek/Online/Registratie/registratieData.php
on
> > line 30
> >
> > In registratieData there is a include file to registratieFuncties.php.
And
> > in the file registratieFuncties.php there is a include file to
> > Connecties.inc for the connectiestring to the database
>
> You cannot do any echo ""; before header("location:.."); maybe that's
> the problem.
>
> regards..
>
> pablo

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



[PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Hi,

I have been working on a simple PHP script that called to a mysql 
database, where I  do the following

SELECT url FROM sponsors ORDER BY RAND();

When I do a refresh I keep getting the same url, I have test this sql 
statement in mysql and it works great. I think my problem is this...

Here is my php script



   $db = mysql_connect("69.15.40.130","cepayne","death");

   mysql_select_db("links",$db);

   $result = mysql_query("SELECT url FROM sponsors order by 
rand() LIMIT 1", $db);

  if ($myrow = mysql_fetch_array($result)) {

   echo"";
  
  do {
 
  printf("%s\n",$myrow[url]);
  
  } while ($myrow = mysql_fetch_array($result));
  
  } else {
  
  echo "Sorry, no message of day today";
  }

 echo ""

?>

I  know that what I have got here must be the problem because this  code 
was use to get mutli line of results. Is there a way to retype this so 
that I only get the one statement I need?

Payne

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


RE: [PHP] redirect

2003-10-29 Thread Chris W. Parker
Pablo Zorzoli 
on Wednesday, October 29, 2003 11:20 AM said:

> You cannot do any echo ""; before header("location:.."); maybe that's
> the problem.

The solution would be to turn on output buffering.

http://www.fullurl.com/notjust/a/page.html";); exit;


?>


hth,

Chris.

p.s. Output buffering I think can have some performance issues regarding
server memory but I'm not certain about this.


--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] redirect

2003-10-29 Thread Pablo Zorzoli
On Wed, 2003-10-29 at 16:17, alain dhaene wrote:
> But I get the following warning:
> 
> Warning: Cannot modify header information - headers already sent by (output
> started at
> /home/schoolre/public_html/Hitek/Online/Registratie/registratieFuncties.php:
> 1) in
> /home/schoolre/public_html/Hitek/Online/Registratie/registratieData.php on
> line 30
> 
> In registratieData there is a include file to registratieFuncties.php. And
> in the file registratieFuncties.php there is a include file to
> Connecties.inc for the connectiestring to the database

You cannot do any echo ""; before header("location:.."); maybe that's
the problem.

regards..

pablo

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Pablo Zorzoli
On Wed, 2003-10-29 at 16:18, CPT John W. Holmes wrote:
> 
> You know you're going to get the OUTPUT of script.php, right? You'll get the
> same exact result as if you typed the address into your browser.
> 
> Is that what you're trying to do?

yes John, tht's exactly what i want to get.

pablo

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



Re: [PHP] redirect

2003-10-29 Thread alain dhaene
But I get the following warning:

Warning: Cannot modify header information - headers already sent by (output
started at
/home/schoolre/public_html/Hitek/Online/Registratie/registratieFuncties.php:
1) in
/home/schoolre/public_html/Hitek/Online/Registratie/registratieData.php on
line 30

In registratieData there is a include file to registratieFuncties.php. And
in the file registratieFuncties.php there is a include file to
Connecties.inc for the connectiestring to the database

Alain




"Gregory Kornblum" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
ing.com...
> >header("Location: registratie.html");
>
> That is exactly how you do the PHP version of a response.redirect().
> Regards.

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



Re: [PHP] Problems with remote include

2003-10-29 Thread CPT John W. Holmes
From: "Pablo Zorzoli" <[EMAIL PROTECTED]>

>  include ('http://blabla.com/script.php?var1=a');
> ?>
[snip]
> script.php should echo some text, but i don't get any output.

You know you're going to get the OUTPUT of script.php, right? You'll get the
same exact result as if you typed the address into your browser.

Is that what you're trying to do?

---John Holmes...

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



RE: [PHP] redirect

2003-10-29 Thread Gregory Kornblum
>header("Location: registratie.html");

That is exactly how you do the PHP version of a response.redirect().
Regards.

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



Re: [PHP] String Array Creation and assigment

2003-10-29 Thread Dan
please help with the following:

I tried this first :
$b[] = 'Book Worzel, Richard (1989). From Employee to Entrepreneur:  how to
turn your experience into a fortune.  Toronto:  Key Porter books.';
$b[] = 'Book Ries, Al and Jack Trout (1994). The 22 Immutable Laws of
Marketing.  New York:  Harper Business';
...

then tried this :
$b[0] = 'Book Worzel, Richard (1989). From Employee to Entrepreneur:  how to
turn your experience into a fortune.  Toronto:  Key Porter books.';
$b[1] = 'Book Ries, Al and Jack Trout (1994). The 22 Immutable Laws of
Marketing.  New York:  Harper Business';
...

none of the above work, what's right?

help will be appreciated.

Dan

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



[PHP] redirect

2003-10-29 Thread alain dhaene
Hi,

Is there in php something as a redirect to another page like in asp?

e.g

  if(choice==1) response.redirect("page.php");
 response.redirect("page2.php");

I have search in the manuel, but the only thing I find is something like
header("Location: registratie.html");

But I guess it's wrong because header information is already send.


Alain

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Pablo Zorzoli
On Wed, 2003-10-29 at 16:00, Chris Shiflett wrote:
> When you visit http://blabla.com/script.php?var1=a and view source, what do you
> see? Is it valid PHP?

yap, exactly. if i paste th elink i my browser i see the results
expected..

pablo

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



Re: [PHP] Problems with remote include

2003-10-29 Thread Chris Shiflett
--- Pablo Zorzoli <[EMAIL PROTECTED]> wrote:
> I'm having trouble while i try to include a php file.
[snip]
> include ('http://blabla.com/script.php?var1=a');
[snip]
> script.php should echo some text, but i don't get any output.

When you visit http://blabla.com/script.php?var1=a and view source, what do you
see? Is it valid PHP?

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] Problems with remote include

2003-10-29 Thread Pablo Zorzoli
Hi all, 

I'm having trouble while i try to include a php file. the testing code
is something loke the sort.






 test:

http://blabla.com/script.php?var1=a');
?>



script.php should echo some text, but i don't get any output.

In my php.ini I have allow_url_fopen = On, is there any other thing to
configure. And both scripts are under the same domain & webserver.

Thanks,

Pablo Zorzoli

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



Re: [PHP] Performance of dynamically generated select boxes

2003-10-29 Thread Chris Shiflett
--- Luis Lebron <[EMAIL PROTECTED]> wrote:
> I am rebuilding a php application to handle a higher load. The
> previous programmer had created a series of dynamically generated
> select boxes using a mysql table. Would it be faster or less
> resource intensive to create a series of arrays to generate the
> select boxes and avoid the database queries. I've done some informal
> testing using Pear Benchmark and it seems the array based script
> usually takes less time.

Basically, anything you can do to eliminate talking to the database will
usually improve performance by a fair margin. The downside is convenience; if
you have data hard-coded in your PHP scripts, it is less convenient to maintain
the data. You effectively eliminate the separation between the data and your
logic.

A similar idea is to eliminate PHP. Apache can serve a lot more static pages
than it can PHP pages at any given time. Of course, this has a similar
disadvantage as well. Now your pages are static rather than dynamic.

Developers have created many different types of systems to address these
thoughts. For eliminating database queries while still leaving the data in your
database, you simply need something to update your PHP scripts whenever data in
the database changes, or at regular intervals. For example, you mention an
array replacing the query. This array can be in a separate include file and act
as a sort of cache. This cache can be refreshed as often as appropriate using
another PHP script that you write.

The same idea can be applied to static pages. These can also be refreshed with
PHP scripts as often as necessary. In fact, you might want to just do something
like this and not even worry about limiting database interactions with your PHP
script, since it won't be executed but a fraction of the time.

So, your instincts serve you well. In general, anytime you query the database
many times to receive the exact same data, there is probably a better solution.
In the same sense, anytime the output of a PHP script is the same for many
users, there is probably a better solution.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] session_regenerate_id()

2003-10-29 Thread CPT John W. Holmes
From: "Alexander Mueller" <[EMAIL PROTECTED]>

> "Cpt John W. Holmes" wrote:
> >
> > PHP 4.3.2 created a new session ID, but it didn't resend the cookie. So
the
> > next request would include the old session ID again from the cookie.
>
> I wonder what it is then good for. Changing the id internally without
> notifying the client does not make much sense IMHO.

If you're using sessions in the URL, then it works just fine.

> > What are you trying to do?
>
> Changing the session id upon a login to prevent referal attacks.

So, if PHP is less than 4.3.3, you need to use setcookie() to reset the
value of the session id yourself. If you're using 4.3.3, then you don't have
to worry about it.

---John Holmes...

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



Re: [PHP] Performance of dynamically generated select boxes

2003-10-29 Thread CPT John W. Holmes
From: "Luis Lebron" <[EMAIL PROTECTED]>


> I am rebuilding a php application to handle a higher load. The previous
> programmer had created a series of dynamically generated select boxes
using
> a mysql table. Would it be faster or less resource intensive to create a
> series of arrays to generate the select boxes and avoid the database
> queries. I've done some informal testing using Pear Benchmark and it seems
> the array based script usually takes less time.

Yeah, that would be quicker, provided the contents don't change to often.
You should build a cache system where the arrays are recreated every so
often so they stay current (or on demand).

Take a look at var_export(). It will return valid PHP code that you can
write to a file and then include() to recreate your arrays. If the file
doesn't exist, trigger the function to create the array file, etc...

---John Holmes...

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



Re: [PHP] Copying an uploaded file...

2003-10-29 Thread John Nichel
René Fournier wrote:
I'm trying to get a little upload script working... But I can't seem to 
copy the tmp file to my local web directory (btw, do I really need to 
specify the path, or can I just use a filename, and the file will be 
written to the same directory as the PHP script??).  Anyway, here is the 
code:

$realname = $_FILES['userfile']['name'];
if(copy($_FILES['userfile']['tmp_name'],
'/Users/rene/Sites/renefournier/titan/res/'.$realname)) {
echo $realname.' uploaded';
} else {
echo $realname.' could not be uploaded';
}
PHP has built in functions to move the temp file for you

http://us3.php.net/manual/en/function.move-uploaded-file.php

echo '';
echo "name: ".$_FILES[$fld]['name'];
echo '';
echo "type: ".$_FILES[$fld]['type'];
echo '';
echo "size: ".$_FILES[$fld]['size'];
echo '';
echo "tmp: ".$_FILES[$fld]['tmp_name'];
echo '';
Do you know about print_r?




--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: strange issue

2003-10-29 Thread jacob bolton
Just for future users with this same problem, here's what I had to do to fix
it.

The version of Apache and PHP I was using was both the original RPM that
came with RH9.  I had to shut both of them down, and then reinstall Apache
and PHP from source with the latest versions.  After I did that, everything
worked no problem.



"Jacob Bolton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hey all,

I've researched this to the greatest extent and I can't seem to find
anything written about this.  I have a new server (RH 9) with PHP4.2.2 and
Apache 2.  I can't seem to upload anything over 1 KB.  I can upload small
gifs and JPGs that are a few hundred bytes, but I can't seem to upload
anything over that.  I get no error messages, it simply doesn't upload it.
I can
upload no problem with a perl script.

My upload_max_filesize value is set at 10M.

You can view my php_info at http://mlm.vervecreations.com/php.php

Any insight would be appreciated.

Thanks!

Jacob Bolton

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



[PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
I'm trying to get a little upload script working... But I can't seem to 
copy the tmp file to my local web directory (btw, do I really need to 
specify the path, or can I just use a filename, and the file will be 
written to the same directory as the PHP script??).  Anyway, here is 
the code:

$realname = $_FILES['userfile']['name'];
if(copy($_FILES['userfile']['tmp_name'],
'/Users/rene/Sites/renefournier/titan/res/'.$realname)) {
echo $realname.' uploaded';
} else {
echo $realname.' could not be uploaded';
}
echo '';
echo "name: ".$_FILES[$fld]['name'];
echo '';
echo "type: ".$_FILES[$fld]['type'];
echo '';
echo "size: ".$_FILES[$fld]['size'];
echo '';
echo "tmp: ".$_FILES[$fld]['tmp_name'];
echo '';
Here is the output:

could not be uploaded
name: web_share.gif
type: image/gif
size: 13370
tmp: /var/tmp/phpNqigbO


Thanks for any ideas.

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


[PHP] Performance of dynamically generated select boxes

2003-10-29 Thread Luis Lebron
I am rebuilding a php application to handle a higher load. The previous
programmer had created a series of dynamically generated select boxes using
a mysql table. Would it be faster or less resource intensive to create a
series of arrays to generate the select boxes and avoid the database
queries. I've done some informal testing using Pear Benchmark and it seems
the array based script usually takes less time.

thanks,

Luis R. Lebron
Project Manager
Sigmatech, Inc


[PHP] Beginner looking for survey script

2003-10-29 Thread josh hough
I'm looking for a simple bit of code to interrupt all visitors to a site so 
they can submit a brief survey and then automatically continue to their 
desired destination.  The server is Apache 2.0 on Solaris.  I have already 
set a global header to redirect all visitors to the survey page if they do 
not have a cookie.  The survey page needs to write their form data to a 
plain text file (NOT MySQL), set a cookie to prevent them from seeing the 
survey again, and finally show a "Thank you" page with a link to their 
original destination.  Has anyone run across such a thing, or know how to 
create it easily?  Thank you kindly.
-josh

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


Re: [PHP] session_regenerate_id()

2003-10-29 Thread Alexander Mueller
Curt Zirzow wrote:
> 
> how is it not comatible with Opera?

With 4.3.3 it works for IE and Mozilla, however Opera still has some
problems with recognising the new id under certain circumstances.

Alexander
-- 
PINO - The free Chatsystem!
Available at http://www.pino.org

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



Re: [PHP] session_regenerate_id()

2003-10-29 Thread Alexander Mueller
"Cpt John W. Holmes" wrote:
> 
> PHP 4.3.2 created a new session ID, but it didn't resend the cookie. So the
> next request would include the old session ID again from the cookie.

I wonder what it is then good for. Changing the id internally without
notifying the client does not make much sense IMHO.

> 
> What are you trying to do?

Changing the session id upon a login to prevent referal attacks.

Alexander
-- 
PINO - The free Chatsystem!
Available at http://www.pino.org

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



Re: [PHP] session_regenerate_id()

2003-10-29 Thread Curt Zirzow
* Thus wrote Alexander Mueller ([EMAIL PROTECTED]):
> 
> I am not entirely sure what the following paragraph at
> http://at2.php.net/manual/en/function.session-regenerate-id.php shall
> mean
> 
> > As of PHP 4.3.3, if session cookies are enabled, use of
> > session_regenerate_id() will also submit a new session cookie with the
> > new session id.
> 
> What did it in 4.3.2? Somehow it seems its not working prior to 4.3.3
> and even now its not fully compatible with Opera.

how is it not comatible with Opera?


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] session_regenerate_id()

2003-10-29 Thread CPT John W. Holmes
From: "Alexander Mueller" <[EMAIL PROTECTED]>

> I am not entirely sure what the following paragraph at
> http://at2.php.net/manual/en/function.session-regenerate-id.php shall
> mean
>
> > As of PHP 4.3.3, if session cookies are enabled, use of
> > session_regenerate_id() will also submit a new session cookie with the
> > new session id.
>
> What did it in 4.3.2? Somehow it seems its not working prior to 4.3.3
> and even now its not fully compatible with Opera.

PHP 4.3.2 created a new session ID, but it didn't resend the cookie. So the
next request would include the old session ID again from the cookie.

What are you trying to do?

---John Holmes...

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



Re: [PHP] data from database

2003-10-29 Thread alain dhaene
it works,

thanks,

Alain

"John Nichel" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> alain dhaene wrote:
> > Hi,
> >
> > I will write a function that returns the result of a recordset.
> > I tried this:
> >
> >   Function getPersonen()
> >   {
> >openDB();  //function that I implements in another file
> >
> >
> >  $query = "SELECT * FROM Cursisten";
> >  $result = mysql_query($query)
> >  or die("Fout bij uitvoeren query");
> >
> >  $resultrow = mysql_fetch_array( $result );
>
> Get rid of the above line, unless you plan on passing the array.  From
> the looks below, you want to pass the identifier though.  If you do want
> to pass the result array instead of the identifier, leave as is.
>
> >  closeDB();   //function that I implements in another file
> >mysql_free_result($result);
>
> If you are going to pass the identifier, you just killed it here.  If
> you are going to pass the data array, swap these two lines, ie free your
> result before you close your connections.
>
> > return $resultrow;
>
> Change this line to...
>
> return $result
>
> if you are not planning on passing the array.
>
> >   }
> >
> > I call this function:
> >
> > $resultaat =  getPersonen();
> >   // Printen resultaten in HTML
> >  print "\n";
> >  while ($line = mysql_fetch_array($resultaat, MYSQL_ASSOC)) {
>
> What you do with this, all depends on how you rewrite your function.  If
> you're passing the identifier, you can leave it as is, if you're passing
> the result data array, you need to get rid of the while loop.
>
> >  print "\t\n";
> >  foreach ($line as $col_value) {
> >  print "\t\t$col_value\n";
> >  }
> >  print "\t\n";
> >  }
> >  print "\n";
> >
> >  In runtime I have the following error
> >
> >   Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> > result resource in
> > /home/schoolre/public_html/Hitek/Online/Registratie/showPerson.php on
line 8
> >
> > What is wrong?
>
> Alot, I suggest you check out the MySQL functions
>
> http://us4.php.net/manual/en/ref.mysql.php
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com

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



[PHP] Re: Query explanation

2003-10-29 Thread Robb Kerr
On Wed, 29 Oct 2003 17:31:26 +0100, Alexander Mueller wrote:

> 
> Exactly. "a" and "s" are referring to the two tables and are assigned in
> the FROM clause. You could write the query also without the
> abbreviations.
> 
> SELECT state.ID, state.Name, areacode.Code FROM areacode, state
> WHERE areacode.State = state.ID
> ORDER BY state.Name, areacode.Code
> 
> Alexander

Thanx. It looks like I'm actually learning this stuff. hehe
-- 
Robb Kerr
Digital IGUANA

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



[PHP] Re: Posting variable in url

2003-10-29 Thread Alexander Mueller
Frank Tudor wrote:
> 
> I have a redirect that if conditions are right it will pass the
> user to a new page via $_POST.
> 
> I am posting variables in the url and on this next page more
> form stuff awaits the user.
> 
> If a user submits incorrect stuff in the form is posts to
> itself.  The url holds the same variables that were pass through
> the redirect.
> 
> My concern is that if a variable got altered in the URL by
> misstake or on purpose it would post to the refreshed page and
> screw everything up.
> 
> Anyone run into something like this?
> 
> Frank

Either validate the values on each page or create a session and store
them there.

Alexander
-- 
PINO - The free Chatsystem!
Available at http://www.pino.org

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



RE: [PHP] Query explanation

2003-10-29 Thread Pablo Gosse
On Wednesday, October 29, 2003 8:20 AM Robb Kerr wrote:

> I am attempting to hack a tutorial from the Zend site. I have found
the
> tutorial/project to be excellent, but I don't completely understand
what's
> being done in the following Query statement.
> 
> //query database, assemble data for selectors 
> $Query = "SELECT s.ID, s.Name, a.Code " . 
>  "FROM areacode a, state s " . 
>  "WHERE a.State = s.ID " . 
>  "ORDER BY s.Name, a.Code"; 

Hey Rob.  In plain english, what this query is doing is the following:

Selecting ID, Name and Code from the areacode and state tables, where
the State in the areacode table is equal to the ID in the state table.

You are correct in assuming that the "s" in "s.Name" and the "a" in
"a.Code" reference the table from which these fields are retrieved.

So from this, the "a" following the "areacode" table and the "s"
following the "state" table are basically shortcuts for referring to
these tables, as per your assumption.  You could leave it just as "FROM
areacode, state" and  reference the fields as "state.ID" and
"areacode.Code", but this is much more cumbersome.

Not sure I understand what you're asking when you refer to being unable
to find the ID, Name and Code variables initiated in the preceding code.
Can you elaborate on that a little?

Cheers,
Pablo

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



  1   2   >