Re: [PHP] login_script_help needed.

2002-12-01 Thread Andrew Brampton
Well quickly looking at the code I can't see what line is causing the
Warning: Cannot add header information
but there have been many discussion explaining why this happens... as for
your
Unknown MySQL Server Host '$198.63.221.3'
the error for that is on the line:
if(!($link_id = mysql_connect($198.63.221.3, $Ultimatefootball,
$kjames1973))) die(mysql_erorr());
I think the line would look better like:
$link_id = mysql_connect('198.63.221.3', 'Ultimatefootball', 'kjames1973')
or die(mysql_erorr());

(might be a good idea to change your password now btw (since you have shown
everyone))

Hope that gets you started
Andrew
- Original Message -
From: "Karl James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 01, 2002 4:46 AM
Subject: [PHP] login_script_help needed.


> http://www.ultimatefootballleague.com/Create_Account.phps
>
> hey people
>
> I was wondering if anyone can tell me why I cant get this script to
> work.
>
> Or do you have an easier one I can use..
>
> Thanks
> Karl
>


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




Re: [PHP] passing argument between scripts

2002-12-07 Thread Andrew Brampton
try:
require("test/inc/scriptB.php");

I beleive that you may be including scriptB after it has been displayed by
apache (ie with all the PHP executed)

Andrew

- Original Message -
From: "Geert Arts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 4:53 PM
Subject: [PHP] passing argument between scripts


> Hi All,
>
> I use the following, very common construct:
> In script A I do a require of script B:
>
> require("http://www.domain.nl/test/inc/scriptB.php";);
>
> in scriptB I define a constant:
>
> define("CONSTANT_X", "VALUE_1");
>
> I try to use this constant in scriptA, but it seems that the value is not
> passed:
>
> echo(CONSTANT_X); in srciptA
>
> display CONSTANT_X
>
> In scriptB the echo displays the correct value.
>
> My hostprovider has the following setting, which in my view should make it
> possible to pass arguments as
> shown above.
>
> register_globals = on
> safemode = on
> open_basedir refers to the htdoc folder of the domain.
>
> Kind regards,
> Geert Arts
>
>
>
>
> --
> 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] Find Next Integer

2002-12-09 Thread Andrew Brampton
Well that case then
if ($sign = ">")
 ceil($number);
else
 floor($number);

Is that nearer to what you mean?

Andrew
- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "Andrew Brampton" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 8:19 PM
Subject: Re: [PHP] Find Next Integer


> But the problem is, the user may type in a decimal.. I guess I could round
> then add or subtract.. Would that work too?
>
>
> - Original Message -
> From: "Andrew Brampton" <[EMAIL PROTECTED]>
> To: "Stephen" <[EMAIL PROTECTED]>
> Sent: Monday, December 09, 2002 1:14 PM
> Subject: Re: [PHP] Find Next Integer
>
>
> > if ($sign = ">")
> > $number++;
> > else
> > $number--;
> >
> > ???
> > - Original Message -
> > From: "Stephen" <[EMAIL PROTECTED]>
> > To: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Monday, December 09, 2002 5:05 PM
> > Subject: [PHP] Find Next Integer
> >
> >
> > > I have yet another math question. How could you find the next integer
of
> a
> > > number specified? Then how could you tell it to go up or down
depending
> on
> > > if the greater then or less tehn sign was chosen by the user?
> > >
> > > Thanks,
> > > Stephen Craton
> > > http://www.melchior.us
> > >
> > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us
> > >
> > >
> >
> >
>
> --
> --
> > 
> >
> >
> > > --
> > > 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] Spaces

2002-12-09 Thread Andrew Brampton
replace more than 1 space in a row with a  
OR, when outputing their text place a  tag around it

Andrew
  - Original Message - 
  From: Stephen 
  To: PHP List 
  Sent: Monday, December 09, 2002 9:25 PM
  Subject: [PHP] Spaces


  I have a article submission thing where the user types in whatever they want. I've 
already made it so that when the user pushes enter, it saves it as a  for HTML but 
how would I do this for spaces also? I'm storing the contents in a MySQL database...

  Thanks,
  Stephen Craton
  http://www.melchior.us

  "What is a dreamer that cannot persevere?" -- http://www.melchior.us


--


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


Re: [PHP] Fractions

2002-12-09 Thread Andrew Brampton
Well how would you do it on paper?

$numerator = 8;
$denominator = 12;

$factor = 1;

//Start at the greater of the 2, and loop down til you find a common factor
for ($i=max($numerator,$denominator);$i>1;$i--) {
//Check if each number divided by $i has no remainder
if (($numerator % $i) == 0 && ($denominator % $i) == 0) {
//Factor Found
$factor = $i;
break;
}
}

//Now a factor is found, divide by it
$numerator = $numerator / $factor;
$denominator = $denominator / $factor;

echo $numerator . '/' . $denominator;

The method might look like the above

Andrew

- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "Ray Hunter" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 11:20 PM
Subject: Re: [PHP] Fractions


> But how do you find it in PHP?
>
>
> - Original Message -
> From: "Ray Hunter" <[EMAIL PROTECTED]>
> To: "Stephen" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, December 09, 2002 6:12 PM
> Subject: Re: [PHP] Fractions
>
>
> > Just like math...find the greatest common denominator of the numerator
> > and denominator and then divide each (numerator and denominator) by that
> > number...
> >
> > ie: numerator = 8 and denominator = 12
> >
> > so we have 8/12
> >
> > then greatest common denominator is 4...
> >
> > so 8/4 = 2 and 12/4 = 3
> >
> > thus, 8/12 => 2/3
> >
> >
> > On Mon, 2002-12-09 at 15:55, Stephen wrote:
> > > I know for a fact that you're all going to think, "What the heck does
> > > he want fractions for!?" I have a reason...I just won't tell you. :-P
> > >
> > > My problem is this. I want to simplify a fraction to simplest form but
> > > if I divide, I'll get a decimal which I can't use. How could I put it
> > > in simplest form without displaying a decimal to the user and if one
> > > does come up, a mixed number?
> > > Thanks,
> > > Stephen Craton
> > > http://www.melchior.us
> > >
> > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us
> > >
> > > __
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > --
> >
> > Ray Hunter
> > email: [EMAIL PROTECTED]
> > www: http://venticon.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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Variables problem

2002-12-09 Thread Andrew Brampton
The problem is as the error says, totalqty is not the name of one of your
form elements, I think infact you want:

echo "Items ordered: " . $totalqty . "\n";

Since the $_POST is just used to read varibles sent to you from a form,
whereas any other varibles you make ie:
$totalqty = $_POST["tireqty"] + $_POST["oilqty"] + $_POST["sparkqty"];

Can just be referenced with $totalqty (no need for the $_POST)

I hope you understand the different, and that your error was just a typing
mistake..

Happy Coding
Andrew
- Original Message -
From: "Marco" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 09, 2002 9:30 AM
Subject: [PHP] Variables problem


> Hi All,
>
> I'm a newbie and try to learn a little php, so a searched the internet for
> documentation and wow...find a real course.
> Fanatic I typed the code below and ..yes the first part of my form works
> fine:
>
>  My first orderform...looks cool, works fine
> Orderform.html
>
> 
> 
> 
> 
> orderform
> 
> 
> 
> 
> 
> width=150;item
> width=15;Quantity
> 
> Tires
>  maxlength="3">
> 
> 
> Oil
>  maxlength="3">
> 
> 
> Spark Plug
>  maxlength="3">
> 
> 
>  "Submit Order">
> 
> 
> 
> 
> 
> *
>
> Now I'd like to show what my virtual client ordered.works  fine too
>
> *
> 
> 
> 
> Bob's Auto Parts - Order Results
> 
> 
> Bob's Auto Parts
> Order Results
>  echo "Order processed at ";
> echo date("H:i, jS F");
> echo "";
> echo "Your order is as follows:";
> echo "";
> echo $_POST["tireqty"]." Tires";
> echo $_POST["oilqty"]." Bottles of oil";
> echo $_POST["sparkqty"]." Sparks";
> ***
>
> Now I'd like to show what my virtual client has to payand there it
goes
> wrong :-((
> *
> define("TIREPRICE", 100);
> define("OILPRICE", 10);
> define("SPARKPRICE", 4);
> $totalqty = $_POST["tireqty"] + $_POST["oilqty"] + $_POST["sparkqty"];
> $totalamount = $_POST["tireqty"] * TIREPRICE + $_POST["oilqty"] * OILPRICE
+
> $_POST["sparkqty"] * SPARKPRICE;
> $totalamount = number_format($totalamount, 2);
> echo "\n";
> echo "Items ordered: ".$_POST["totalqty"]."\n";
> echo "Subtotal: $".$_POST["totalamount"]."\n";
> $taxrate = 0.10; // local sales tax is 10%
> $totalamount = $totalamount * (1 + $taxrate);
> $totalamount = number_format($totalamount, 2);
> echo "Total including tax: $".$totalamount."\n";
> ***
> I see the following errors:
>
> 
>
> Notice: Undefined index: totalqty in processorder.php on line 29
> Items ordered:
>
> That's in this rule:
> echo "Items ordered: ".$_POST["totalqty"]."\n";
>
> and..
>
> Notice: Undefined index: totalamount in processorder.php on line 30
> Subtotal: $
> Total including tax: $3.30
>
> That's in this rule:
> echo "Subtotal: $".$_POST["totalamount"]."\n";
>
> *
> What went wrong, can someone help me with this..??
>
> Tanks for reading
>
> Kind regards
>
>  Marco
>
>
>
> --
> 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] FTP UPLOAD

2002-12-16 Thread Andrew Brampton
Well I think the error is telling you whats up
The file
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt
Doesn't exist

Try changing the line to something like this:
$source_file = $HTTP_POST_FILES['thefile']['tmp_name'];

This or
$source_file = $_FILES['userfile']['tmp_name'];
(if you are using the more lastest PHP version)

Hope this helps

Andrew
- Original Message -
From: "Marios Adamantopoulos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 16, 2002 12:11 PM
Subject: [PHP] FTP UPLOAD


Hi all
I have a problm uploading a simple file to my server using the PHP FTP
functions.
I would appreciate it if anyone could help:

The HTML part:


Upload file :





The PHP:
(which gives me the error: (Warning: error opening
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt in
/home/virtual/site490/fst/var/www/html/ftp/ftp.php on line 90 - the line
with the ftp_put() function)


$picture = "thefile_name";
$picture1 = $$picture;
$theimage = $picture1;

$source_file =
"C:\\Inetpub\\wwwroot\\mario\\phpftp\\phpftp\\FTPonline\\" . $theimage;

$destination_file = "/var/www/html/ftp/" . $theimage;

$upload = ftp_put($conn_id, $destination_file, $source_file,
FTP_BINARY);


// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded $source_file to $ftpServer as
$destination_file";
}

_
Marios Adamantopoulos
Senior Developer

Tonic
+44 (0)20 7691 2227
+44 (0)7970 428 372
www.tonic.co.uk

Recent projects
www.polydor.co.uk
www.adcecreative.org
www.sony-europe.com/pocketlife


Opinions, conclusions and other information in this message that do not
relate to the official business of Tonic Design Limited shall be
understood as neither given nor endorsed by them.




-Original Message-
From: Chris Hewitt [mailto:[EMAIL PROTECTED]]
Sent: 16 December 2002 11:54
To: Miguel González Castaños; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Mail() Not working right


Miguel González Castaños wrote:

>I am testing the php mail function with the typical script
>
>$mailsuccess = mail(...);
>if (!$mailsuccess) {
>echo "Mail could not be sent";
>}
>
>In one redhat linux box I got that the email was sent succesfully and
>in the other box, it cant send it, but the script is executed (no parse
>errors).
>
>I have sendmail 8.11-2 and php 4.1.2.
>
>As i have said in my other email, I have checked if I have set properly
>the nobody privileges to execute sendmail and set the smtp and
>sendmail_path variables in the php.ini.
>
>Do you know how I could figure out what is going on? Any way of
>debugging or testing?
>
What does the mail log say? Its usually /var/log/maillog. You say that
the email is not sent, but what error message do you get? I think we
need to know a little more about the error.

HTH
Chris

>


--
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] Sound with PHP

2002-12-19 Thread Andrew Brampton
If you are trying to play the sounds on the client's PC, then you can't do
this with PHP

PHP is a server side language, so if you tried playing soudns with it, it
would only be heard by the people standing next to your server :)..

You might want to take a look at some HTML or JScript, or Flash, or many
other methods of playing music. (which are all client side "languages")

Andrew
- Original Message -
From: "Alfonso Ballesteros" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 8:02 PM
Subject: [PHP] Sound with PHP


> Hello... I'm a newcomer and wish to know if it is possible to play sound
> files (mp3 or wav) using PHP. For example, if I have 2 sound files, how to
> play one after the other.
>
> Thanks
> Alfonso
>
>
>
> --
> 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] forum?

2002-12-24 Thread Andrew Brampton
phpBB2 www.phpbb.com

Or do what another poster suggested and google for it

Andrew
- Original Message -
From: "Fatih Üstündað" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Tuesday, December 24, 2002 2:51 PM
Subject: [PHP] forum?


> do you know freeware forum in php I can easly use?
>
> thanks.
> fatih ustundag
>
> --
> 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] objects within arrays

2002-12-24 Thread Andrew Brampton
Big guess but I think maybe:

$header[0]->from['mailbox'];

Also I suggest you turn your PHP Error Level up to E_ALL in your php.ini
file (or temporarly at the top of your scripts with error_reporting
(E_ALL);, this will help debug programs like this :))

Andrew
- Original Message -
From: "Beth Gore" <[EMAIL PROTECTED]>
To: "PHP General List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 24, 2002 6:42 PM
Subject: [PHP] objects within arrays


> Hi,
>
> I'm really struggling with this - I'm writing a simple webmail client
> for myself (because they've blocked the common ones at work hehe)
>
> Anyway, as soon as I tried to access..
>
> $header = imap_header($inbox,$msgID);
>
> $header->from['mailbox'];
>
> ... I get nothing.
>
> I did a print_r on that, and I got..
>
> Array ([0] = StdClass Object([personal] = "blah" ); etc...
>
> so how do I access the data within the Object bit? a simple
> $header->from['personal'] refuses to output anything.
>
> Sorry to be a pain again, I know this is simple language stuff but I
> can't find it in the manual. :)
>
> Beth Gore
> --
> http://www.habitformer.co.uk
>
>
>
> --
> 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] uploading + downloading Large files ...

2002-12-27 Thread Andrew Brampton
There is a limit in the php.ini saying how big a upload can be.
Also I beleive there might be a limit in apache, but I'm not sure.

But uploading 100mb files over HTTP is a very dodgy thing to be doing, if
anything goes wrong the user has to start again. Downloading 100mb is no
problem, but uploading I would advise you to use FTP or SCP. If you have
problems with them uploading in the wrong place, well how about you have PHP
Script that tells them how to upload, and exactly where to place it,
something as simple as saying upload to ftp://blah.com/yourName/

Hope this helps
Andrew
- Original Message -
From: "Jimmy Brake" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 27, 2002 6:30 PM
Subject: [PHP] uploading + downloading Large files ...


> Hi!
>
> My users need to upload and download large files (100 + megs). Right now
> I only allow 100k to be uploaded. Will I need to do anything to
> php/apache to make sure things continue to be reliable?
>
> My google search only found threads with bad endings and they had much
> smaller files. Should i just make em use ftp or scp? The problem with
> using one of those protocols is that it makes it difficult for the users
> to link the files to the proper account/relation/incident and anything
> that is a problem for users is usually a problem for me.
>
> Thanks!
>
> Jimmy
>
>
> --
> 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] Repeats of values

2002-12-31 Thread Andrew Brampton
Hi,
I think changing
while(list (,$value) = each ($line)) {
to
foreach ($line as $value) {

might help but I'm unsure, either way foreach is easier to read :)

Andrew
- Original Message - 
From: "Anthony Ritter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 31, 2002 4:47 PM
Subject: [PHP] Repeats of values 


> I'm running the following sql query which outputs a repeat value for each
> field in the html cell box.
> 
> Like this:
> ..
> 3.3 3.3 78 78 2002-06-11 2002-06-11
> ...
> 
> which is not what I would like.
> 
> I was trying to get:
> .
> 3.3 78 2002-06-11
> 
> 
> I thought that by dropping off the $key in the $key - $value pair
> to:
> 
> while(list (,$value) = each ($line))
> 
> would accomplish that.
> 
> The SQL query is:
> 
> SELECT level, pm, date FROM daytime WHERE pm >=75
> 
> 
> The php script is:
> 
>  $link = mysql_connect("", "", "")
> or die ("Could not connect");
> mysql_select_db ("water")
> or die ("Could not select database");
> 
> 
> $query = "SELECT level, pm, date FROM daytime WHERE pm >= 75";
> $result = mysql_query ($query)
> or die ("Query failed");
> 
>  // printing HTML result
> 
> 
> print ("Dates where water exceeded 75
> degrees at Callicoon, New York - 2002");
>  print("");
> print "\n";
> 
>  while($line = mysql_fetch_array($result)){
>   print "\t\n";
>   while(list (,$value) = each ($line)) {
>print " size=2>$value\n";
>   }
>   print "\t\n";
>  }
>  print "\n";
> 
> mysql_close($link);
> ?>
> ..
> 
> Any help would be greatly appreciated.
> Happy New Year!
> 
> Tony Ritter
> 
> 
> 
> 
> 
> 
> -- 
> 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] Problem in $_SERVER["PHP_SELF"]

2003-01-02 Thread Andrew Brampton
As far as I'm aware you should be using $_SERVER["PHP_SELF"]  instead of
$PHP_SELF its been like this for a while now.

Andrew
- Original Message -
From: "ªüYam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 02, 2003 6:30 PM
Subject: [PHP] Problem in $_SERVER["PHP_SELF"]


> Before, I was using PHP 4.2.3. There was no problem when I just use
> $PHP_SELF in my script...
> Whereas the problem is found after using PHP 4.3.0.
> There is warning of my script , the warning msg is about undefined
variable
> $PHP_SELF..however, when I try to use $_SERVER["PHP_SELF"] instead of
> $PHP_SELF, there is no problem
> But, that makes me a big trouble if I have to modify all of my scripts to
> solve this problem..Is there any idea to solve this problem, please?
thx
> a lot for any help!
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] PHP complied code

2003-01-02 Thread Andrew Brampton
If maybe you googled, or even read a message posted 4 minutes earier, you
would see there are such programs as:
ionCube PHP Accelerator: www.php-accelerator.co.uk
Zend optimizer/encoder www.zend.com

Andrew

- Original Message -
From: "Manuel Ochoa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 02, 2003 8:46 PM
Subject: [PHP] PHP complied code


>
> I recently read a book on PHP and the author breifly said that if you
compile the PHP code it would improve the performance.
>
> Is there a way to compile the code?
>


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




Re: [PHP] way to insert timer / pause?

2003-01-02 Thread Andrew Brampton
I beleive you can use output buffering to stop anything from being displayed
until the very last moment. Or you can code your page with tables. I know IE
wont' render a table until the last  (I beleive), so this could stop
your html from showing.

Or if there is going to be a long pause, you could make a intermediate page
that displays this will take minute. This page would have a meta refresh
that keeps refreshing itself checking the status of your job. Once the job
is complete on the next refresh it will notice the job is done and voila
display the results.

Andrew
- Original Message -
From: "Jeff Bluemel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 2:56 AM
Subject: [PHP] way to insert timer / pause?


> if there a command, or a way I can put say a 5 second, or a 10 second
pause
> which will make it so it will output x amount of html, and then continue?
> or if I can pause it will it not display any of the html until the entire
> script has ran?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] PHP running perl running java OR PHP running java?

2003-01-03 Thread Andrew Brampton
Try backticks
$yo = `java PFProJava test-payflow.verisign.com 443 ... 30`;
echo $yo;

Andrew
- Original Message -
From: "Sam" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Saturday, January 04, 2003 1:37 AM
Subject: [PHP] PHP running perl running java OR PHP running java?


>
> I'm in way over my head.
>
> the "..." below are where I chopped stuff out for clarity.
>
> The perl script "javatest.pl":
>
> $ENV{LD_LIBRARY_PATH} .=":.:..:../lib";
> $ENV{CLASSPATH} .= ":Verisign.jar:.";
> print `javac PFProJava.java`;
> print `java PFProJava test-payflow.verisign.com 443 ... 30;`;
>
> me% perl javatest.pl
> RESULT= ... Approved&AUTHCODE ...
>
> AND
>
> % java PFProJava test-payflow.verisign.com 443 ... 30
>
> Works at the command line IF the perl script has been ran at least once
from
> the same shell. (Must need to have those environments set maybe.)
>
> STUPID things I've tried in PHP.
>
> 
> Returns nothing.
>
> 
> Nada.
>
>  $cmd = "java PFProJava test-payflow.verisign.com 443 ... 30";
> $yo = exec($cmd);
> echo $yo ;
> ?>
> zip.
>
> Any help would be greatly appreciated.
>
> Sam
>
>
> --
> 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] Second (Bizarre) Question regarding PHP and ASP

2003-01-04 Thread Andrew Brampton
It would look like any other user.
In ASP you will have to check the request's IP (if its static), or you can
use some kind of username/password combinition... Or if you are real lazy
use just a hidden url ie mysite.com/akjdhsanlfas/process.asp

There is no way to tell the page process.php is making the request.

Andrew
- Original Message -
From: "Phil Powell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 04, 2003 11:43 PM
Subject: [PHP] Second (Bizarre) Question regarding PHP and ASP


I don't know how to post this one so I'm sorry for such bizarre
cross-posting, but honestly I don't know where to go for help on this one!

I have process.php that has to call a remote file called process.asp on
another site.

Site 1 has the cookie domain I want (that's where process.php is housed)
Site 2 has the database I need (because I can't obtain a database for Site
1 - Site 2 is where process.asp is housed)

process.php has to do an fopen to process.asp to process username and
password material.  process.asp needs security, obviously, to ensure that
the user is "coming" from process.asp (but he's not because he's doing an
fopen).

in other words, process.php opens up process.asp and returns the evaluation
of process.asp onto process.php

I tried using REQUEST_URI but I didn't get the results I wanted.  How will
process.asp know that process.php called it in order to do what it should
do?

Thanx
Phil


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




Re: [PHP] How to get the mail sending stuff to work on Win2k?

2003-01-05 Thread Andrew Brampton
change that line to your ISPs email server.
OR install a email server locally

Andrew
- Original Message -
From: "Rad Craig" <[EMAIL PROTECTED]>
To: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 11:20 PM
Subject: [PHP] How to get the mail sending stuff to work on Win2k?


> I have a fresh install of PHP on a Win2k server.  It is installed along
with
> MySQL to allow me to run and XMB message base on my website.
>
> Everything works great except for the fact that I never receive any email
> notification when someone replies to a message I (or anyone else) posts.
I
> think the problem is that I don't have the email part of PHP configured
> correctly.
>
> I used the php.ini-recommended file to set it up.  In the mail section it
> says:
>
> SMTP=localhost
>
> There is a mail server on the local host.
>
> Do I have to install a sendmail app to get this working correctly?
>
> Nothing shows up in the event logs.
>
> One more question, when I make a change to that ini file, do I have to
> reboot the machine or just restart IIS?
> 
> Rad Craig
> 
> Rad Craig
>
>
>
> --
> 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] Advanced Search

2003-01-14 Thread Andrew Brampton
$sql = 'SELECT p.* FROM properties p WHERE ';
if(isSet($city))
$sql .= 'city = "' . $city . '" AND ';
if(isSet($sub_name ))
$sql .= 'sub_name  = "' . $sub_name . '" AND ';

//Remove last AND and append 'ORDER by price asc'
mysql_query($sql );


Hope this helps
Andrew

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 4:16 AM
Subject: [PHP] Advanced Search


>
> Hello!
>
> Any quick solutions to this:
>
> if (!$city && !$sub_name && !$address && !$pool && !$waterfront &&
!$waterview
> && !$golf && !$type && !$beds)
> {$result = mysql_query("SELECT p.* FROM properties p ORDER by price
asc;");}
> elseif (!$city && !$sub_name && !$address && !$pool && !$waterfront &&
> !$waterview && !$golf && !$type)
> {$result = mysql_query("SELECT p.* FROM properties p WHERE beds >= $beds
ORDER
> by price asc;");}
>
> I don't want to have to write 50 different ifelse statements unless I have
to.
>
> Please show me the way to make the search more efficient.
>
> TIA
>
> RW
>
>
> --
> 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] Redirecting

2003-01-16 Thread Andrew Brampton
php.net/header
check out the examples

Andrew
- Original Message -
From: "Denis L. Menezes" <[EMAIL PROTECTED]>
To: "PHP general list" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 4:21 PM
Subject: [PHP] Redirecting


Hello friends.

I want ot redirect users to another page after successful login. Can someone
please help me with the PHP code for redirecting? Or point me to some help
page?

thanks
denis


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




Re: [PHP] Does remote file(image) exist ?

2003-01-18 Thread Andrew Brampton
If you looked at the usercomments for file_exists you would see it saying to
look at the fopen page for a example
In the usercomments for fopen there is a post saying this:

jamie.watt at murchison.com.au
03-Feb-2000 01:39
To check if a file exists using http or ftp use the following:


$fp = @fopen("http://www.someurl.com/testfile.php3","r";);
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist"; }


Note: The "@" in front of fopen suppresses the error output of the function.

I hope this clears up some confusion.

There is your answer :)


- Original Message -
From: "Stephen of Blank Canvas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 4:42 PM
Subject: [PHP] Does remote file(image) exist ?


> Hi Everyone,
>
> Sorry I have no example code at all for this at all, I know some people
> don't like that but I just do not know where to start so am asking for
> help.
>
> I have a system there users can put a picture of themselves by method of
> URL in a MySQL field, however many of this image URL's do not work as
> users type them in wrong.  So what I wanted to do was find a way to test
> to see if the image can be accessed, then if not display a default
> image.
>
> Hope that makes sense, anyone already done something like this and want
> to share code :-)
>
> Stephen
>


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




Re: [PHP] HTML embedding

2003-01-30 Thread Andrew Brampton
Try urlencode your data before outputing it.
php.net/urlencode

Andrew
- Original Message -
From: "Todd Barr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 10:11 PM
Subject: [PHP] HTML embedding


> Hello,
>
> I am having an issue.  I am using an access database, where the names have
> whitespace.
>
> Now, when I try to generate a link within the php script I get just their
> first name
>
> But in the link itself I get the whole name
>
> so the html link looks something like this
>
> http://www.whatever.com/dave";>David Bruner
>
> I am using an ODBC connection.
>
> Thanks in advance for any help
>
>
> --
> 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] Graphic Pie Charts

2003-02-02 Thread Andrew Brampton
You will have to look up how to use the GD libraries
Look up Image Functions in the manual... Or you could also google for online
tutorials/classes

Andrew
- Original Message -
From: "Vernon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 1:19 AM
Subject: [PHP] Graphic Pie Charts


> How do I create a graphic pie chart on the fly with PHP. I have already
> figured out how to get the variables from the database and so forth am
just
> looking to create the graphics.
>
> Thanks
>
>
>
> --
> 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] Making /something/blah work instead of /something.php/blah

2003-02-04 Thread Andrew Brampton
Hi,
I did a bit of googling for this, but I was unsure on what to google for, so
I came up with nothing :(

Anyway I have a 3 servers, windows, freeBSD, and my web hosts.
I have used the following style URLs for many of my scripts, ie:
www.mysite.com/something/blah/blah/blah
where something is actually something.php and then I just parse out the
blahs... This has worked on my webhost and my windows box without any
special tweaks.
I have no recently set up a freeBSD server with php and everything runs
great, but I only noticed today that it doesn't accept these kind of URL and
instead returns a 404 /something/blah/blah/blah is not found.
If I try
www.mysite.com/something.php/blah/blah/blah
It works as expected, but I don't really want to keep the .php in the URL
(just to make things look prettier/smaller)

So I was wondering if anyone knows what I need to change on my default
apache+php install. Here are my versions:
WinXP + Apache 1.3.27 + PHP 4.3.0 (Works Here)
FreeBSD 4.7 + Apache 1.3.27 + PHP 4.2.3 (Fails Here)
WebHost some BSD + Apache 1.3.22 + PHP 4.1.0 (Works Here)

Thanks for any help or links to useful pages.

Andrew


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




Re: [PHP] Execute at a defined time

2003-02-05 Thread Andrew Brampton
If you have PHP compiled as cgi then you can run something like:
php /path/to/my/script.php
or if you can request the page via your website with something like:
lynx -dump "http://your site.com/yourscript.php"

Also if you want to know how to use cron, try typing "man cron" in your
shell

Hope this helps
Andrew
- Original Message -
From: "Miguel Brás" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 05, 2003 1:49 PM
Subject: [PHP] Execute at a defined time


> Hi,
>
> I was looking on PHP manual but didn't find anything about it.
>
> How can I execute a script all days at the same time? I kno i must have
> access to the CRON of the system, but don't know what function should I
use
> to make this happen (run the script).
>
> Miguel
>
>
>
> --
> 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] Files upload

2003-02-09 Thread Andrew Brampton
I beleive move_uploaded_file is prefered since copy won't work in Safe Mode.

Andrew
- Original Message - 
From: "Max 'AMiGo' Gashkov" <[EMAIL PROTECTED]>
To: "PHP General list" <[EMAIL PROTECTED]>
Sent: Sunday, February 09, 2003 6:09 PM
Subject: [PHP] Files upload


> Is there any difference between using
> 
>move_uploaded_file(...
> 
> or
> 
>   if(is_uploaded_file...
>   ...
>   copy(
> 
> (security hazards etc.)?
> 
> 
> WBR, Max 'AMiGo' Gashkov
> [EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo
> Distributed.net participant [408228][RC5-72]
> 
> 
> -- 
> 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] Counter has gremlins

2003-02-17 Thread Andrew Brampton
I believe this is a concurrency problem...
2 PHP scripts can run at the same time and the problem is that your first
script gets as far as the unlink thus deleting the file. Then the 2nd script
is ran (at the same time) and trys to open the file which doesn't exist,
therefore it reads a num of 0. Then control returns to script 1 which saves
the number num (which is a valid count), and finish... Script 2 continues
and saves the num 0, and therefore your counter gets reset.

Its all a problem of concurrency and the fact that more than one thing can
happen at a time.

There are a few solutions.
1) Use MySQL or another database which limits reading/writing to the data so
that problems like this do not occur.
2) Use a flocking method which locks the file between the reading and
writing so that no other script can interfeare... I'm unsure on how good
this method is with PHP, so I suggest the first.

Andrew

- Original Message -
From: "Brian V Bonini" <[EMAIL PROTECTED]>
To: "PHP Lists" <[EMAIL PROTECTED]>
Sent: Tuesday, February 18, 2003 12:45 AM
Subject: [PHP] Counter has gremlins


> I have this basic counter:
>
>  $counterFile = "./counter.txt";
> function displayCounter($counterFile) {
> global  $counted;
> $fp = fopen($counterFile, 'rw');
> $num= fgets($fp,7);
> if (!$counted) {
> $num+= 1;
> unlink("$counterFile");
> exec("echo $num > $counterFile");
> }
> print "Visitor #$num";
> }
> if (!file_exists($counterFile)) {
> exec("echo 1 > $counterFile");
> }
> displayCounter($counterFile);
>
> ?>
>
> Works like a charm but every so often for no apparent reason it resets
> to 0.
>
> Anyone see anything wrong here to cause that?
>
>
> --
> 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] test for rtf

2003-03-07 Thread Andrew Brampton
Not to sure on the RTF file format, but checking the first few letters might
help
Quickly opening a RTF file I see that they start with {\rtf
Maybe look for that.

Andrew
- Original Message -
From: "bill" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 4:22 PM
Subject: [PHP] test for rtf


> Is there any way to test a file to confirm it is an RTF file?
>
> I'm thinking along the lines of how we can test for an image with
> getimagesize().
>
> kind regards,
>
> bill
>
>
> --
> 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] Protecting files with PHP

2003-07-17 Thread Andrew Brampton
Place a .htaccess in the files directory denying all access to it, and also
possibly redirecting them to a login page. However since your users should
never know about the files/ directory there is no real point :)

Then code a PHP script to serve the files just in the same way you would if
they were outside of the public_html.
Since your PHP script will be reading the files from the file system they
will have no problem accessing the files and serving them out.

Hope that helps.

Andrew
- Original Message -
From: "Maria Garcia Suarez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 17, 2003 2:58 PM
Subject: [PHP] Protecting files with PHP


> Hi there!
>
> I'm developing an application to which you can upload
> files. Right now the destination folder of those files
> is at /public_html/files which makes them visible from
> the internet.
>
> I thought of putting that ./files/ folder outside the
> ./public_html/ folder and make those files be only
> accessible via PHP pages (if the pages doesn't display
> a link to that folder there's no way to download the
> file). But, there's any way to keep on having the
> ./files/ folder inside ./public_html/ and have those
> files protected? Right now to identify users
> (authenticate them) I use session variables... it
> should be a protection that could be used together
> with session variables
>
> Thanks a lot.
>
> Kisses,
> Maria
>


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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Andrew Brampton
Just a minor change, the HTTP Specification says that the Location header
should use a absoluteURI which includes the full URL not just page.php... so
http://yoursite.com/page.php is what you should be using there.

Andrew
- Original Message -
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Petre Agenbag" <[EMAIL PROTECTED]>; "Beauford.2005"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 8:56 PM
Subject: RE: [PHP] I'm really getting annoyed with PHP


Petre Agenbag 
on Wednesday, July 23, 2003 12:55 PM said:

> If you want to "use PHP", then you must use the headers() function.
> BUT, with the header function, you MUST make sure that there will be
> absolutely NO output to the page before the header() function is
> called, not even a space...

If there is a "even a space" you can turn output buffering on so that
the redirect will still work.



will work just fine.


chris.

p.s. exactly what is the code you are using in your script that's not
working? and what browser are you using?

--
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] FTP - Can't build data connection

2003-07-26 Thread Andrew Brampton
This would happen when a incoming or a outgoing port 20 (FTP Data)
connection can't be made.

I don't know how PHP ftp functions work but normally the FTP client makes a
outgoing connection on port 21, and then the FTP Server makes a incoming
connection from port 20 when any kind of data is sent (ie directory
listings, or files)

So I'm guessing that the web server that you are running ftp_put on doesn't
allow incoming connections...
You can try getting around this by setting PHP to use Passive mode, which
makes the FTP client connection out to port 20 on the FTP server. A quick
look at the manual says that you should use ftp_pasv to make that happen.

Hope this helps
Andrew
- Original Message -
From: "Suhas Pharkute" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 11:29 PM
Subject: [PHP] FTP - Can't build data connection


Hi

I am writing a FTP application. When I upload a file I am getting following
error,

Warning: ftp_put(): Can't build data connection: Connection refused.

There is no error for connection/login to ftp site.

can any one help?

Thanks,
Suhas


_

Encrypt your PHP code for FREE at

http://encphp.sspsoft.com

_


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



Re: [PHP] replacing & but not special chars

2003-07-27 Thread Andrew Brampton
How about you decode the string, and then encode it like so:
$decode = html_entity_decode($input);
$output = htmlentities($decode);

If you have the string
ab&something&blah
the decode will turn that into
ab&something&blah
and then encode it into
ab&something&blah

This can run into problems, but they will be just the same problems you
would receive with any other method... The problem I speak of is when your
input string is "something&" and & isn't a HTML Entity but the
proper string just so happened to have a & in it just before the amp... In
that case the amp; would be incorrectly removed... However the chances of
having a string that matches a HTML entity with a "bad" & placed in front of
it are so high that you shouldn't worry (and you did mention it was a URL,
so as far as I know ; can't appear in a valid URL, so I don't think you
should worry at all :))... And if you are worrying then any method you chose
will have this problem and you should do the task by hand :)

Hope this helps
Andrew

- Original Message -
From: "Shawn McKenzie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 27, 2003 8:36 AM
Subject: [PHP] replacing & but not special chars


> I have some URLs in hrefs that have an &.  This does not validate HTM4.01
> transitional, so I want to replace them with &
>
> So I buffer the output and do a replace, but suppose there is already an
> & then I get & or if I have anything else like " then I
get
> "
>
> Any ideas on how to do this the right way???
>
> Thanks!
> Shawn
>
>
>
> --
> 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] POST/GET using a proxy server

2003-07-27 Thread Andrew Brampton
Something like so:

/* sendToHost
 * ~~
 * Params:
 *   $proxy - Proxy you want to use
 *   $host  - Just the hostname.  No http:// or
  /path/to/file.html portions
 *   $method- get or post, case-insensitive
 *   $path  - The /path/to/file.html part
 *   $data  - The query string, without initial question mark
 *   $useragent - If true, 'MSIE' will be sent as
  the User-Agent (optional)
 *
 * Examples:
 *   sendToHost('webcache', 'www.google.com','get','/search','q=php_imlib');
 *   sendToHost('localhost', 'www.example.com','post','/some_script.cgi',
 *  'param=First+Param&second=Second+param');
 */

function sendToHost($proxy, $host,$method,$path,$data,$useragent=0)
{
// Supply a default method of GET if the one passed was empty
if (empty($method)) {
$method = 'GET';
}
$method = strtoupper($method);
$fp = fsockopen($proxy, 8080);
if ($method == 'GET') {
  $path .= '?' . $data;
}
fputs($fp, "$method http://$host/$path HTTP/1.0\r\n");
fputs($fp, "Host: $host\r\n");
if ($useragent) {
  fputs($fp, "User-Agent: MSIE\r\n");
}
if ($method == 'POST') {
  fputs($fp,"Content-type: application/x-www-form-urlencoded\r\n");
  fputs($fp, "Content-length: " . strlen($data) . "\r\n");
}
fputs($fp, "Connection: close\r\n\r\n");
if ($method == 'POST') {
fputs($fp, $data);
}

while (!feof($fp)) {
$buf .= fgets($fp,128);
}
fclose($fp);
return $buf;
}

I've not tried this code, but I think I got it right :)
Also please note that this connects to proxys on port 8080, you might need
to change that.
Oh and I changed the http/1.1 to 1.0 because I find it has less problems :)

Hope this works/helps
Andrew
- Original Message -
From: "David Yee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 28, 2003 3:44 AM
Subject: [PHP] POST/GET using a proxy server


> Hi all- how do I modify the following function to work over a proxy
server?
> Thanks for any help.
>
> David


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



Re: [PHP] fpdf

2003-07-30 Thread Andrew Brampton
The way I would do it is I would make the Save button (or link) point to
display.php?save... Now in the display.php I would have it figure out if
save is in the URL, if it is then it should output a pdf file instead of a
html file.

This does however mean that your query is done twice (once for seeing the
results with the save button at the bottom, and then again when you hit
save) If you only want your query run once then you must save the pdf on
the first attempt and then set the link to something like
/someUniqueNumber/file.pdf

Does that make sense?

If you need more guidance just email me.

Andrew

- Original Message -
From: "Mukta Telang" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Thursday, July 31, 2003 11:27 AM
Subject: [PHP] fpdf


> Hi,
>  I want to display the results generated by the query and generate a pdf
>  document (using fpdf) for the users to save. The user should be able to
> save
>  it by clicking on a save button. I have a script called display.php
> which
>  displays the result of the query..now I want user to be able to save by
>  pressing save button. That is I want to do this in the display.php
> script
>  itself, because the result of the query is too large to POST to another
>  script.
>  If I do:
>  $pdf->Output("/tmp/new.pdf"); then I can save the pdf document..but I
>  want this to happen only if the user clicks on save button and he/she
>  should be able to download it by doing so.
>  How to do this?
>  Thanks in advance,
>  Mukta
>
> --
> 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] Pushing array onto array

2003-08-02 Thread Andrew Brampton
Well I just coded up a very small example, and it pushing 1 array into the
other...

Check out: http://81.102.229.151/push.php and
http://81.102.229.151/push.phps

It works exactly how it should... However really the array isn't a 2
dimensional one, since PHP doesn't have them, its rather a array of arrays
which is roughly the same thing (and something not to worry about)...

If you need more help just email me
Andrew
- Original Message -
From: "Hank TT" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Saturday, August 02, 2003 7:58 AM
Subject: [PHP] Pushing array onto array


> In comparing Perl's push to array_push in "PHP Developer's Cookbook" (2/e,
> p. 76), the authors note that pushing an array onto another produces a
> two-dimensional array.  However, I have not been able to reproduce their
> example result, and php.net/array_push does not document this behavior.
>
> Just curious.
>
>
>
> --
> 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] CRC and Polynomials

2003-08-24 Thread Andrew Brampton
I found this mentioned in a old user comment (it might not be relevant now):
"Some quick reverse engineering shows they're using the standard CRC32
parameters:

Polynomial 0x04C11DB7l
Initial register value 0x
Register is inverted at end of calculation
Bytes are reflected as they come in, and the result is reflected before it
is returned.

The documentation says this function returns the CRC polynomial of the
string - that's a little misleading IMHO. I'd say it simply returns the CRC
of the string. The polynomial is a magic number in the calculation."

and I've just downloaded the lastest source and found the crc32 function to
be in crc32.c and crc32.h. In the comments it mentions that the polynomial
is
/* generated using the AUTODIN II polynomial
 * x^32 + x^26 + x^23 + x^22 + x^16 +
 * x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
 */

and there is a big table of 256 number which you may find useful.

Oh finally I also found mentioned in the NEWS file that:
"- Added a crc32 checksum function - used by the UdmSearch search engine
  and currently run through a system call.  This will speed up the UdmSearch
  php frontend significantly. (Rasmus)"

Which seems to be called udm_crc32, and so far undocumented.

I hope this information has been useful.
Andrew
- Original Message -
From: "Methusula" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 1:01 PM
Subject: [PHP] CRC and Polynomials


> Hi,
>
> Can anyone tell me which 32-bit polynomial is used by PHP in the crc
> function? I am trying to write a crc function from scratch, however, php
> does not appear to use any of the most commonly used polynomial divisors.
>
> Methusula.
>
>
>
> --
> 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] Humour in programming?

2003-04-01 Thread Andrew Brampton
The image is stored locally inside your compiled php binaries.
php returns a image instead of parsing the script if the query string is one
of the following:
?=PHPE9568F34-D428-11d2-A769-00AA001ACF42
?=PHPE9568F35-D428-11d2-A769-00AA001ACF42
?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
Try appending that string to one of your sites and magically it starts
returning a image instead of what you expected.
Actually this seems a really good way to see if a site is running PHP or
not...

Andrew
- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "Aaron Gould" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 9:43 PM
Subject: Re: [PHP] Humour in programming?


> The image is grabbed from their servers.
>
> - Original Message -
> From: "Aaron Gould" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, April 01, 2003 1:36 PM
> Subject: Re: [PHP] Humour in programming?
>
>
> > Hehe, I though something was wrong with my machine when I checked out
> > phpinfo() on one of my boxes today.  It didn't even occur to me that it
> > might be related to April Fools.
> >
> > I know it's usually the PHP logo, but how is that picture generated
> anyway?
> >
> > --
> > Aaron Gould
> > Web Developer
> > Parts Canada
> >
> >
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, April 01, 2003 3:32 PM
> > Subject: RE: [PHP] Humour in programming?
> >
> >
> > > Yeah...check out the phpinfo() function on your machine
> > >
> > > 
> > >
> > > -Original Message-
> > > From: Liam Gibbs [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, April 01, 2003 3:36 PM
> > > To: php list
> > > Subject: [PHP] Humour in programming?
> > >
> > >
> > > Sorry if this is OT, but... heheheh... has anyone taken a look at the
> > > PHP site? Check out the upper-left corner. Who is that? Nice to know
> > > the guys at PHP can have a laugh.
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



Re: [PHP] Finding the height of a JPG in pixels using PHP

2003-04-05 Thread Andrew Brampton
You can use getimagesize on a jpg file to read its size, so either save the
jpg in MySQL to a file and then do a getImageSize, or before you place the
jpg in to the database read its size and store its dimensions with it in the
db.

Andrew
- Original Message -
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 05, 2003 10:46 AM
Subject: [PHP] Finding the height of a JPG in pixels using PHP


> I have JPG files stored as binary in a MySQL database.  I am displaying
the
> JPGs on the screen and also want to know the height (in pixels) of the
JPG.
> Can PHP do this?
>
>
>
> Thanks!
>
>


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



Re: [PHP] Re: Q:What is the easiest way to test my PHP+Html pages?

2002-07-27 Thread Andrew Brampton

Just install apache (for windows), MySQL (for windows), and PHP... voila a
local webserver, and the only way to view your pages, no need to upload
since you can point your webserver to where you are developing your php.

andrew
- Original Message -
From: "Marcus Unlimited" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 27, 2002 3:56 PM
Subject: [PHP] Re: Q:What is the easiest way to test my PHP+Html pages?


> I guess I should reiterate;
>
> "What is the easiest way to test locally (on my desktop) without having to
> upload?"
>
> Thanks,-Marcus
>
> Tim Luoma wrote:
>
> > Marcus Unlimited wrote:
> >
> > > So what is the absolute simplest and easiest path to open my .html
pages
> > > with some php mysql in em. and see them as they will work on the
web???
> >
> > To quote a friend of mine: "The only way to see how this will work is to
> > see how this will work."
> >
> > Get some server space with the software installed, and play with it.
> >
> > There's free space available for this purpose at http://www.evolt.org
> > and http://f2o.org/ and I'm sure others as well, but it's best if you
> > can setup a little 'sandbox' to play in on the actual machine that you
> > are using so that you are testing on the same versions, same config that
> > you will be running on.
> >
> > TjL
>
> --
>

||
>
> Marcus Unlimited
> http://marcusunlimited.com
> Multimedia Internet Design and Education
>

||
>
> ---
> Also visit:
> -  http://www.chromaticus.com
> -  http://ampcast.com/chromaticus
>
>
>
> --
> 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] php3 to php4 migration woes

2002-07-31 Thread Andrew Brampton

Since 4.1.? the way things worked changed... Instead of using $album you
need to use $_GET['album']
you can default back the old behaviour with a php.ini change, but the new
way is prefered

andrew
- Original Message -
From: "Bruce Riddle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 4:20 AM
Subject: [PHP] php3 to php4 migration woes


> x86-3 being added to access control list
> I've recently updgrade my Apache Webserver to
> 1.3.26 and opted to upgrade php form 3.x.x to 4.2.2.
> I have succesfully built it all and things are stable.
>
> I have been running the "album" picture database which
> is included as an example with the php3 distro.
>
> Well this is now broken with php4.
> What apears to be happening is the query string
> is not being processed.
> For example if I have the simple phpscript
> test2.php which looks like:
>  $url=parse_url($_SERVER["REQUEST_URI"]);
> echo "QUERY_STRING= $url[query]";
> $url[query];
> echo "Album= $album";
> ?>
>
> and call this with something like
>
> http://foo.bar.com/test2.php?album=sunsets
>
> It echoes out the query string but the
> variable album remains unset.
>
> This same script works just fine if accessed
> against my php3 enabled apache server.
>
> Can anybody explain why this is happening?
> Did I miss some configuration somewhere.
>
> Oh yeah, this is all on Solaris.
>
> Rgds,
>
> Bruce Riddle
>
> --
> Can marketing and reality really coexist ?
>
> --
> 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] .htaccess

2002-08-02 Thread Andrew Brampton

place a phpInfo() page behind the .htaccess and you will see what varibles
php has :)
I'm pretty sure there is ones contianing the username/password that was
entered

Andrew
- Original Message -
From: "Oliver Witt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 3:21 PM
Subject: [PHP] .htaccess


> Hi!
> Using an .htaccess file to limit access to some web files, is there a
> way to get the name and password into a variable used by a user to log
> on?
> Kind regards,
> Oliver
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] PHP Hosting

2002-08-02 Thread Andrew Brampton

This has been discussed in great detail before..
but the simplist solution is running PHP in safe mode, it does limit the
user to certain things, but it stops them bringing the server down or
altering others files

andrew
- Original Message -
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 02, 2002 2:04 PM
Subject: [PHP] PHP Hosting


> If any PHP hosts are out there I have a question:
>
> How do you keep users from erasing / altering files out side of their
> web folder with PHP? Doesn't PHP run in the system user context? Is is
> possible to prevent a user from using PHP to alter anything but in their
> Web folder?
>
> Matt Babineau
> MCWD / CCFD
> -
> e:   [EMAIL PROTECTED]
> p: 603.943.4237
> w:   http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>


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




[PHP] Safe Mode seems to turn on and off randomly

2002-08-03 Thread Andrew Brampton

Hi,
I was discussing with a friend at a webhost I use and they have been experience a 
wierd problem recently with their php safe mode, I went to help and after spending a 
while in the bug database I couldn't find anything to explain it.

Basically every time you view a phpinfo page it will randomly change the local setting 
for safe mode from on or off, where the global setting is allways on... We also found 
out that if you run a php script 1000 times echoing the state of safemode it is 
constant for out the execution of the script, but it might change the next time we 
re-fresh the page.

The servers which are affected are using Plesk which is a control panel thing which 
basically bundles freeBSD, apache, php, mysql together with a PHP front end for users 
and admins...The current version of the software is as follows:

PHP 4.1.0
Apache 1.3.22
FreeBSD 4.1-RELEASE 
(The builds would be newer but this is what the lastest Plesk provides)

I was wondering if anyone could have a explaination for this bug, if you want to see 
it for yourself check out my http://www.lusernet.34sp.com/phpInfo.php page. Since I'm 
not a admin of this webhost, and I'm only really doing this because I'm curious as 
well I can't give any more server specific details then what is publicly available on 
the phpInfo page since I don't know them :)

Anyway thanks for any reply
Andrew



[PHP] Vote to ban Acer

2002-08-03 Thread Andrew Brampton

Ok,
I'm not a professional PHP developer, I'm just a plain student that loves PHP, I don't 
have the money to spend on Encoders and high end IDEs or whatever is out there, I just 
love the fact that I have a near unlimited supply of software out there which free to 
use, comes with source, and allows me to do what I want with it.

I also love the fact that there are such forums that allow me to ask questions, in 
more recent times be able to answer other peoples questions, I don't have to pay 
50p/minute on a silly tech support line, I just email and I get a response a few hours 
later.

But I am very disappointed by the fact that a flame war is going on in this list. 
Respect the people that have made PHP, the people that have allowed many people to 
become PHP Developers and Professionals and earn a living. And hell if you don't want 
to earn a living then make silly little PHP sites as well that's cool, because Ramus 
(and the others that have helped) have gave me many hours of enjoyment in learning PHP 
and playing with all the cool things it can do. If I ever meet Ramus or any other core 
php programmers I would be sure to go up to them and tell them how amazing they are 
and even buy them a pint...

So Acer please stop abusing these people, who cares if Zend charge lots of money there 
are open source alternatives, if they are not as good as you want then it looks like 
Zend have the monopoly and there is nothing you can do about it. Oh yes there is you 
could write your own under the GPL!

I'm pretty sure there are no rules against b1tching on the lists or even flaming 
others, but I think many people are just shocked at Acer's views on the community and 
frankly I don't want to hear them anymore... so just before I set outlook to block his 
mails would the mods of this be able to remove him and stop him flaming our gods..

Thanks
Andrew



Re: [PHP] which function can do so ?

2002-08-04 Thread Andrew Brampton

I read his question as wanting to know how to figure out the URL of his
site, use the varible $_SERVER['HTTP_HOST'] or $HTTP_HOST on old PHP
versions, that will return the full domain, from the www. to the .com so you
may want to do some spliting of that varible to figure out what just the bit
in the middle is... If you need help doing that just post again :)

Andrew

- Original Message -
From: "php @ banana" <[EMAIL PROTECTED]>
To: "PHP-GENERAL" <[EMAIL PROTECTED]>
Sent: Sunday, August 04, 2002 8:19 AM
Subject: Re: [PHP] which function can do so ?


> you mean redirect?
>
> header("Location: www.stuff.com");
>
> make sure it goes before any output to screen or html tags or it won't
> work,
>
>
> >I am exactly a beginner of php. This question may be easy.
> >I have a php program which want to achieve the url from browser.
> >e.g. webmail.xxx.com
> >
> >then how the index.php is able to know it is xxx.com ??
> >which function in php can do so??
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --__-__-__
> eat pasta
> type fasta
>
>
> --
> 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] Case Sensitivity

2002-08-11 Thread Andrew Brampton

Linux file systems are case sensitive... So the file Hello.php is different
to hello.php... Both can exist at the same time and contain different
content, but they are different...On the windows file system files aren't
case sensitive so Hello.php would be the same as hello.php...

So I suggest in your PHP coding that you get all the cases (of files) the
same throughout your app, or if you want to be lazy do what you are doing at
the moment (ie changing the case with strtoupper())

Andrew
- Original Message -
From: "Rich Hutchins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 12, 2002 2:20 AM
Subject: [PHP] Case Sensitivity


> I've had a web site under development on my Win2k box at home. I built and
> tested everything with PHP 4.2.2 and Apache 1.3.24.
>
> Now, I have transitioned everything up to my host who is using a Linux
box,
> PHP 4.2.2 and Apache 1.3.26.
>
> One of the pages I designed has code that retrieves a list of thumbnails
> from a directory name passed into the page then embeds a hyperlink to a
full
> size version of the thumbnail. Incidentally, the full size version is in
the
> same directory as the thumbnail and has a very similar filename:
> tn_01.jpg and 01.jpg (guess which one's the thumbnail).
>
> Here's the problem:
> When I run the page on the web host's server, the link to the full size
> image dies. I've tracked the problem to the case of the linked filename.
> Basically, unless the filename in the href matches the case of the target
> file, the link dies and I get that nice, little red X indicating the link
to
> the image is broken.
>
> For example, the target image DSC01.JPG _MUST_ be referenced in the
href
> as: href='../path/to/resource/DSC01.JPG' If I reference it as
> href='../path/to/resource/dsc01.jpg' the target image won't show up.
>
> I have temporarily resolved the issue by designating the filename used in
> the href as upper case using the strtoupper() function, but I can't
believe
> that's the way it's SUPPOSED to be done.
>
> What I'd like to know is does the Linux server introduce case-sensitivity
> issues? It doesn't seem to matter with the elements of the path, just the
> target filename.
>
> Help is appreciated.
>
> Rich
>
>
> --
> 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] Making PHP faster?

2002-08-12 Thread Andrew Brampton

I don't know any good ways of making PHP go faster, but may I suggest that
the time you use in coding and figuring out ways to make PHP faster would be
greater than the time you have saved by using such features...

If this is a one of thing I think 30minutes is better than 15minutes plus
60minutes of code changes/tweaks..

Just my 2c
Andrew
- Original Message -
From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 13, 2002 4:39 AM
Subject: [PHP] Making PHP faster?


> I'm using PHP to load data into a PostgresQL database. The script works
> fine but it is a bit slow. It's taking about 30 minutes to load about
> 15,000 items. This is mainly because of all the error checking and many
> redundant queries I am running.
>
> This program is a one-off thing.
>
> Are there any simple ways for me to make PHP run faster? I'm already
> using persistent DB connections. I was thinking along the lines
> increasing it's memory usage, turning off error checking, getting it to
> optimize the code on the fly, etc ...?
>
> Thanks!
>
> Jc
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] PHP-Ebay Interface

2002-08-13 Thread Andrew Brampton

Well not a legal idea no :)

Andrew
- Original Message - 
From: "Adam Voigt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 13, 2002 4:52 PM
Subject: [PHP] PHP-Ebay Interface


> Anyone have any idea how to easily
> interface with the Ebay engine other
> then with the expensive developer
> subscription?
> 
> Adam Voigt
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] requesting sites running OS X

2002-08-13 Thread Andrew Brampton

A good reference I can point you to is Netcraft.com, they record what
OS/Webserver 1000s of sites are using, you can type in a website name and it
will tell you all sorts of stats... Usally it will also tell you other
similar sites running on the same OS and or Server... but for some reason it
doesn't show other MacOSX websites... But if you want to guess a few than
you can check...

I know that apple.com is MacOSX :)

Andrew
- Original Message -
From: "Michael Geary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 13, 2002 5:28 PM
Subject: [PHP] requesting sites running OS X


> Hi All,
>
> I have been asked by a rep at a large software dev company about any
> websites live-to-the-world running OS X. We are, but we're not exactly
> huge (max hits/day = approx. 1000, mostly internal).
>
> So, what sites are you aware of? They don't even have to be running PHP.
> Please let me know.
>
> -michael
>
>
> --
> 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] Shared network server failing to include files

2002-08-14 Thread Andrew Brampton

Hi, I don't think this is a PHP question, but the line
Alias /cs/ //192.168.0.253/apachedir/
try
Alias /cs/ \\192.168.0.253/apachedir/

Because //isn't valid for UNCs, but \\ is..

If this doesn't work, then with dos map \\192.168.0.253/apachedir/ to a
network drive and point apache at that

Andrew

- Original Message -
From: "Julio Nobrega" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 14, 2002 4:58 PM
Subject: [PHP] Shared network server failing to include files


>   Hi all,
>
>   I am not 100% sure if this is a PHP problem, so I apologize in advance
if
> it is an off-topic problem.
>
>   I have a Linux server where I develop my websites. A Windows 2000 takes
> care of our network internet connectivity. I need to show to a client the
> progress of our work, so I've shared through Samba a directory from Linux,
> and installed Apache on the Windows 2000 and used the Alias option to
point
> to this Linux share:
>
> Alias /cs/ //192.168.0.253/apachedir/
>
>   When I access my development website locally, or use a browser and input
> the IP address, everything goes fine. But when I am on the Windows 2000
and
> type:
>
> http://localhost/cs/
>
>   An include error occurs:
>
> Fatal error: Failed opening required 'gerador.inc.php' (include_path='')
in
> //192.168.0.253\apachedir\index.php on line 3
>
>   Anyone knows the fix? Perhaps I should ask what basically I have in mind
> since the beggining: How can I server webpages from a networked Linux
> through the Windows 2000 that is connected to the Internet?
>
>   Any help is sincerely appreciated.
>
>   Thanks,
>
> --
> Julio Nobrega
>
>
>
>
>
> --
> 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] A Doubt!

2002-08-19 Thread Andrew Brampton

In the php.ini file there is somewhere to set the smtp server to use if you
don't have sendmail... Look for that and that might help

Andrew
- Original Message -
From: "Thiruvelraj Pokkishamani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 19, 2002 5:55 PM
Subject: [PHP] A Doubt!


>
>
>   Sir,
>  I am using Windows 2000 server, and i use IIS 4.0 as the
> server and i have done many php scriptings and everything works
> fine and i done have any problem regarding this.
>
>  And i want to send mail to the visitors of this site .
> for that purpose i use mail() and if i click send button i receive
> "server error in D:\inetpub\wwwroot\test\sendmail.php" .
> i have tried many scripts and i receive this error.
>
>  Some  says that i want to configure the server ,
> how to configure and just iam a beginner to this PHP.
> if u help me it could b fine for me to finish this project.
>
> Xpecting ur mail.
>
>  Yours Thankingly
>   Thiruvelraj
>
>
>
>
>
> --
> 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] exec problem

2002-08-27 Thread Andrew Brampton

If you are trying to receive the output of the command line you can use the
backtick notation
$list = `ls`;

Hope that helps
Andrew

"Mark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i'm basicly trying to execute an executeable with this following script.
>
> $command = "../theApp/theapp";
> exec ( $command ,  $ValueIn,  $ValueOut);
> echo $ValueOut;
>
> I'm getting a value of 0 returned, but from a command line the executable
> works fine and does what it is suposed to do is there any other way i can
do
> this or ami i doing it work ??
>
> Cheers
>


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




Re: [PHP] Does this call for an array?

2002-08-28 Thread Andrew Brampton

It calls for a intermediate table.

You need 3 tables:
pf_survey, categories and survey_cat

They look like:
pf_survey
survey_id, Questions, Whatever, but no categories fields

categories
category_id, category_name

survey_cat
survey_id and category_id

for each record in pf_survey you will have one or more records in
survey_cat. Each record in servey_cat will be one of the tick boxes ticked
for that survey_id... so 2 tick boxs, 2 records in survery_cat with the
same survery_id...

When accessing the data you will need to use some different SQL querys
like the JOIN, and/or select more than one table at a time...

This is the correct database relationship way of doing it, but if this is
beyond you a cheap and nasty was would be to either:
A)store a comma delimited list of cat_id in your pf_survey record.
B)create a boolean field for each catorgy in your pf_survey table..

Hope this helps
Andrew

- Original Message -
From: "Duffy Betterton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 28, 2002 2:48 PM
Subject: [PHP] Does this call for an array?


> Here is what I would like to do. I have a simple form that asks for
> information from a customer. One of the questions is Which categories of
> products are you interested in? I want to store all the data in a table
> called pf_survey. All the categories(42) are already listed in a
> separate table called categories. I don't think I want to repeat a list
> of columns in the pf_survey table if they are already in the categories
> table. The categories table is simply category_id and category_name. If
> my form has a checkbox by each category name with the corresponding
> category_id in the value field - how do I concatenate all the boxes
> checked in order to put more than one category_id in the pf_survey
> category_ids field?
>
> Does this call for an array? Does it even make sense to do it like this?
> Thank you for any help.
>
> Duffy Betterton
> Director of Publications
> 615-277-3265
> [EMAIL PROTECTED]
> www.mtadistributors.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] How can I strip the code from HTML pages to extract the contents of a HTML page.

2002-08-28 Thread Andrew Brampton

the striptag function is what I think you want, it just removes all HTML
tags and returns whatever is left
php.net/striptag

Andrew
- Original Message -
From: "Charles Fowler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, August 28, 2002 2:58 PM
Subject: [PHP] How can I strip the code from HTML pages to extract the
contents of a HTML page.


> This may be an interesting challenge for someone or has it been done
> before
>
> Can some one help me.
>
> I am looking for a laboursaving method of extracting the contents of a
> web page (Text only) and dumping the rest of the html code.
>
> I need the contents to rework the pages and put the contents into flat
> file database. Large but only two columns of data. Simple to work with
> (no need for DB) - They are just alot of links on a links page.
>
> Scripts would be welcome.
>
> Ciao, Carlos
>
>
>
>


--
--


> --
> 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] Average Number For Math Functions

2002-08-29 Thread Andrew Brampton

I can't seem to see a pre-built functions but here is one I just wrote in
my email client:

function average($numberArray) {
$sum = 0;
for ($i=0;$i
To: <[EMAIL PROTECTED]>
Sent: Friday, August 30, 2002 1:55 AM
Subject: [PHP] Average Number For Math Functions


Ok I looked at all the math functions for PHP but saw no way of returning
the average of a set of numbers - I plan on using this for a rating
system - any help?

--
John



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




Re: [PHP] few things...

2002-08-31 Thread Andrew Brampton

comments inline
- Original Message -
From: "Matt Zur" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 31, 2002 4:40 AM
Subject: [PHP] few things...


> First of all...
> I'm a bit confused is there really a difference between echo and print?
> They seem to do the same thing?

As far as anyone is concerned they do the same... Check the archives for
MANY MANY past discusions

>
> Also... I have trouble searching for these things in the docs:
> A Call Function to emulate a browser and contact a remote host?  For
> example... to load in a piece of text from another web site?

fopen? here is a quick snip from the user comments $page= join ('', file
('www.yahoo.com')); that basically loads all the HTML at Yahoo.com into
the varible $page... neat huh :)

>
> Hidden fuction.  For example lets say I have a form with 10 variables.
> Is there a function where I can do something like:
>
> hidden($var1,$var2,$var3)  etc etc so it will write this:
> 
> 
> 

PHP doesn't really write HTML for you, thats your job... so a function or
a simple loop could do this...
for ($i=0; $i<3; $i++)
echo "";

>
> Thanks for the help!

No problems :)
Andrew

>
> PHP Toolbar for Homesite v5.0 - http://zurnet.com/dl/hsphptb/
> Version 1.5 Coming Soon!!!
>
>
>
> --
> Matt Zur
> [EMAIL PROTECTED]
> http://www.zurnet.com
>



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




Re: [PHP] Download site down?

2002-08-31 Thread Andrew Brampton

It seems that php.net does load balancing of its downloads and every time
you open the downloads page it displays downloads from different
mirrors... so keep refreshing http://www.php.net/downloads.php until you
find a mirror which works for you.

Usually all the mirrors work first time but I did find the other day that
I wasn't able to download the PHP Source from one of the mirrors, but a
quick refresh of the download page supplied me with a working mirror :)

Andrew
- Original Message -
From: "Rodolfo Gonzalez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 01, 2002 12:17 AM
Subject: [PHP] Download site down?


> To the php.net webmaster,
>
> there seems to be a problem with the us2.php.net site: I reach it with
> ping, but going to
>
> http://us2.php.net/do_download.php?download_file=php-4.2.2-Win32.zip
>
> causes an eternal "Sending request" (and telneting to port 80 of that
host
> doesn't open).
>
> Regards.
>
>
>
>
> --
> 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] whois query

2002-09-12 Thread Andrew Brampton

If you can't do a exec or system call on your server, then look at the
many examples of whois scripts here:
http://www.hotscripts.com/PHP/Scripts_and_Programs/Networking_Tools/Whois/
some of which use sockets or other methods which might be allowed on your
server

Also for reference, www.hotscripts.com is a GREAT site which has tons of
PHP scripts, allways look there 9 times out of 10 you will find a script
you can use.

Andrew
- Original Message -
From: "Adam Williams" <[EMAIL PROTECTED]>
To: "yasin inat" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, September 12, 2002 2:17 PM
Subject: Re: [PHP] whois query


> Have a php page that runs exec() or system() and does a whois query on
the
> domain you want and then have it output the text to a page.  Very simple
> to do, less then 2 minutes of coding.
>
> Adam
>
> On Thu, 12 Sep 2002, yasin inat wrote:
>
> > please  anyone  can  help  me   about  querying  a  domain  
> > like   whois  queries ?
> >
> > if  someone  has   got   a   script  ,  it's   acceptable 
> >
> >
> >
> >
> >
> >
>
>
> --
> 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] Using PHP to create tables?

2002-10-02 Thread Andrew Brampton

It appears to me you are not actually executing the SQL you are storing in
the varible.

Did you accidently miss that out of your email?

I would supply you with more information but I don't know how to use
PostgreSQL, but since you are coding with it, I guess you should be able to
figure out the correct command

Andrew
- Original Message -
From: "Andre Dubuc" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 02, 2002 2:44 PM
Subject: [PHP] Using PHP to create tables?


> In order to get my site on-line, I need to upload all my files, and create
a
> few PostgreSQL tables that the scripts rely upon.
>
> I've created a script that should create these tables, but in testing it,
> nothing happens - no tables are created. I wondering whether it's even
> possible to create these tables from php?
>
> The other possibility is to use pg_dump, but again, wouln't that require
that
> the tables already exist on the server?
>
> So, I guess my question is: can I use php to accomplish these tasks, or do
I
> have to have access to psql (server-side)?
>
> Here's the script I've created:
>
>  include("dbc.php");  /* db connection script to pre-existing db on
server*/
> $ct = "CREATE TABLE dip (
> rid serial int4 NOT NULL,
> rfname varchar(50) NOT NULL,
> rsname varchar(50) NOT NULL,
> rm1name varcahr(50),
> rm2name varchar(50),
> rm3name varchar(50),
> rinit varchar(8),
> rnee varchar(50),
> rcity varchar(50),
> rprov varchar(50),
> rcountry varchar(50),
> rdate date,
> rsponsor int4,
> radopt int4,
> rpix varchar(50),
> rproduct varchar(50),
> rplacement varchar(50),
> robid int4,
> rmemid int4,
> rbook text,
> rconfirm int4,
> rupload varchar(200)
> )";
>
> ?>
>
> Sorry for the real 'newbie' question here, but this is something I've
never
> done, so I'm going in totally blind. I'd greatly appreciate any advice
> concerning what to do, or watch out for.
>
> Tia,
> Andre
>
> --
> 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] CC Processing Merchants

2002-10-09 Thread Andrew Brampton

Sorry for this slightly off topic question, but I beleive many of you will
have delt with this kind of thing before.

My client is asking for a Online Merchant that will allow him to validate
and charge credit cards. He orginally suggested Pay Pals but after I read
their docs I found that the Customers would have to sign up for a Pay Pals
account, which my client dislikes.

So can anyone recommend a good (maybe cheap) Merchant that can validate and
charge credit cards online? My client is searching for some reviews online,
but he asked if I could maybe get a list from progammers which have done it
before.

Thanks
Andrew


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




Re: [PHP] WinAMP Plugin Question

2002-10-12 Thread Andrew Brampton

You could create a PHP script on your webserver that pulls the info from
your machine, parses it and then re-displays it in the way you like. This
way people won't actually know your IP,. and all the processsing will be
done on your webserver. If you want to allow them to download your MP3s, you
can either do it via your webserver, it just let your webserver link
straight to your SpyAmp page.

Andrew
- Original Message -
From: "eriol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 12, 2002 8:06 AM
Subject: [PHP] WinAMP Plugin Question


> I was wondering if anyone has tried or would know how to take my mp3
> collection listing from SpyAMP (http://spyamp.sf.net) and incorporate it
> into my site (which is on a different server and not on my home network)
> and have guests be able to download songs assuming I have it running?
>
> I want to change the HTML layout, the order the songs are listed
> (alphabetical vs. random, etc.), and have them in categories instead of
> being all in one long list.. I don't know if this is possible, but I
> figure it wouldn't hurt to ask..
>
> SpyAMP, for those unfamiliar with it, basically sets up a small mp3
> server on your local machine and allows anyone who knows your IP address
> (or visits the SA server page if you're listed) to download songs if
> you've chosen to allow it.. I have no clue where to begin as I'm a php
> newbie.. Any ideas, tutorials, code or function names to help me on my
> way would be appreciated..
>
> TIA..
>
> Take care.. peace..
> eriol
>
>
>
> --
> 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] Detecting GD version

2002-10-13 Thread Andrew Brampton

try function_exists('imagecopyresampled');

otherwise I'm sure there has to be some function that returns versions of
libs.

Andrew
- Original Message -
From: "Owen Prime" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 14, 2002 1:37 AM
Subject: [PHP] Detecting GD version


> Has anyone got any better ideas about how to detect what version of GD is
> running other than the following. The reason I ask is that I want to use
> imagecopyresampled() only if available ie. GD >= v2.0.
>
> OPTION 1.
> Parse phpinfo() output for the GD version info. Expensive.
>
> OPTION 2.
> Run imagecopyresampled() suppressing errors and then check the error msg.
> ie:
> @imagecopyresampled();
> if ($php_errormsg != "imagecopyresampled(): requires GD 2.0 or later")
> // GD >= v2.0
> } else {
> // GD < v2.0
> }
>
> Option 2 is the best I can come up with at the moment luckily the
> "requires GD 2.0" error message is triggered before the argument
validation
> errors.
>
> Anyone got a better idea?
>
> Thanks,
>
> Owen Prime
> http://www.noggin.com.au
>
> --
> 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] Best way to store Votes for Survey app

2002-10-27 Thread Andrew Brampton
Say
item_id was a int(10)
member_id was a int(10)
date was a timestamp(14)
rating was a int(1)

then each record would take up 35bytes + a little overhead
Neglecting the overhead 20,000 records would take up only 700kb of space.

So size of the db shouldn't be a issue. But if it is then you could changed
item_id and member_id to slightly smaller int types.

If you are worried about speed of searchs etc, I'm pretty sure MySQL can
handle it, but if you want to place some less work on MySQL make a table
which stores the current Averages/Totals/Etc and update that whenever a new
vote is made/changed/deleted. That way MySQL isn't adding up 20,000 records
each time you want to display the current results, and this also leaves you
the flexibility to do other statitisics on your data later.

Hope this helps
Andrew

- Original Message -
From: "Monty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 27, 2002 8:21 PM
Subject: [PHP] Best way to store Votes for Survey app


> I'm writing a survey app in PHP (4.2.2) that will allow people to view a
set
> of photos and then rate each photo from 1-5 using a little dropdown under
> each photo. When they are done choosing their ratings, they click on
SUBMIT
> to register all their votes at once.
>
> I thought the best way to record votes was to create a record for each
> member and each photo they voted on in MySQL. So, for example, if someone
> rates 9 photos, there will be 9 records created in the voting DB
structured
> something like this:
>
> item_id // ID number of the photo being rated.
> member_id   // ID of the member making the vote.
> date// Date vote made.
> rating  // 1-5
>
> While this system offers a lot of flexibility in calculating votes, I'm
> worried that the DB will become full fast with records because of the
number
> of records created for each member when they vote. If there are 10 photos
> and 2,000 people rate those photos, that will create 20,000 new records in
> the DB for that one poll alone.
>
> So, I'm wondering if anyone has any suggestions for better ways to store
> votes like this without created so many DB records. I want to be able to
> calculate total votes for each photo as well as prevent members that have
> already voted from voting again.
>
> Any suggestions would be appreciated!
>
> Monty
>
>
> --
> 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] ftp_rawlist problems

2002-11-02 Thread Andrew Brampton
This is a known bug on the windows platform.
It has been fixed in CVS, and is most likly fixed in the current 4.3.0pre2
release.

I experience this problem a few weeks ago, but once I downloaded the lastest
CVS Snapshot it worked as expected.

hope this helps
Andrew
- Original Message -
From: "Alex" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 12:27 AM
Subject: [PHP] ftp_rawlist problems


> I'm writing a script which crawls through ftp servers, retrieving file
> listings and saving them to a DB so they may be searched.
>
> What happens, is the script connects to the ftp server, and asks for a
> listing of a directory. The ftp server apparentally sends the script the
> file listing, but then the script hangs. I have absolutely no idea what
> causes the problem.
> To combat this problem, I have a loop which keeps looping until
ftp_rawlist
> actually returns something valid.
>  $files = false;
>  while (! is_array($files))
>  {
>   $files = ftp_rawlist($conn, $dir);
>  }
> That, along with
> ftp_set_option($conn, FTP_TIMEOUT_SEC, 3);
> Seems to fix the problem for now, but I would still like to know what's
> going on.
>
> Please note...
> I'm running PHP 4.2.1 as a module with apache 1.3.x on a win2k machine.
The
> server I am using for testing, if it should make any difference, is
> Filezilla 0.7.2.
> Also, this problem does not occur every time a directory listing is
> requested, but perhaps every 15-20 directories. In any case, which
directory
> php stalls on is random.
>
> If anyone else has ever encountered this problem, or has any idea what is
> going on, I would be very interested in hearing what you have to say :).
>
> - Alex
>
>
>
> --
> 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] Problem with is_dir function

2002-11-02 Thread Andrew Brampton
what values of $user_dir are you passing to is_dir?

echo them out before the test, you might be sending paths which are most
certainly not directories... for example:
c:\windows
/home/blah
would be valid, but
c:\windows\win.com
/home/blah/myfile
http://somesite/somepath
ftp://someftpserver/incoming
are invalid

Hope this helps
Andrew
- Original Message -
From: "Roger Lewis" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 7:06 PM
Subject: [PHP] Problem with is_dir function


> I'm having a problem with the is_dir function, or maybe I don't understand
> how it supposed to work.  I'm using the following code to check whether or
> not a directory called $user_dir exists.  If it exists, I am returned the
> proper message.  But if it doesn't exist, I get the following error
message
> that says that it doesn't exist. (I already knew that!)
>
>
> 
>
> Can someone please explain what I am doing wrong here, and how to return a
> usable value if the directory doesn't exist.
>
>
> $test = is_dir($user_dir);
> if($test){echo "You have a user directory.  It is $user_dir";}
> else{echo "Your user directory doesn't exist";
> return;}
>
>
> Thanks a lot.
>
> Roger Lewis
>
>
>
>
> --
> 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] Rotating Ads

2002-11-09 Thread Andrew Brampton
you can use SQL:
SELECT id, url, image FROM tblAdds ORDER BY RAND() LIMIT 1

I think thats just about it, that should evenly show them, if you want to
bias the displying of your ads you would need to get a count of the ads in
the DB, then use some random number generated from PHP to chose which to
use.

Andrew
- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, November 09, 2002 7:45 PM
Subject: [PHP] Rotating Ads


I have a link exchange script and I need to rotate the ads each time a page
refreshes. How exactly can I do this?

I have an id field for each ad. How could I display a different ad each time
the page refreshes using the id field?

Thanks,
Stephen Craton
http://www.melchior.us

"Life is a gift from God. Wasting it is like destroying a gift you got from
the person you love most." -- http://www.melchior.us


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




Re: [PHP] Rotation of images

2002-11-12 Thread Andrew Brampton
You could write your own rotation code, moving every pixel one by one,

Otherwise I've not used GD enough to know one... but actually quickly
looking at the GD Function list I found:
http://www.php.net/manual/en/function.imagerotate.php

Voila

Andrew
- Original Message -
From: "Sear, Mick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 10:43 AM
Subject: [PHP] Rotation of images


> I can use ImageMagick to rotate images, and that would be my preferred
> technique, but I was wondering how you might use GD to rotate images.  As
> far as I can see, it's not possible.  Anyone tried it?
>
> Mick
>
> e-ssociate
> EPSON (UK) Ltd.
> Tel 01442 227374
> www.epson.co.uk
>
>
>
> --
> 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] Listing files and their details on a text file

2002-11-18 Thread Andrew Brampton
You would do it just like you would if you were outputing to the browser
look up the following:
dir, fopen and fwrite.

Just be looking at the examples and user comments you will have all the
source you need

Andrew
- Original Message -
From: "Carlos Fernando Scheidecker Antunes" <[EMAIL PROTECTED]>
To: "PHP-GENERAL" <[EMAIL PROTECTED]>
Sent: Tuesday, November 19, 2002 1:34 AM
Subject: [PHP] Listing files and their details on a text file


> Hello all,
>
> I need to do something that you might be able to advise me.
>
> I would like to list all the contents (files) of a directory in a text
file.
> Each line/record must have the file name, date and size. Does anyone know
> how to do it?
>
> Thank you,
>
> C.F.Scheidecker Antunes.
>
>
> --
> 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] flush() issue

2002-11-20 Thread Andrew Brampton
Are you outputing each row in a table?
IE won't start displaying the table until the  tag, that might be
causing your problem...

Andrew
- Original Message -
From: "Jock Pereira" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 1:28 PM
Subject: [PHP] flush() issue


Having an issue getting flush to work. Browser version is IE 6 sp1.  I am
not using mod_gzip on Apache. In the following code sample you can see that
I am looping through a mysql result array and using a different include each
time. At the end of the foreach loop I am attempting to flush to the
browser. I am taking into consideration the buffer size that must be met for
flush to work (str_pad) and all other considerations I came across in the
php manual... http://www.php.net/manual/en/function.flush.php.

Despite the below my browser does not show results until the entire script
has completed (~10 minutes). Any idea on how I can get this to work?
Anything to take into consideration that I am not... considering... below?

Thanks!

Jock Pereira
_ Code_Sample_Below__

$result = mysql_query("SELECT * FROM DEALER_Inventory WHERE DealerID =
'$this_dealer' AND Car_Type != 'new'");

foreach ($themalls as $thismall)

{

 logExportResults("$this_dealer", "$thismall", "Exporting...");
 Print ("  $this_dealer: Sending to
$thismall");



 include('include/EXPORT_'.$thismall.'.php');
 mysql_data_seek($result,0);
 logIt("7","",$thismall);
 logExportResults("$this_dealer", "$thismall", "Export Done...");

 echo str_pad(" ", 300);
 flush();

}
___ End_Code_Sample__


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




Re: [PHP] Graph Question..

2002-11-20 Thread Andrew Brampton
Try going direct to the image's URL, this might show any PHP errors. If that
doesn't work, you can request the page via telnet and see if any errors are
appearing

Andrew
- Original Message -
From: "James Hatridge" <[EMAIL PROTECTED]>
To: "PHP-GEN" <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 3:06 PM
Subject: [PHP] Graph Question..



Hi all,,

I d/l'ed a class for graphs last night. When I got the class working instead
of a line graph I got the netscape symbol for no picture, ie a broken box. I
must have missed something. Could someone give me a clue what I'm doing
wrong?

Thanks

JIM
--
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


--
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] Can a php script be placed within a stylesheet?

2002-06-10 Thread Andrew Brampton

Yes you can place one in a style sheet you just need to tell apache (or
whatever) that .css should be parsed by PHP, this can be done via a
.htaccess or something similar... Here is a example in a .htaccess file:

AddType application/x-httpd-php .css

andrew
- Original Message -
From: "William S." <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Monday, June 10, 2002 1:33 PM
Subject: [PHP] Can a php script be placed within a stylesheet?


> Can a "php script" be put within a stylesheet and
> work properly? If so, how?
>
> For instance, this script put inside an XSL
> stylesheet file:
>
>  $myvar = "Hello World";
>   echo $myvar;
>   ?>
>
> Then it is transformed into html via Sablotron.
>
> --
> Bill
> Amsterdam, NL
>
> --
> 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] Is this a BUG?

2002-06-23 Thread Andrew Brampton

If the code is in a function then don't you need to call
global $HTTP_POST_VARS;
at the top of the function so that it knows you can use that varible?

Andrew
- Original Message -
From: "César Aracena" <[EMAIL PROTECTED]>
To: "PHP General List" <[EMAIL PROTECTED]>
Sent: Sunday, June 23, 2002 11:06 PM
Subject: [PHP] Is this a BUG?


Hi all,

A couple of days ago, I've been starting to organize all my scripts into
functions within libraries, and got into a problem this morning. Now, I
don't know if this is a bug or it's just me getting confused. I got the
problem when calling two functions - one gets variables from the other -
within the same page.

That is, I have a mainusers.php page, which only calls for functions
instead of writing them all together inside that page. At one step, it
calls for an "adduser" function which brings a table that let the
administrator insert a new user. After the submit button is pressed, it
calls for a function called "useradded" which resides in the same
library as the "adduser" function. This useradded function queries the
database, inserting the user. The problem is that it does not get the
HTTP_POST_VARS although they are being passed according to phpinfo.php.

The structure is this:

Project directory

>Library Directory
>>addlib.php
>>>adduser() function
>>>useradded() function

>Pages directory
>>mainusers.php
>>>first calls for adduser()
>>>and then for useradded()

Now, the thing is if I, instead of calling the function, write the query
directly in the mainusers.php page, the variables are get well and
written into the database. I don't know if this makes much sense, but
the thing is. Isn't PHP forced to pass those variables before the
function is called so when they're needed they can be get through
HTTP_POST_VARS or just $var_name which I like using?

Thanks.

Cesar Aracena 
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621




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




Re: [PHP] PHP with IIS

2002-06-24 Thread Andrew Brampton

Does the user to which ISS runs under have network permissions to access p:\
?
IIRC you need to set up ISUR_machine_name to have permission to the remote
share.

Andrew
- Original Message -
From: "Dave Leather" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 6:29 PM
Subject: [PHP] PHP with IIS


> Hello all,
>
> I am attempting to open and/or create a DBASE file on a NOVELL network.
>
> When I attemp a command such as
>   if (!dbase_open("C:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says "DB WAS OPENED - no problem...
>
> On my IIS server, I have Novell drive map to P: - I can browse this using
> explorer or in CMD I can go to P: and do DIR etc etc.
>
> When I try :
>   if (!dbase_open("P:\\orders.dbf",2)){
>print "COULD NOT OPEN DB";
>   }else{
>print "DB WAS OPENED";
>   }
>
> I receive a message that says :
> Warning: unable to open database P:\orders.dbf in
> C:\InetPub\wwwroot\pappreport.php on line 81
> COULD NOT OPEN DB
>
> Yes, the database exists, as I copied it FROM here to C:\ to do my test.
>
> Any ideas??? I have checked the PHP.INI file, and all the regular settings
> in IIS - and could not find anything misconfigured.. but I am by no means
an
> IIS expert, so I am not sure.
>
> Thanks in advance
> Dave
>
>
>
>
> --
> 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] Design Tips

2002-06-26 Thread Andrew Brampton

Not so long ago (well last week), I wrote a PHP proxy script which worked in
the form:
www.myserver.com/proxy/www.whatever.com/blah
and it would request the page www.whatever.com/blah and then display it
changing all the links on the page to point to my proxy script...

The whole script took a hour to write, and I eventually got it to do posts
and get, and to send all headers So using PHP is totally possible for
what job you want

Andrew
- Original Message -
From: "David Redmond" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 27, 2002 2:13 AM
Subject: [PHP] Design Tips


> Hi All,
>
> I'm about to put myself in the deep end by attempting to create an PHP app
> that will perform the role of a proxy server.  The application has to
> perform the following based on the URL that the web client will be
> requesting.
>
> URL Requested: https://servername/id0001/
>
> 'id0001' is a unique for each of my clients and they have a matching
record
> which points to their content.  Each client will have a different server
> that their content is hosted on.  I want the PHP app to read in that id
> number , perform a SQL query to obtain where their real server is,
retrieve
> the content then display it back to the client.
>
> The app would have to deal with GET & POST as it would be working with
> dynamic content at the remote end.
>
> Is this even possible using PHP?  If anyone has had any experience
> developing this type of App before, please let me know how you went and/or
> provide any tips that you can :)
>
> Cheers
>
> --
> 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] [more info] Finding all instances

2002-06-30 Thread Andrew Brampton

Well I'm not good enough at SQL to do this, but how about you get PHP to
figure out all the combinations, ie
1, 3, 5, 2, 6, 5&2, 3&2, 3&2&1, 5&1, 6&1, 2&1, 3&1

Then do a set of
SELECT * FROM table WHERE number=1
SELECT * FROM table WHERE number=3

SELECT * FROM table WHERE number=3 OR number=1

Then you can read all these values into a array of some kind and do what you
want...

I think I may mis-understood the problem a little, but I hope this helps

Andrew

- Original Message -
From: "mikeyb" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 30, 2002 10:26 PM
Subject: [PHP] [more info] Finding all instances


>
> Hi,
>
> I have a little problem I am trying to solve but right now I have no idea
> where to begin.  I am preying that someone out there might be able to help
> me.
>
> In my MySQL database I have a group of figures, one for each record.
> Through PHP I have concluded at a 'magical' number which I will need to
> compare against.  What I need to do is try to find all instances or
> combinations of figures from the database which fit inside this magical
> figure, but how I do this I am not sure.  I'm thinking I need to somehow
> read the figures into an array somehow but I have not had enough
experience
> with php to know how to even do this effectively.  I have read up on the
> issue but it all seems double dutch, and I don't know what I need to do
from
> this point anyway.
>
> For example:
>
> Magic Number: 7
> Numbers in database: 12, 6, 2, 8, 5, 3, 1
>
> Combinations returned: 1, 3, 5, 2, 6, 5&2, 3&2, 3&2&1, 5&1, 6&1, 2&1, 3&1
>
> Can anyone please help?
>
> [MORE INFO: Each record in the database has a unique identifier, numberid,
> which would be used to identify which records are used in the
combinations.
> We can assume for now that the numberid is equal to the number in the
> database for simplicity sake.  Sorry for not making this clear the first
> time]
>
> Thanks,
> Michael.
>
>
>
> --
> 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] upgrading php...

2002-07-02 Thread Andrew Brampton

Takes the time of the download + 5minutes
Download the full version of php... extract the zip file to where php is
currently... then copy the new versions of php.ini and php4ts.dll into your
c:\windows\ directory... Then make any minor changes you need to to the
php.ini and voila all done (don't forget to restart apache for good
measures)

Andrew
- Original Message -
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 02, 2002 7:10 PM
Subject: [PHP] upgrading php...


> Currently I'm using php 4.0.5 on Win98/apachedo you think it's worth
> my time and trouble to upgrade to a newer version of PHP?  Is this hard
> to do?  Any links to info on how to upgrade ??
>
> Thanks!
>


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




Re: [PHP] ??????????????????????????????????????????????????????````````````````````ØØØØØØØØØØ

2002-07-09 Thread Andrew Brampton

If you read the 3 emails he sent previous to his spam you will see that he
tried to get the moderators to remove him but after 6 hours he is still on
the list, so I guess he thinks that if he starts to spam he will be kicked

Andrew

- Original Message -
From: "Rodolfo Gonzalez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 09, 2002 8:32 PM
Subject: Re: [PHP]
??ØØ



> To the kind moderator of the list: please kick off this guy (Erik
> Hegreberg <[EMAIL PROTECTED]> ), he's really annoying. Or at least bounce
> his e-mails back to him ;) ).
>
> Thanks.
>
>
> --
> 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] HTTP_USER_AGENT?

2002-07-10 Thread Andrew Brampton

the $HTTP_USER_AGENT varible contains nothing...

Try doing a phpinfo(); to see what the correct varible to use is, it is most
likly $_SERVER['HTTP_USER_AGENT']  since the way these varibles are handled
changed a few versions ago

Andrew
"George Hester" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have this in my web site not in an executable folder:
>
> 
> 
> My First PHP Program
> 
> 
> 
> 
> 
>
> No problem.  I then put this in the same folder:
>
> 
> 
> My Second PHP Program
> 
> 
> 
> 
> 
>
> Nothing appears.  What's wrong?
>
>
> --
> George Hester
> _
>
>
>
> --
> 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] ob_start

2002-07-14 Thread Andrew Brampton

I don't think you need to do the
if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) {
because ob_start("ob_gzhandler"); checks to see if the browser will accept
gzip content before gzipping it..

But I think the reason that it isn't working for you is that you don't have
the correct compression libraries compiled into PHP... I spent ages trying
to figure out why mind didn't work and this was the problem. The anonying
thing is that if you don't have this libs it doesn't even tell you

andrew
- Original Message - 
From: "Kevin Waterson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 14, 2002 3:34 PM
Subject: [PHP] ob_start


> I wish to compress some data using
> ob_start("ob_gzhandler");
> 
> I use 
> if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) {
>  ob_start("ob_gzhandler");
> } else {
>   ob_start();
> }
>  but the compression is never used..
> obstart is always used withouth the gz_handler
> is there a way around this? or am I doing something
> wrong here?
> 
> Kind regards
> 
> kevin
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] newbie: mysql statement

2002-07-15 Thread Andrew Brampton

Shouldn't this be

"UPDATE header SET parent='$this->parent' WHERE posted = max(posted)"

Otherwise the max(posted) = max(posted) is true for all records (therefore
all records get updated)

Andrew

- Original Message -
From: "Martin Clifford" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 15, 2002 8:11 PM
Subject: Re: [PHP] newbie: mysql statement


I would rewrite the query as:

"UPDATE header SET parent='$this->parent' WHERE max(posted) = max(posted)"





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




Re: [PHP] auto 'jump' to link

2003-09-03 Thread Andrew Brampton
if ($x == 5)
header('Location: http://blah.com/blah');

This what you were looking for?
Also make sure this is sent before any other output

Andrew
- Original Message - 
From: "DougD" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 6:32 AM
Subject: [PHP] auto 'jump' to link


> I've seen this somewhere (or I've gone crazy), but a function in PHP that
> automatically forwards you to another web page. If want to do an 'if x=5
> then jump to this other page on the site or an external site'.
> 
> Could anyone help me out here?
> 
> Thanks very much.
> 
> -Doug
> 
> -- 
> 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] suggestion: recursive calls

2003-09-04 Thread Andrew Brampton
I was just testing PHP with this code:
 860)
exit();

echo $varible . '';
flush();

blah($varible + 1);
}

blah(1);

?>

This would show 1 to 860, however if I tried any number greater than 860, ie
861 then the page would give the "This page cannot be displayed" page like
you were saying.

Normally apps in C, etc would throw a stack overflow error when you recursed
too high...

I'm guessing PHP doesn't implement this as a normal stack, and is crashing
out because we have hit the memory limit. The reason I say that is because
860 seems a very odd number to set the stack size to.

I'm also guessing that it wouldn't be too hard for the PHP Dev team to place
a limit on the recursion depth, or maybe it is a bit too hard and thats why
they didn't bother :)...

Andrew
- Original Message -
From: "Ronald van Raaphorst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 11:40 AM
Subject: Re: [PHP] suggestion: recursive calls


> I normally program in clarion (www.softvelocity.com) and an infinite
> recursive call will cause a heap overflow...
>
> As I only got a "This page cannot be displayed" page, an error must have
> occurred, but it's not displayed...
> At first I thought I had lost contact with the site, but then, after a lot
> of tracing, I found the source of the error.
>
> Ronald
>
>
>
> "Marek Kilimajer" <[EMAIL PROTECTED]> schreef in bericht
> news:[EMAIL PROTECTED]
> > I don't think it is even possible, if the recursive calls don't seem
> > infinite to inteligent human being, how should a stupid computer program
> > find out.
> >
> > Ronald van Raaphorst wrote:
> >
> > > Hi all,
> > >
> > > Not a real bug, but a suggestion:
> > > It would be nice if inifite recursive calls would somehow give an
error.
> > > I spend quite some time to find the error in my php script.
> > >
> > > Ronald
> > >
>
> --
> 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] GD problem

2003-09-23 Thread Andrew Brampton
ImagePNG() ouputs to the browser unless you specify the filename parameter
So those funny symbols you are seeing is the PNG file but displayed as text.
To fix this you need to add a

Header("Content-type: image/png");

somewhere in your PHP (preferably before ImagePNG), and it will tell your
browser that the data being sent is a PNG file, not normal text/html.

You may see the funny characters, or a red cross if you decide to use echo,
print, print_r or similar functions, since these will output to the browser
along with the PNG file, thus corrupting the image.

Oh My I just noticed you have HTML in there as well :/ If you are doing
something like:
echo '';
ImagePNG(); //I want the image to appear here
echo '';

Then you will need to do:
echo '';
echo '
echo '';

and in somephpfile.php you will have the code to generate the image
including the ImagePNG();

Andrew

- Original Message -
From: "Ignacio Correa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 5:43 PM
Subject: [PHP] GD problem


Hi, I´m new in PHP+GD.
I have install all library (PHP4-gd2, libgd2, etc, etc, etc.) and when I use
gd functions no errors or warning are displayed, but when I use imagepng()
or imagejpeg() no images are displayed in my browser, and in this place
extrage symbols are displayed.
You can see my bad result here:
http://www.drivingconsultancy.com/ide/testi.php

If somebody can helpme, I´ll be very thanks

(sorry, my eglish isn´t good, I´m from Argentine)

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



[PHP] SQL Query OT question for the experts :)

2003-10-17 Thread Andrew Brampton
Hi,
I have a client with a database of around 17k entries. Now due to powers out
of my control the table structure looks like:

CREATE TABLE londonhotelsallphotos (
  HotelID double default NULL,
  active_hotel_photo_Name varchar(255) default NULL,
  URL varchar(255) default NULL,
  Number varchar(50) default NULL,
  Name varchar(255) default NULL
) TYPE=MyISAM;

and a few example rows look like:
(105304,NULL,'http://blah/photos/105304/BAB105304.jpg','1','Cairn Hotel');
(105304,NULL,'http://blah/photos/105304/CAB105304.jpg','2','Cairn Hotel');
(105304,NULL,'http://blah/photos/105304/DAB105304.jpg','3','Cairn Hotel');
(105304,NULL,'http://blah/photos/105304/EAB105304.jpg','4','Cairn Hotel');

However the client has recently updated the database and now all entries
look something like:
(105304,NULL,'http://blah/photos/105304/AAB105304.jpg',NULL,NULL);
(105304,NULL,'http://blah/photos/105304/DAB105304.jpg',NULL,NULL);
(105304,NULL,'http://blah/photos/105304/BAB105304_2.jpg',NULL,NULL);
(105304,NULL,'http://blah/photos/105304/BAB105304_3.jpg',NULL,NULL);

Now you will notice that the last 3 fields have changed... The client wanted
to change the URL field, but also changed the Number & Name fields With
the current coding it appears they require the Number field to be set to 1,
2, 3, 4 etc... However as you can see the number field are all NULL now,
this is meaning the rows aren't being shown on the PHP page due to the way
the page was coded..

Now what I'm asking is for a SQL Query I can use to re-number all the rows
(17,000 ish). The table has many different HotelIDs in it, with at most 5
rows with the same ID meaning that the Number field won't be higher than 5.
The URL field I think is always unique for all the rows Also I don't
mind that the Name field is left NULL.

A few example rows would be:
(105304,NULL,'http://blah/photos/105304/BAB105304.jpg','1','Cairn Hotel');
(105304,NULL,'http://blah/photos/105304/CAB105304.jpg','2','Cairn Hotel');
(105304,NULL,'http://blah/photos/105304/DAB105304.jpg','3','Cairn Hotel');
(105304,NULL,'http://blah/photos/105304/EAB105304.jpg','4','Cairn Hotel');
(105356,NULL,'http://blah/photos/105356/EAB105356.jpg','1','Ramada Jarvis
Bolton');
(105356,NULL,'http://blah/photos/105356/CAB105498.jpg','2','Ramada Jarvis
Bolton');

If I can't do this with some quick and dirty SQL, I'll write some PHP to do
the process, but since I'm not being paid to fix this problem, and the
client caused it himself I thought I'll take the easier option of using SQL
before I wrote some code out of kindness...

Thanks very much
Andrew

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



Re: [PHP] php special permissions

2003-12-18 Thread Andrew Brampton
Another solution would be to place each change to the files in a MySQL
table, and then have a cron that is run every X minutes read this table, and
makes the actual changes I'm not sure if this idea is suitable in your
situation due to the time lag between the client asking for the change, and
the change happening. In some situations this is acceptable.

Andrew
- Original Message -
From: "Mat Harris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 18, 2003 12:24 PM
Subject: [PHP] php special permissions

Hi,
 I am building a web interface to the vacation autoresponder program on
linux.

 I let users login, edit their message and enable the autoresponder.

 The last step (enabling) is where the fun begins because php is run as
apache on
 my box, and each users' .vacation.msg and .forward are not owned by apache.

 So you say, ok lets make apache run as group 'vacation' and also change the
ownership
 on .vacation.msg and .forward.

 Well this makes sendmail cry out because it doesn't like having
group-writable .forward
 files.


 How would you guys suggest i did this?

 I can post code if required.

--
Mat Harris
Network/Systems Administrator
Genestate

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



Re: [PHP] Store Image in Access Database

2001-12-27 Thread Andrew Brampton

Hi,
You would pull it out using a normal SELECT SQL statement..

But I'm just writing this mail to warn agaisnt using a Access Database to
store images. I used to do this for a ASP site, allowing users to upload
their own images, and for everyone to view them. Anyway the database started
running into troubles, every other day I had to replace the database with a
backup due to it getting corrupted, and once the access database reached 5mb
I spent more time replacing it then it was actually being used. So I changed
my solution to one where the images are uploaded and stored on the webserver
and infomation about the images still stored in the access database. This
method worked FAR better, and since then I haven't had to replace the access
database.

Just my opinion
Andrew
- Original Message -
From: "Mike Baranski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 27, 2001 4:16 PM
Subject: [PHP] Store Image in Access Database


> Hi, I'm trying to store a binary file in an access database, I'm using an
ole
> type, and I think that it's getting inserted OK.  My problem is that I
don't
> know how to pull it out...  How do you select the stuff that's in an ole
> object out of the database and display it, a jpg, for example.  I can't
even
> get the raw data.  I've tried converting it to base 16 and inserting it,
but
> I still can't pull it out.  I know how to do this in mysql, so posting
that
> won't help.  I need to know how to do this with access.
>
> Thanks
> Mike.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




[PHP] ob_gzhandler doesn't seem to be working

2002-01-05 Thread Andrew Brampton

I thought I would try out the ability to GZip my PHP pages, so that they would be sent 
quicker and use less of my bandwidth :)

Anyway I have found the following tutorials and information on this:
http://www.zend.com/zend/art/buffering.php
http://www.php.net/manual/en/function.ob-gzhandler.php
http://www.phpbuilder.com/columns/piergiorgio20010321.php3?page=3

Unfortually I have been unable to get any of my pages to actually GZip up during 
transmittion.

I have enabled
output_buffering = On
output_handler = ob_gzhandler
in the php.ini file, with no luck

I have tried 
php_flag output_buffering on
php_value output_handler ob_gzhandler
in .htaccess files

I have even tried 
ob_start("ob_gzhandler");
at the top of my PHP Files..

Unfortually the output is NOT GZips, I have been testing the output with this script: 
http://leknor.com/code/gziped.php or by manually sending a HTTP Request:
GET /whatever.php HTTP/1.0
Host: localhost
Accept-Encoding: gzip

Nothing I try gets the page GZipped.

I am using php 4.0.6 binaries on windowsXP with apache 1.3.20

If anyone has been able to get this working, or has a solution to my problem please 
contact me,

Thanks
Andrew



Re: [PHP] IP address from which country

2002-01-08 Thread Andrew Brampton

No such table, the best you can do is look at their hostname and parse the last part 
ie .co.uk or .com... And then u can try and figure where they are from that

Andrew
  - Original Message - 
  From: Zhang, Leon (STHK/Zh) 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, January 09, 2002 1:03 AM
  Subject: [PHP] IP address from which country


  Hi,
   In php ,we can easily get the ip address of a connected computer ,but I always see 
on the web that there are some pages can tell you where you are from,so there must be 
a complete table show the relation of the ip address and country or region ,where can 
I find this .

  Thanks .
  Leon



--


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



Re: [PHP] Event based applications?

2002-01-12 Thread Andrew Brampton

How do you plan to place stuff in a database without using a "Server based
page"?

I think you will need to use a combination of the 2. Make the JScript call
PHP pages to do the handling of your events.

Andrew
- Original Message -
From: "Morten Nielsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 12, 2002 7:36 PM
Subject: [PHP] Event based applications?


> Hi,
>
> I am about to make an homepage. It is going to be very event based. When
the
> user presses different buttons different functions should be called.
> At the same time I am going to use a database to store some data.
> My question is: Should I use PHP or JavaScripts?
> I would like to have a server based page, but PHP doesn't support the
event
> driven methods like JavaScripts.
>
> Please send your comments,
> Morten
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] How to run sockets in Win32

2002-01-15 Thread Andrew Brampton

I tried with PHP4 a while ago to use Sockets on Win32, unfortually I found
written in the documenation saying that sockets were not implemented on
Win32 yet.

Andrew
- Original Message -
From: "Logan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 2:22 PM
Subject: [PHP] How to run sockets in Win32


> I tried to use the socket function under PHP 4.0.6 in IIS 5 on a server
with
> windows XP.
>
> It give me the error -> Socket function not found in line 3
>
> It's the socket implementation a package that i have to install???
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] my math stinks

2002-02-10 Thread Andrew Brampton

$answer = abs($pa - $pb) + $ca +$ps;

No ifs :)
Maybe I'm lazy, but I like 1 line statements

Andrew

- Original Message - 
From: "Gary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 10, 2002 7:05 PM
Subject: [PHP] my math stinks


> Hi All,
>   This is the first time I have had to deal with math. I have gone 
> through the manual and a few books and I think I am worse off then when 
> I started. Can someone give me an example of the simple math below. I 
> think If I see some in code I can move on from there.
> 
> I need to find out if $pa > $pb or $pb > $pa then subtract smallest from 
> the largest and add $ca and then add $ps
> 
> TIA
> Gary
> 
> 
> -- 
> 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] db design

2002-02-15 Thread Andrew Brampton

I would make 2 tables, a product table and a language table... It would look
like so:
Product ID | product name | manufacturer | etc

Then a language table that looks like:
Language ID | Product ID | product description | etc

Then you won't be replicated your 11 columns since they are not in the
product table anymore.. If there are 100 products, and 1 language then there
will be 100 records in the product table and 100 in the language table. If
there are 2 languages then there will be 200 in the language table.

This method means you will be able to expand your language endless... and I
don't think your DB Server will be slowed down too much by this, since u can
pull this all of with 1 query.. something like (from memory)
SELECT tblProducts.name, tblLanguage.Description  FROM tblProducts,
tblLanguage WHERE tblProducts.productID=tblLanguage.productID AND {some
other query}

Hope this helps
Andrew

- Original Message -
From: "Wilbert Enserink" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 12:33 PM
Subject: [PHP] db design


> hi all,
>
>
> I need some tips on database (mySQL) design.
> The problems lie in languages. I'm gonna make a e-commerce webiste. it's
> rather big (in my terms/experience). The website should be expandible
easily
> with regard to languages/translations.
>
> My biggest table with product descriptions has 43 columns. Other tables
> include a list of FAQ's, manufacturers and so on.
>
> What do you think I have to do? Make a new table for each language, or
> define more columns for each language within a table? What is normal in
> this, also with regard to doing queries?
>
> e.g. In the table with 43 columns, there are 11 columns which are the same
> for each language (product name, manufacturer and so on) The other columns
> will depend on language (like product description).
> --If I use a seperate table for each language than there is double info
(no
> normalization with regard to the 11 columns)
> --If I use more columns, than I have 32 columns extra per language. If I
> make 10 translations, then this table will reach over 10x32=320 columns.
>
> I need somebody who can give me overall info on this, or shine a broad
light
> on my Q. Does the db design has a large influence on flexibility with
regard
> to future expanding? And how about query times (response) on a server. I
> don't want it to get too slow
>
> Well I think, you know my point now,
>
> any info is much appreciated!!
>
>
> thx in advance,
>
> Wilbert Enserink
>
>
> -
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] Change gif image with php

2002-02-16 Thread Andrew Brampton

ya its completly possible..
I've never done it, but I'm sure I read how to over at phpbuilder.com

Andrew
- Original Message -
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Saturday, February 16, 2002 7:49 PM
Subject: [PHP] Change gif image with php


> Hi list
>
> I have some buttons made in photoshop in .gif format. This buttons have
> round corner, feather, multiple colors etc. There's a way to open it with
> php and write some text to it. I know that is possible to create images,
but
> what about to change them??? I need to do this because the text that will
> fill the buttons come from mysql and change everyday.
>
> Thank's in advance
>
>
> Rodrigo
>
>
> ps: If someone want to see the button I'm talking look in
> http://www.celebnet.com.br/home.php under the "AS ++".
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] PHP browser uploads = PASV?

2002-04-16 Thread Andrew Brampton

If you are uploading a file with php then you are using a http connection
NOT ftp... so PASV doesn't come into it at all. PASV is a FTP command not
http.

and if you did try and compare them, then http is passive (ie no connections
are tried to be made to the user with the browser).

Andrew
- Original Message -
From: "jon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 5:44 PM
Subject: [PHP] PHP browser uploads = PASV?


> Hey... does anyone know if browser uploads via PHP are a PASV connection?
>
> If so... is there a way to accept PASV connections behind a firewall, like
> in Wu-FTP?
>
> Thanks...
> -- jon
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] php in a layer trouble

2002-04-24 Thread Andrew Brampton

If you mean a layer as in a  tag, then Netscape or any other browser shouldn't 
know or care that it was PHP. PHP is server side therefore the client knows nothing 
about the PHP or what jobs went on at the server... 

You most likly have a bug in your HTML that netscape just doesn't like to display IIRC 
IEs and NS implementation of layers and them things are different :(

Andrew
"Robert" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Has anyone ever had trouble with Netscape not displaying a layer with you
> put any php code in it? Anyone know a source for reading more about it?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




Re: [PHP] HTML in PHP

2002-04-28 Thread Andrew Brampton

echo mysql_result($result,$i, "NAME");
should be:
echo mysql_result($result,$i, "NAME") . '';

Andrew
- Original Message - 
From: "Christian Ista" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 28, 2002 2:51 PM
Subject: [PHP] HTML in PHP


> Hello,
> 
> I have a newbie question for you.
> 
> I do a query, I'd like to display the result but I'd like to go to a new
> line for each row.
> 
> I use this code that's work :
>  for ($i = 0; $i   {
>echo mysql_result($result,$i, "NAME");
>   }
> ?>
> 
> but this not work
> 
>  for ($i = 0; $i   {
>echo mysql_result($result,$i, "NAME");
>   }
> ?>
> 
> Could you tell me how I can do to have a  after each row.
> 
> Thanks for your help :)
> 
> Bye
> 
> 
> 
> 
> 
>  
> 
> 


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




[PHP] SQL Query (Group By)

2002-04-30 Thread Andrew Brampton

Hi,
This is more a SQL question that a php one, but here goes:

I have a table with 3 fields, Date, IP, ISP.
Basically I have written some php to store the following in the table each time 
someone hits a page on my site. Now I want to display some info about the users 
currently on my site, but I want to try and do it with 1 SQL query.

Basically I want to display a count of how many unique IPs there are on my site from 
each ISP... for example
3 NTL 
1 BT
5 Freeserve

but in each group there will be more than 1 entry for each user due to them causing a 
row in the table on each hit. I can't seem to group it together how I want with 1 
query. The best I can do is count how many rows are from each IP (but this figure is 
too high since it doesn't take into account that the IPs must be unique). Here is my 
current SQL:

$sql = "SELECT ISP, COUNT(*) as total FROM track GROUP BY ISP ORDER BY total DESC";

I could make this work by doing some sorting in PHP once I get the data, but I would 
prefer to do it with SQL... Anyone know how to do what I want?

Thanks
Andrew



Re: [PHP] Why is there no OPTION EXPLICIT equivalent?

2002-05-29 Thread Andrew Brampton

You can put your error level up to show you when you try to use a varible
that hasn't be initalised yet, I tend to do that to ensure good coding, and
that I don't mistype varibles etc

Andrew
- Original Message -
From: "Andy Arbon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 8:11 PM
Subject: [PHP] Why is there no OPTION EXPLICIT equivalent?


> Hello,
>
> In general I find PHP great to work with, but the number one thing that
> causes bugs for me is the fact that the interpreter doesn't throw an
> error if I use an undeclared variable.
>
> I have looked and I can't find any information that suggests you can
> make PHP force you to declare variables before use - does such a
> facility exist?
>
> Assuming it doesn't, why is that the case? I can't be the only one who
> has problems with this; are there any plans to add such a feature in the
> future? It doesn't have to be compulsory, but a facility like VB's (not
> that I like that language in general) Option Explicit statement would be
> a great help.
>
> I know nothing about language design, but I can't see how this can be
> more difficult to do than forcing static types, which it seems you can
> do in PHP.. can anyone tell me the reasoning behind this?
>
> Hope the above doesn't sound too critical - in general I love PHP, but
> this one omission has cost me so many hours of debugging time over the
> years I had to ask :)
>
> Cheers,
>
> Andy
>
>
> --
> 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] reg exp problems

2002-06-01 Thread Andrew Brampton

Hi,
I've never used a reg exp, but I was trying to do something simple, and I just can't 
seem to do it :)

I have a varible $fdata which contains the contents of a webpage, and I want to strip 
out the  tag.

I try:
$fdata = preg_replace("","",$fdata);

But its stripping out everything between the first "" on that 
line, instead of the of the ">" at the end of the base tag

Hope that makes sense :)
TIA
Andrew



Re: [PHP] reg exp problems

2002-06-01 Thread Andrew Brampton

Hi, thanks for the suggestion, but the  tag doesn't have to have a
closing tag, OR it appears many/all sites I've seen don't use the closing
tag.

Andrew
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 01, 2002 6:02 PM
Subject: Re: [PHP] reg exp problems


> On Saturday 01 June 2002 23:56, Andrew Brampton wrote:
> > Hi,
> > I've never used a reg exp, but I was trying to do something simple, and
I
> > just can't seem to do it :)
> >
> > I have a varible $fdata which contains the contents of a webpage, and I
> > want to strip out the  tag.
> >
> > I try:
> > $fdata = preg_replace("","",$fdata);
> >
> > But its stripping out everything between the first ""
> > on that line, instead of the of the ">" at the end of the base tag
>
> Try: (it should remove  & )
>
>  preg_replace("/()|(<\/base>)/", "", $fdata);
>
> *** Untested, use at your own risk ***
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> When you make your mark in the world, watch out for guys with erasers.
> -- The Wall Street Journal
> */
>
>
> --
> 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




  1   2   >