RE: [PHP] Please Help

2003-07-31 Thread Joseph Blythe
Sathiyabama,

Is always a good idea to read the manual, search google and the list
archives before posting to this list, the below links should help you get
started.

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

and:

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

Regards,

Joseph


> -Original Message-
> From: John Manko [mailto:[EMAIL PROTECTED]
> Sent: Friday, 1 August 2003 3:56 PM
> To: Sathiyabama
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Please Help
>
>
> umm... ok.
>
> www.google.com
> www.php.net
>
> that should get you started.
>
>
> Sathiyabama wrote:
>
> >Dear PHP Team,
> >
> >I request your help to sort some issues in using PHP.
> >
> >1.Chennai IIT has developed one recorder.We can record our voice and
> >video.Its user defined extenion is MV4.
> >
> >My requirement is
> >
> >1.I want to send video file using mail() function in PHP.So
> how to send
> >it.What is the procedure?
> >
> >2.How to delete one folder using PHP?
> >
> >
> >Please help me ...
> >
> >Regards,
> >Sathiyabama
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --
> 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] eval

2003-07-31 Thread Joona Kulmala
Decapode Azur wrote:

Is it possible to put PHP code in eval ?
Or just vars ?


$string = 'The result of ';

eval ($string);

?>
It should go like:

[code]

eval('$var = "The result of"; $a=2; $b=3; $c = $a + $b; $var .= "$a + $b is $c";');

[/code]

Just a question, what are you really trying to do?

Cheers, Joona
--
Joona Kulmala <[EMAIL PROTECTED]>
PHP Finland
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] eval

2003-07-31 Thread Adrian
PHP-Code:
eval('?>'.$string)

Vars:

eval('$string="'.str_replace('"','\\"',$string).'";');



> Is it possible to put PHP code in eval ?
> Or just vars ?


>  $string = 'The result of >';

> eval ($string);

?>>



-- 
Adrian
mailto:[EMAIL PROTECTED]
www: http://www.planetcoding.net
www: http://www.webskyline.de



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



Re: [PHP] Please Help

2003-07-31 Thread Joona Kulmala
My requirement is

1.I want to send video file using mail() function in PHP.So how to send
it.What is the procedure?
http://fi2.php.net/manual/en/ref.mail.php

Check out the templates, there is described how to build mail headers with
attachments. PHPs own mail function doesn't support this by default, thought.

2.How to delete one folder using PHP?
http://fi2.php.net/manual/en/function.unlink.php
http://fi2.php.net/manual/en/function.rmdir.php
Cheers, Joona
--
Joona Kulmala <[EMAIL PROTECTED]>
PHP Finland
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP or CGI in C/C++

2003-07-31 Thread John Manko
i did a quick google, and found the following.  hope it helps

http://phpcomplete.com/articles.php?sec=readArticle&id=306
http://www.php-accelerator.co.uk
plus, there is something called PHP bcompiler (byte compiler).

I dont know the details of any of these, but should help.  maybe others 
can expand on the details.

- John Manko

Decapode Azur wrote:

I would expect compiled C/C++ to be faster as there is no need for
the code to be interperated and compiled on each request.
   



Is it possible to compile PHP to improve the speed execution ?



 



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


[PHP] eval

2003-07-31 Thread Decapode Azur

Is it possible to put PHP code in eval ?
Or just vars ?


';

eval ($string);

?>

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



Re: [PHP] PHP or CGI in C/C++

2003-07-31 Thread Decapode Azur
> I would expect compiled C/C++ to be faster as there is no need for
> the code to be interperated and compiled on each request.


Is it possible to compile PHP to improve the speed execution ?



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



Re: [PHP] Please Help

2003-07-31 Thread John Manko
umm... ok.

www.google.com
www.php.net
that should get you started.

Sathiyabama wrote:

Dear PHP Team,

I request your help to sort some issues in using PHP.

1.Chennai IIT has developed one recorder.We can record our voice and
video.Its user defined extenion is MV4.
My requirement is

1.I want to send video file using mail() function in PHP.So how to send
it.What is the procedure?
2.How to delete one folder using PHP?

Please help me ...

Regards,
Sathiyabama






 



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


[PHP] Please Help

2003-07-31 Thread Sathiyabama
Dear PHP Team,

I request your help to sort some issues in using PHP.

1.Chennai IIT has developed one recorder.We can record our voice and
video.Its user defined extenion is MV4.

My requirement is

1.I want to send video file using mail() function in PHP.So how to send
it.What is the procedure?

2.How to delete one folder using PHP?


Please help me ...

Regards,
Sathiyabama







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



Re: [PHP] Opinions on Micro$oft .NET

2003-07-31 Thread Joel Rees
I hate to rain on this parade, but, 

> I'm a pretty good PHP programmer, and things
> I could knock out in a couple of hours seem to be WAY more difficult to
> do in .Net.  

This is the pith of the question. If you knew what you're doing,
anything from Microsoft takes longer to do than doing it the right way.

If you don't know what you're doing, M$ gets you most of the way there
for a cost.

Management has historically actually preferred that labor not know
anything. 

Therefore, Microsoft is Business.

If management thinks that's okay and you think that's okay, jump into
bed with them.

If you don't like the deepening recession, run like hell, because if you
think about it, it's exactly that kind of business that sucks all the
value out of things. (And that's exactly what recession and depression
are all about.)

-- 
Joel Rees
(The above opinion probably does not reflect the opinions of my employer.)


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



Re: [PHP] Mysql query and PHP loops

2003-07-31 Thread Nicholas Robinson
I think this does what you want. You can probably extend it to do the final 
check for val3 vs. val2 

select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as t2 
where t1.val2 <= t2.val2 group by t1.val1;

HTH

On Thursday 31 Jul 2003 3:22 pm, Petre Agenbag wrote:
> Hi List
>
> I've been trying to do something with one MySQL query, but I don't think
> it is possible, so, I would need to probably do multiple queries, and
> possibly have queries inside loops, but I am rather weary of that so,
> I'd like your views/possible solutions to doing the following:
>
>
> Consider this:
>
> idval1val2val3
> 1 a   1   1
> 2 b   2   3
> 3 a   1   2
> 4 b   2   1
> 5 c   3   3
> 6 c   2   1
>
> I need to query this table to return this:
>
> idval1val2val3
> 3 a   1   2
> 4 b   2   1
> 6 c   2   1
>
> Thus, I need to firstly only return ONE row for each val1, and that row
> MUST be that last row (ie, the row with the highest id, OR, should val3
> for instance be a date, then with the highest date).
>
>
> if I do a
>
> select distinct val1, MAX(id) from table order by val1, then it returns
>
> idval1
> 3 a
> 4 b
> 6 c
>
> which is correct, BUT
> select distinct val1, MAX(id), val2 from table order by val1
>
> it returns
>
> idval1val2
> 3 a   1
> 4 b   2
> 6 c   3   <--- incorrect
>
> it then returns the FIRST "hit" for val2 in the db, and NOT the one in
> the row with the max id...
>
> Can I do this with one query? ( PS, I cannot use MAX on val2 or val3,
> they are text)
>
>
> Thanks


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



Re: [PHP] Is there an easier way?

2003-07-31 Thread Joona Kulmala
Ryan A wrote:
The problem is I have 38 fields and i can get upto 5 records that means
i will end up with over 150 of these statements:
$blahn=$data['blah'][n];
and since i dont want to go all over my script saying "echo
$data['blah'][n];" is there an easier way to avoid the 150 possible
statements? maybe via a for loop or something? Am feeling braindead right
now after sitting on the comp for 7hrs straight.
PHP has function which makes normal variables of associative array.

http://fi2.php.net/manual/en/function.extract.php

With this just try something like this:

[code]

extract($data);

// then you can see what happened
var_dump($blah, $secondindex, $thirdindex); // try here few index names
// from $data.
[/code]

I hope this will help you.

Cheers, Joona
--
Joona Kulmala <[EMAIL PROTECTED]>
PHP Finland
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Upload scripts timing out

2003-07-31 Thread Evan Nemerson
php.net/set-time-limit


On Thursday 31 July 2003 09:03 pm, Josh Abernathy wrote:
> My current upload script times out too quickly when users are uploading
> large files. How can I stop this from happening?
>
> Thanks!

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



Re: [PHP] Re: value submit button

2003-07-31 Thread Justin French
Do some testing in a few browsers to see what happens when the user 
hits "enter" or "return", rather than clicking on the button(s)... I 
*think* you need to put in a hidden element.  For example, if you 
wanted "submit2" to be the default value:







Justin



On Friday, August 1, 2003, at 02:36  PM, hu zhenghui wrote:

You can get the button value use code below:








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


Re: [PHP] Opinions on Micro$oft .NET

2003-07-31 Thread John Manko
 "You have to be deviant if you're going to do anything new."
   - David Lee
Nka wrote:

On Thu, 31 Jul 2003 12:35:55 -0500, you wrote:

 

I know this is a little off topic but I really need some help with this.  

The company I work for just got bought out by a larger company.  The larger company uses .NET from Micro$oft. I of course use all open source stuff for our web sites and now the new company wants to come in and pretty much blow away everything I have done and use their .NET setup.

I've basically got a month to do research and get my guns loaded for what I'm sure will be a heated debate about the Open Source Solution vs the Micro$oft .NET solution.  So what I am looking for is personal and professional opinions about both solutions (specifically PHP etc), any and all links to good articles about both solutions giving the pros and cons of both technologies.  Any other mailing lists I can get on to get more opinions about the two technologies.  Are their any links to show the cost benifits of using Open Source vs Micro$oft .NET? (I know Open Source is free but I have no clue where to find how much .NET is).
   

In my experience, software and hardware costs are nothing. A VS.NET license
costs, what... 2 billed days of programmer time? Maybe 3 or 4 days of web
monkey time. Either way, it's trivial compared to a 5% (and that's a very
conservative estimate) saving in development time over 3 or 4 years use of
the tool.
Having said that, you have to factor in retraining costs. If it takes six
months to get your old programmers up to speed, it's probably easier to
stick with what you know. But in this case... what they know is .NET and
you're the interloper.
If I was management in that situation, I would be looking to reduce costs by
jettisoning the second company's overheads (such as the IT dept), and you're
about to make a massive pain-in-the-ass of yourself because of some dumb
religious issues. Way to go.
If they offer you .NET training grab it with both hands, because it means
they want to keep you around and it makes you more marketable. Remember, if
they already have/can find a .NET developer who knows enough PHP to maintain
legacy code... why even bother to retrain you?
(BTW, if you try to argue PHP v. ASP.NET on technical grounds you're gonna
get steamrollered, IMO. Seriously, look to what's best for you (learning new
skills) and the company you work for (supporting one platform, not two) and
spend your time developing a migration path, not a diatribe).
 



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


[PHP] Re: value submit button

2003-07-31 Thread hu zhenghui
You can get the button value use code below:







-- 

Hu Zhenghui
IBM Certified Solutions Expert IBM WebSphere Studio
 ISBN 7-5606-1163-X
 ISBN 7-900107-51-7
mailto:[EMAIL PROTECTED]
http://huzhenghui.51.net

"Florian SchäFer" <[EMAIL PROTECTED]> дÈëÏûÏ¢
news:[EMAIL PROTECTED]
> Hallo out there,
>
> i hava an document, with one form and two Submit buttons.
> How can i check in the target document wich button is pressed?
> tried something like   if ($submit == 'xxx') .
> anyone has a hint?
>
>




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



Re: [PHP] Opinions on Micro$oft .NET

2003-07-31 Thread Nka
On Thu, 31 Jul 2003 12:35:55 -0500, you wrote:

>I know this is a little off topic but I really need some help with this.  
>
>The company I work for just got bought out by a larger company.  The larger company 
>uses .NET from Micro$oft. I of course use all open source stuff for our web sites and 
>now the new company wants to come in and pretty much blow away everything I have done 
>and use their .NET setup.
>
>I've basically got a month to do research and get my guns loaded for what I'm sure 
>will be a heated debate about the Open Source Solution vs the Micro$oft .NET 
>solution.  So what I am looking for is personal and professional opinions about both 
>solutions (specifically PHP etc), any and all links to good articles about both 
>solutions giving the pros and cons of both technologies.  Any other mailing lists I 
>can get on to get more opinions about the two technologies.  Are their any links to 
>show the cost benifits of using Open Source vs Micro$oft .NET? (I know Open Source is 
>free but I have no clue where to find how much .NET is).

In my experience, software and hardware costs are nothing. A VS.NET license
costs, what... 2 billed days of programmer time? Maybe 3 or 4 days of web
monkey time. Either way, it's trivial compared to a 5% (and that's a very
conservative estimate) saving in development time over 3 or 4 years use of
the tool.

Having said that, you have to factor in retraining costs. If it takes six
months to get your old programmers up to speed, it's probably easier to
stick with what you know. But in this case... what they know is .NET and
you're the interloper.

If I was management in that situation, I would be looking to reduce costs by
jettisoning the second company's overheads (such as the IT dept), and you're
about to make a massive pain-in-the-ass of yourself because of some dumb
religious issues. Way to go.

If they offer you .NET training grab it with both hands, because it means
they want to keep you around and it makes you more marketable. Remember, if
they already have/can find a .NET developer who knows enough PHP to maintain
legacy code... why even bother to retrain you?

(BTW, if you try to argue PHP v. ASP.NET on technical grounds you're gonna
get steamrollered, IMO. Seriously, look to what's best for you (learning new
skills) and the company you work for (supporting one platform, not two) and
spend your time developing a migration path, not a diatribe).


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



Re: [PHP] tags to lowercase

2003-07-31 Thread Justin French
Curt,

Thanks for the link -- have downloaded the code, and will do some 
playing/testing later today -- sounds great!

Everyone else,

That tidy extension seems great, when I move into PHP 5 (a while off 
I'd guess), and yes, it appears I can install tidy into my own web 
space (even host said so, and offered to compile it too!), so that may 
be the other option.

With any luck, I should be able to write some wrappers to "tidy" from 
within a PHP script.

Thanks to everyone for their help,

Justin

On Thursday, July 31, 2003, at 12:41  PM, Curt Zirzow wrote:

* Thus wrote Justin French ([EMAIL PROTECTED]):
Sounds great, although I doubt my host will install... has anyone
considered such a beast running as a PHP function/class?
Hey justin,

well, i just got done toying around with a little function that can
do almost all of what you want.
With a little regex magic and the nice little function
preg_replace_callback()  I made it almost 100% combatible to html.
It will choke on some badly formated attributes though, thats the
only thing to get fixed.
Here is the code and test:
http://zirzow.dyndns.org/html/php/tests/tags_tolower/preg_replace.php


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


[PHP] Upload scripts timing out

2003-07-31 Thread Josh Abernathy
My current upload script times out too quickly when users are uploading
large files. How can I stop this from happening?
Thanks!

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


Re: [PHP] tags to lowercase

2003-07-31 Thread Justin French
Not really that useful -- essentially I want this as part of a CMS

On Thursday, July 31, 2003, at 11:55  AM, Jason Sheets wrote:

Tidy is available for DOS as well, you could run it on your windows 
machine locally then upload the source to your host.

Jason


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


RE: [PHP] session header issue

2003-07-31 Thread Ow Mun Heng
I changed it so that it's not an ABS URL. I had it working so.. I thought,
if it aint' broken, don't  fix it...

Well, I fixed it anyway, who knows it might cause problems somewhere..

Thank All.

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Sam Folk-Williams [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 11:41 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] session header issue


> That doesn't justify it. This is no different than writing screwed up HTML
> tables that happen to appear as you want in the browser you're testing
with.

GREAT point! Sorry, I didn't realize it was bad form. Just ignorant here -- 
I tried it with an absolule URL and it now works fine. Thanks for the help.

Sam

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- Sam Folk-Williams <[EMAIL PROTECTED]> wrote:
> > > The Location: header requires a correctly formed URL
> >
> > It works fine having Location: main.php
>
> That doesn't justify it. This is no different than writing screwed up HTML
> tables that happen to appear as you want in the browser you're testing
with.
> You never know when your broken code is going to cause problems somewhere,
and
> you've no one to blame but yourself when they do.
>
> It's much better for everyone just to do things the right way. The
Location
> header  should be an absolute URL.
>
> Chris
>
> =
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/



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



Re: [PHP] headline news retriever

2003-07-31 Thread David Otton
On Thu, 31 Jul 2003 20:26:25 -0400, you wrote:

>Does anyone know any headline news retrieving script/library specially 
>something able to check with several news sites? I'm planing to roll my own 
>but I want to see different approaches.

RSS.

The BBC (for example) have RSS feeds, and most journal sites offer them too.
See:

http://backend.userland.com/rss
http://directory.google.com/Top/Computers/Software/Internet/Site_Management/Content_Management/Content_Providers/

Competing formats (eg Echo) aren't so common, so unless you're planning to
interface with a specific provider RSS parsing offers maximum return for
minimum implementation effort.


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



Re: [PHP] Using $PHP_SELF

2003-07-31 Thread David Otton
On Thu, 31 Jul 2003 15:38:41 -0500, you wrote:

>I am having problems while transfering information to another page.  I
>am using $PHP_SELF and I am getting errors here is a bit of code so you
>can see what I am saying:
> 
>echo "$file\n";
> 
>This is what the browser is saying...
>Notice: Undefined variable: PHP_SELF in
>c:\inetpub\wwwroot\test\download.php on line 54
> 
>I don't know what to do.

either

you have register_globals turned off and should use $_SERVER['PHP_SELF']

or

you are attempting to use $PHP_SELF within a function, without having
declared it global first.

function test() {
global $PHP_SELF;
echo ($PHP_SELF);
}


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



Re: [PHP] What is $$

2003-07-31 Thread Jason Wong
On Friday 01 August 2003 10:59, Ryan A wrote:

> I have just found this in my book: $$var = $value
> what is the double dollar for? or is that a typo?
> Thanks,

Search manual for variable variables (and no, that is not a typo).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If you can't be good, be careful.  If you can't be careful, give me a call.
*/


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



Re: [PHP] What is $$

2003-07-31 Thread Paul Marinas

http://www.php.net/manual/en/language.variables.variable.php

On Fri, 1 Aug 2003, Ryan A wrote:

> Hi,
> I have just found this in my book: $$var = $value
> what is the double dollar for? or is that a typo?
> Thanks,
> -Ryan
>
>
> We will slaughter you all! - The Iraqi (Dis)information ministers site
> http://MrSahaf.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] What is $$

2003-07-31 Thread Ryan A
Hi,
I have just found this in my book: $$var = $value
what is the double dollar for? or is that a typo?
Thanks,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



RE: [PHP] Opinions on Micro$oft .NET

2003-07-31 Thread Wendell Brown
On Thu, 31 Jul 2003 14:04:02 -0400, Dan Joseph wrote:

>Yeah, the framework does.  The free editor is for web apps, the Visual
>Studio is for normal apps.

FYI, I just had Visual Studio ordered for me - a single license for it
with a 1 year subscription to MSDN was over $2800!  I don't know yet
what the yearly cost is going to be.  To be able to put the generated
code on the net is going to require a Microsoft web server.  My
understanding is that there is supposed to be a seat on the license for
EVERY non-anonymous login that is provided users.

I've been looking (under duress) at moving from PHP to .net and have
played with Web Matrix (the free .net IDE).  It now supports VB.net and
C#.  Visual Studio supports those and more as well as allows for
Windows app development.  I'm a pretty good PHP programmer, and things
I could knock out in a couple of hours seem to be WAY more difficult to
do in .Net.  

For instance (and before anyone gripes that the following comparison is
unfair - I am not trying to do a comparison - merely offering a couple
of observations), I dragged a xml viewer component to the aspx work
area (this "generated" about 50 lines of code) and then pointed it at a
40 meg xml file. about 15 minutes later I got an "Out Of Memory"
error on the asp page and no usable output.  Using PHP, I opened a 100
meg xml file, read through the records checking each one using a perl
regular expression and it took it 21 seconds to return - no output (I
wanted it to just count the number of xml groups - >17,000 with 20-30
elements each).  I'm probably going to see what happens tomorrow if I
try to load the entire 100 meg xml file into a PHP array --- I expect
it to "just work" and deal with the memory.


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



Re: [PHP] PHP or CGI in C/C++

2003-07-31 Thread Joel Rees
> Greetinx,

Greetinx to you to.

> I'm a newbie and wondering which PHP script or CGI in C/C++ generally can
> run/respond faster via http from the same server doing the same tasks.

CGI is inherently slow. The way I understand it, php as CGI will
probably be pretty much the same speed as C/C++ as CGI. PHP with mod_php
should be faster than C/C++ as CGI. 

Compiling a server module is a complicated business, so you would
probably want to avoid trying to compile a C/C++ webapp as a server
module unless you have lots of experience (and I doubt you would be
asking this question if you have that much experience.

A book you might find useful in this context is Chris Radcliff's Perl
for the Web. (Perl is one of PHP's grandpappies, so much of the
discussion will apply to PHP.)

> I appreciate your comments in advance.

I made no comments in advance, but you're welcome anyway. ;-P

-- 
Joel Rees, programmer, Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


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



Re: [PHP] jabber - chmod on files

2003-07-31 Thread Jason Wong
On Friday 01 August 2003 05:51, Carlos Castillo wrote:

[snip]

> How can I change the perm from the php page, so I change with chmod 644
> .xml before I open it

You can't unless you're running your php as root.

> or how can I modify jabber so it doesn't
> change the perm of the files?

Ask on the Jabber list, or ask the Jabber author(s).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Knocked, you weren't in.
-- Opportunity
*/


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



Re: [PHP] Yet another socket question...

2003-07-31 Thread Jason Wong
On Friday 01 August 2003 05:43, René Fournier wrote:

[snip]

> I know, but I'm not talking about writing to the socket, just echoing
> to the local Server command line. I would expect the echo'd text to
> appear in the server terminal window as the script runs--but it only
> appears when the server terminates. Here's the code:

[snip]

Try setting this in php.ini:

  output_buffering = Off

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Your manuscript is both good and original, but the part that is good is not
original and the part that is original is not good.
-- Samuel Johnson
*/


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



[PHP] Re: Page Break

2003-07-31 Thread hu zhenghui
in ie the code below will work:


-- 

Hu Zhenghui
IBM Certified Solutions Expert IBM WebSphere Studio
 ISBN 7-5606-1163-X
 ISBN 7-900107-51-7
mailto:[EMAIL PROTECTED]
http://huzhenghui.51.net

"Php" <[EMAIL PROTECTED]> дÈëÏûÏ¢ news:[EMAIL PROTECTED]
> Hello There!
>
> I am taking a report output in a .php3 page. Now if the report is long and
I
> want to print the page from browser, the print comes on more than one
pages.
> I want to insert a page break in print after every 20 records. Is this
> possible? If yes how?
>
> Someone has said, use ASCII characters. But how?
>
> Thanks and regards!
>
>



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



Re: [PHP] splitting content from database into pages again

2003-07-31 Thread daniel
function page_content($content,$limit = 10,$page) {
$limit=20;

$afile = explode("\r\n", $content);
$maxline = count($afile);   // count existing lines
$max = $maxline - 1;
$page ? $page = $page : $page = 1;
$s=$page+$limit;
for ($i=$page; $i<$s; $i++) {
   $dtrow = explode("|", $afile[$i]);
   $row = "$dtrow[0]";
   $formatted_content .= $row."\n";
}

$p = 1;
$u = ceil($max/$limit);
for ($t=1; $t<=$u; $t++) {
   $formatted_content .= "$t ";
$p=$p+$limit;
}
return $formatted_content;
}



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



Re: [PHP] splitting content from database into pages again

2003-07-31 Thread daniel
ok this seemed to work using the text paging example replace the file line
with this $afile = explode("\r\n", $string);
> hi guys regarding my question yesterday here is exactly what i want to
> do
>
> http://www.evilwalrus.com/articles.php?aid=42
>
> this is obvioiusly splitting the content up when pull from the database
>
> here is an example but is uses text files
>
> http://www.evilwalrus.com/viewcode.php?codeEx=522
>
> is there a way to stream the data from the database into an fopen ?
>
>
>
> --
> 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 there an easier way?

2003-07-31 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Fri, 1 Aug 2003 at
02:04, lines prefixed by '>' were originally written by you.
> Hi,
> This is what i am doing, querying a database via a select
statement
> (getting
> max 5 records), then dumping everything into an associative array.
And
> then
> assign the arrays value to a variable for easier readibility and
> usability
> like so:
> if(!($rs = mysql_query($q))) // querying
>   { echo "Query failed". mysql_error(); exit; }
>$n = 0;
>   while ($line = mysql_fetch_assoc($rs)) { //dumping into an
array
> foreach ($line as $field => $value) {
>   $data[$field][$n] = $value;
> }
> $n++;
>   }
> and this is how i use the arrays values (blah is the field name):
> $blah1=$data['blah'][0];
> $blah2=$data['blah'][1];
> $blah3=$data['blah'][2];

The logic you are using is a bit messed up.  You should be aiming to
get an array like...
$data[0]['field1']
['field2']
 [1]['field1']
['field2']
..and this can be done like this...
  $data = array();
  while ($line = mysql_fetch_assoc($rs)) {
  $data[] = $line;
  }

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



RE: [PHP] Is there an easier way?

2003-07-31 Thread Jennifer Goodie
> if(!($rs = mysql_query($q))) // querying
>   { echo "Query failed". mysql_error(); exit; }
> 
> 
>$n = 0;
>   while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
> foreach ($line as $field => $value) {
>   $data[$field][$n] = $value;
> }
> $n++;
>   }
> 
> and this is how i use the arrays values (blah is the field name):
> $blah1=$data['blah'][0];
> $blah2=$data['blah'][1];
> $blah3=$data['blah'][2];

This should work.  Try it and see.
$n = 0;
   while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
 foreach ($line as $field => $value) {
$tmp = $field.$n;
$$tmp = $value;
}
 $n++;
   }

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



[PHP] splitting content from database into pages again

2003-07-31 Thread daniel
hi guys regarding my question yesterday here is exactly what i want to do

http://www.evilwalrus.com/articles.php?aid=42

this is obvioiusly splitting the content up when pull from the database

here is an example but is uses text files

http://www.evilwalrus.com/viewcode.php?codeEx=522

is there a way to stream the data from the database into an fopen ?



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



[PHP] Is there an easier way?

2003-07-31 Thread Ryan A
Hi,
This is what i am doing, querying a database via a select statement (getting
max 5 records), then dumping everything into an associative array. And then
assign the arrays value to a variable for easier readibility and usability
like so:

if(!($rs = mysql_query($q))) // querying
  { echo "Query failed". mysql_error(); exit; }


   $n = 0;
  while ($line = mysql_fetch_assoc($rs)) { //dumping into an array
foreach ($line as $field => $value) {
  $data[$field][$n] = $value;
}
$n++;
  }

and this is how i use the arrays values (blah is the field name):
$blah1=$data['blah'][0];
$blah2=$data['blah'][1];
$blah3=$data['blah'][2];

The problem is I have 38 fields and i can get upto 5 records that means
i will end up with over 150 of these statements:
$blahn=$data['blah'][n];
and since i dont want to go all over my script saying "echo
$data['blah'][n];" is there an easier way to avoid the 150 possible
statements? maybe via a for loop or something? Am feeling braindead right
now after sitting on the comp for 7hrs straight.

Any and all suggestions welcome. When/If replying please give me a code
example of what you say as I may not understand you.

Thanks,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



RE: [PHP] System() works on /usr/sbin commands

2003-07-31 Thread Daevid Vincent
Add an entry to /etc/sudoers like so:

nobody  ALL=NOPASSWD: /bin/date


Daevid Vincent
http://daevid.com
 

> -Original Message-
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 31, 2003 3:02 AM
> To: tirumal b
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] System() works on /usr/sbin commands
> 
> 
> Check out sudo (man sudo), but you must be carefull.
> 
> tirumal b wrote:
> 
> > hello,
> > 
> >   yes the /usr/sbin commands require root permissions
> > but is there any way to run these commands using
> > system() through suid or something.please let me know
> > 
> > Thank you
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design software
> > http://sitebuilder.yahoo.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] Cookies on WinXP

2003-07-31 Thread Curt Zirzow
* Thus wrote Chris Shiflett ([EMAIL PROTECTED]):
> --- Steve Buehler <[EMAIL PROTECTED]> wrote:
> > Something else I found out now.  I think it was Cpt John W. Holmes
> > (not sure though) that said I couldn't have a cookie as an array
> > like this the following. So i am not sure if it is something that
> > is going away or not.
> > setcookie ("admin_access[host]", "$cookhost",0,"/","$cookhost");
> > setcookie ("admin_access[hostName]", "$hostName",0,"/","$cookhost");
> 
> No, this is fine, as I mentioned previously. Yes, I recall someone saying you
> could not do this, claiming the name was invalid by referencing 2109, but I
> thought I replied and corrected them. My apologies if I failed to do so.

I was the one stating rfc2109, and only suggesting that might be
the problem. And yes the reply did come through.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Possible My Website was hacked... with PHP... please tell me what this is???

2003-07-31 Thread Tom Rogers
Hi,

Thursday, July 31, 2003, 4:06:12 PM, you wrote:
JH> I found this on my server... I have no idea what it is... can someone
JH> tell me what it does... 

if you use apache you can do this to protect against uploaded php
scripts



php_flag engine off


-- 
regards,
Tom


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



RE: [PHP] is there a way?

2003-07-31 Thread Jennifer Goodie
> Is there a way to have your html table represent one color,
> Cause when I click the link it turnes purple, and I want it to stay
> 336699
> no matter what state.
>
> I tried to use css, but it does the whole page.
> And I want the 336699 to be in this table alone.
>
> Can anyone help me out with this small problem?

Create a class specifically for that table and it's links.

for example

.yourtable {font-family: Verdana, Arial, Helvetica, sans-serif;font-size:
8pt; color: #ff;}
A.yourtable:link { text-decoration: underline; font-weight: normal; color:
#336699;}
A.yourtable:visited { text-decoration: underline; font-weight: normal;
color: #336699;}
A.yourtable:hover { text-decoration: underline; font-weight: normal; color:
#336699;}
A.yourtable:active { text-decoration: underline; font-weight: normal; color:
#336699;}


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



Re: [PHP] Re: include help please

2003-07-31 Thread Curt Zirzow
* Thus wrote LoonySalmon ([EMAIL PROTECTED]):
> 
> i want to call up my contact page, but how do i do it?
> 
> http://localhost/index.php?page=$contact

I hope you cant use something like:
  http://localhost/index.php?page=%2Fetc%2Fpasswd


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] is there a way?

2003-07-31 Thread karl james
Hello guys,
This may be off subject but not sure!


Is there a way to have your html table represent one color,
Cause when I click the link it turnes purple, and I want it to stay
336699
no matter what state.

I tried to use css, but it does the whole page.
And I want the 336699 to be in this table alone.

Can anyone help me out with this small problem?

Here is my site,
Im starting with the quick links.
If you can show me an example with that code..
At theufl.com

Any advise would be tremendous!
Thanks
karl
("The Saint")
[EMAIL PROTECTED]
theufl.com




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



[PHP] headline news retriever

2003-07-31 Thread andu
Does anyone know any headline news retrieving script/library specially 
something able to check with several news sites? I'm planing to roll my own 
but I want to see different approaches.

Andu

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


Re: [PHP] Cookies on WinXP

2003-07-31 Thread Chris Shiflett
--- Steve Buehler <[EMAIL PROTECTED]> wrote:
> Something else I found out now.  I think it was Cpt John W. Holmes
> (not sure though) that said I couldn't have a cookie as an array
> like this the following. So i am not sure if it is something that
> is going away or not.
> setcookie ("admin_access[host]", "$cookhost",0,"/","$cookhost");
> setcookie ("admin_access[hostName]", "$hostName",0,"/","$cookhost");

No, this is fine, as I mentioned previously. Yes, I recall someone saying you
could not do this, claiming the name was invalid by referencing 2109, but I
thought I replied and corrected them. My apologies if I failed to do so.

Actually, I just searched and found the link:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=20030730231223.3962.qmail%40web14303.mail.yahoo.com

I may write up a detailed explanation of cookies sometime, since they are a
somewhat confusing topic (especially with the odd use of words we use, such as
setting a cookie). Since they are essentially an extension of the HTTP
protocol, it helps to understand the architecture of the Web a bit more to
really grok the subject

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Cookies on WinXP

2003-07-31 Thread Chris Shiflett
--- Steve Buehler <[EMAIL PROTECTED]> wrote:
> Well, if I take off the "string domain" part, it will work just
> fine.

This is what I was trying to explain. The cookie wasn't being returned, because
the browser didn't think the hostname matched. By leaving it out, the browser
will use whatever it thinks the current hostname is, so it's sure to match.

You're also right about the order of setcookie() - the parameters are optional,
but since they are based on order, you can't selectively leave any out except
in between.

If you want to be able to specify whatever cookie restrictions you want, you
can always use header(). Both functions modify the HTTP headers; the only
difference with manually writing your own is that you could screw up the
formatting. My opinion on that is that you could screw up the formatting of the
values of setcookie() anyway, so it doesn't necessarily save you. :-) In short,
use header() if you require the flexibility, and use setcookie() if you want a
bit of help and abstraction.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Cookies on WinXP

2003-07-31 Thread Steve Buehler
Something else I found out now.  I think it was Cpt John W. Holmes (not 
sure though) that said I couldn't have a cookie as an array like this the 
following.  So i am not sure if it is something that is going away or not.
setcookie ("admin_access[host]", "$cookhost",0,"/","$cookhost");
setcookie ("admin_access[hostName]", "$hostName",0,"/","$cookhost");

But I found the following on the php site at:
http://us3.php.net/manual/en/function.setcookie.php
-snip-
   * Cookies names can be set as array names and will be available to your 
PHP scripts as arrays but seperate cookies are stored on the users system. 
Consider explode() or 
serialize() to set one 
cookie with multiple names and values.


// after the page reloads, print them out
if (isset($_COOKIE['cookie'])) {
foreach ($_COOKIE['cookie'] as $name => $value) {
echo "$name : $value \n";
}
}
/* which prints

three : cookiethree
two : cookietwo
one : cookieone
*/
?>
-end snip
I want to thank everybody for your help.

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


Re: [PHP] Cookies on WinXP

2003-07-31 Thread Steve Buehler
h.  Just found out what was wrong.  These are the specs that php.net 
says a setcookie function can have:
setcookie ( string name [, string value [, int expire [, string path [, 
string domain [, int secure])
Well, if I take off the "string domain" part, it will work just fine.  The 
problem is that I can't use the "int secure".  No biggy right now, but I 
might want to do that in the future.  So the following works just fine now:
setcookie("aa_host",$cookhost,'0','/');
Can anybody explain this now?  BTW, I put on an actual domain name to my 
laptop and put that domain name in the "string domain" parameter and it 
still didn't work.

Steve

At 05:53 PM 7/31/2003 -0500, Steve Buehler wrote:
I still can't figure something out.  I am using WinXP/Apache 1.3.24/PHP 
4.2.3 on my laptop and my cookies still don't work like they 
should.  Hopefully someone can explain to me why.

$cookhost=$_SERVER["HTTP_HOST"];
header("Set-Cookie: aa_host=$cookhost;");
setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
setcookie ("aa_host", "localhost",0,"/","localhost");
setcookie ('aa_host', 'localhost',0,'/','localhost');
?>

I can set the cookie with the "header" line with no problem, but either 
one of the "setcookie" lines will not set the cookie.  Has anybody seen 
this?  Does anybody know why this might be happening?  BTW, no, I do not 
try to set all of these at once.  Just showing the lines that I use.  The 
"header" line and the first two "setcookie" lines work just fine on a 
RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.

Thanks
Steve


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


Re: [PHP] Cookies on WinXP

2003-07-31 Thread Chris Shiflett
--- Steve Buehler <[EMAIL PROTECTED]> wrote:
> $cookhost=$_SERVER["HTTP_HOST"];
> header("Set-Cookie: aa_host=$cookhost;");
> setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
> setcookie ("aa_host", "localhost",0,"/","localhost");
> setcookie ('aa_host', 'localhost',0,'/','localhost');
...
> I can set the cookie with the "header" line with no problem,
> but either one of the "setcookie" lines will not set the cookie.

Hi Steve,

You're not specifying a hostname in your header() example, but you are in each
of the setcookie() examples (and randomly switching between using $cookhost as
a value or as a hostname).

My advice is to check out http://www.php.net/setcookie and paying close
attention to:

1. The order of the parameters
2. The fact that they are not all required

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Cookies on WinXP

2003-07-31 Thread Jeff Harris
On Jul 31, 2003, "Steve Buehler" claimed that:

|I still can't figure something out.  I am using WinXP/Apache 1.3.24/PHP
|4.2.3 on my laptop and my cookies still don't work like they
|should.  Hopefully someone can explain to me why.
|
|
|I can set the cookie with the "header" line with no problem, but either one
|of the "setcookie" lines will not set the cookie.  Has anybody seen
|this?  Does anybody know why this might be happening?  BTW, no, I do not
|try to set all of these at once.  Just showing the lines that I use.  The
|"header" line and the first two "setcookie" lines work just fine on a
|RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.
|
|Thanks
|Steve

1st, what is the difference between what you are expecting and what you
are getting?

2nd, you do realize that since you're setting the cookies to have an
expiration of 0, that will delete the cookies when the brower is closed.

3rd, you know that you can't pick up the cookies in the same page where
they are set.

try letting some defaults persist to track downm errors:
setcookie ("aa_host", $cookhost,time()+3600);

Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Cookies on WinXP

2003-07-31 Thread Tom Rogers
Hi,

Friday, August 1, 2003, 8:53:51 AM, you wrote:
SB> I still can't figure something out.  I am using WinXP/Apache 1.3.24/PHP 
SB> 4.2.3 on my laptop and my cookies still don't work like they 
SB> should.  Hopefully someone can explain to me why.
SB>  $cookhost=$_SERVER["HTTP_HOST"];
SB> header("Set-Cookie: aa_host=$cookhost;");
SB> setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
SB> setcookie ("aa_host", "localhost",0,"/","localhost");
SB> setcookie ('aa_host', 'localhost',0,'/','localhost');
?>>

SB> I can set the cookie with the "header" line with no problem, but either one 
SB> of the "setcookie" lines will not set the cookie.  Has anybody seen 
SB> this?  Does anybody know why this might be happening?  BTW, no, I do not 
SB> try to set all of these at once.  Just showing the lines that I use.  The 
SB> "header" line and the first two "setcookie" lines work just fine on a 
SB> RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.

SB> Thanks
SB> Steve

try setting up a domain on your laptop, add this to the hosts file

127.0.0.1   mylaptop.com
127.0.0.1   www.mylaptop.com

Then use that instead of localhost, maybe it will be better with a
real looking domain.

-- 
regards,
Tom


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



[PHP] Cookies on WinXP

2003-07-31 Thread Steve Buehler
I still can't figure something out.  I am using WinXP/Apache 1.3.24/PHP 
4.2.3 on my laptop and my cookies still don't work like they 
should.  Hopefully someone can explain to me why.

$cookhost=$_SERVER["HTTP_HOST"];
header("Set-Cookie: aa_host=$cookhost;");
setcookie ("aa_host", "$cookhost",0,"/","$cookhost");
setcookie ("aa_host", "localhost",0,"/","localhost");
setcookie ('aa_host', 'localhost',0,'/','localhost');
?>

I can set the cookie with the "header" line with no problem, but either one 
of the "setcookie" lines will not set the cookie.  Has anybody seen 
this?  Does anybody know why this might be happening?  BTW, no, I do not 
try to set all of these at once.  Just showing the lines that I use.  The 
"header" line and the first two "setcookie" lines work just fine on a 
RedHat 7.3/Apache 1.3.27/PHP 4.2.2 machine.

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


Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
thanks jeff harris, that is exactly what my problem was,
now it works
good night all

thank a million


"Jeff Harris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Aug 1, 2003, "LoonySalmon" claimed that:
>
> |and btw, this is my code now:
> |
> | |require 'files.inc.php';
> |
> |if (isset($page)) {
> |include $$_GET['page'];
> |} else {
> |$page = $main;
> |include $page;
> |}
> |?>
> --
>
> Is $main being set inside a function?
> http://www.php.net/language.variables.scope
> Also, for future compatability, you should probably change the 3rd line to
> "if (isset($_GET['page'])) {" That will also help incase files.inc.php is
> inadvertently setting varables incorrectly.
>
> Jeff
> --
> Registered Linux user #304026.
> "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
> Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
> Responses to this message should conform to RFC 1855.
>
>



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



Re: [PHP] Re: include help please

2003-07-31 Thread Jeff Harris
On Aug 1, 2003, "LoonySalmon" claimed that:

|and btw, this is my code now:
|
|
-- 

Is $main being set inside a function?
http://www.php.net/language.variables.scope
Also, for future compatability, you should probably change the 3rd line to
"if (isset($_GET['page'])) {" That will also help incase files.inc.php is
inadvertently setting varables incorrectly.

Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
and btw, this is my code now:









"Loonysalmon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> well crap, it turns out that i'm back to step 1, but with more code
> it won't load up the other files now when defined through the url.  i
guess
> that there is something wrong, but what could it be?
>
>
>
> "Loonysalmon" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > if (isset($page)) {
> > include $$_GET['page'];
> > } else {
> > $page = $home;
> > include $page;
> > }
> >
> > would that be right?
> > or should i use
> >
> > if (isset($page)) {
> > include $$_GET['page'];
> > } else {
> > include $home;
> > }
> >
> > hopefully that's right.  if so, pretty good for a n00b
> >
> >
>
>



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



Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
well crap, it turns out that i'm back to step 1, but with more code
it won't load up the other files now when defined through the url.  i guess
that there is something wrong, but what could it be?



"Loonysalmon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> if (isset($page)) {
> include $$_GET['page'];
> } else {
> $page = $home;
> include $page;
> }
>
> would that be right?
> or should i use
>
> if (isset($page)) {
> include $$_GET['page'];
> } else {
> include $home;
> }
>
> hopefully that's right.  if so, pretty good for a n00b
>
>



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



[PHP] jabber - chmod on files

2003-07-31 Thread Carlos Castillo








HI, 

 

I'm using jabber but I have
one problem, I did an administrator webpage for it, so I create the users for
jabber in that page, when I create the user, it creates a xml file with
permission of 644 and the owner is apache, but when I connect on the jabber or
that user connects the xml file changes to 600 and the owner to root.

 

The problem is that I have to
read that file after he connects but when I try I don't have access,
because the perm is on 600, 

 

How can I change the perm
from the php page, so I change with chmod 644 .xml before I open
itor how can I modify jabber so it doesn't change the perm of the
files?

 

Thanks!

 

Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]



Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia 

- Soluciones web para Internet e Intranet

- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico


 








Re: [PHP] Re: include help please

2003-07-31 Thread Brad Pauly
Jennifer Goodie wrote:

I don't think I'd let someone pass any page they wanted via a get and just
include that page.
If you have URL fopen wrappers on I can create a page on my server and
include it to your page and pretty much execute any code I want on your
server.
example:

http://www.yourdomain.com?yourscript.php?page=http://mydomain.com/myscript.p
hp
Now my code is included in your page and executed.  Do you really trust me
to only have nice code in my page?
This is a very good point. Definitely make sure you know what you are 
including. If you are predefining the names of the files to be included 
and then using $_GET['page'] to pass the name of the variable (which was 
being done in files.inc.php), you have control over the files that are 
included. Nevertheless, be careful. If you have register_globals on I am 
not sure what would happen if you had:

http://yousite.com/index.php?page=home&home=http://othersite.com/bad.php

Although I think you would still be ok.

- Brad



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


Re: [PHP] Yet another socket question...

2003-07-31 Thread René Fournier
On Thursday, July 31, 2003, at 02:45  PM, Chris Shiflett wrote:

--- René_Fournier <[EMAIL PROTECTED]> wrote:
Is it normal for a socket server to output all the echo'd
messages only after the socket terminates?
Can you explain what situation you're trying to describe? For example, 
echo
does not write to a socket, so there's more going on than you're 
telling us.
I know, but I'm not talking about writing to the socket, just echoing 
to the local Server command line. I would expect the echo'd text to 
appear in the server terminal window as the script runs--but it only 
appears when the server terminates. Here's the code:



set_time_limit (0);
$host = "192.168.0.77";
$port = 1234;
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not 
create
socket\n");
$result = socket_bind($socket, $host, $port) or die("Could not bind to
socket\n");
$result = socket_listen($socket, 3) or die("Could not set up socket
listener\n");

echo "Waiting for connections...\n";

$spawn = socket_accept($socket) or die("Could not accept incoming
connection\n");
echo "Received connection request\n";

$welcome = "Welcome!\n> ";
socket_write($spawn, $welcome, strlen ($welcome)) or die("Could not send
connect string\n");
$input = socket_read($spawn, 1024) or die("Could not read input\n");
socket_write($spawn, strrev($input), strlen ($input)) or die("Could not 
send\n");
socket_close($spawn);

socket_close($socket);
echo "Socket terminated\n";
?>



(Now I start the server:)
[Valhalla:~] rene% /usr/local/php/bin/php socket5.php4


(In another terminal window:)
[Valhalla:~] rene% telnet 192.168.0.77 1234
Trying 192.168.0.77...
Connected to 192.168.0.77.
Escape character is '^]'.
Welcome!
>
(Now, even though the server is running and a socket is connected, the 
server window does not echo "Waiting for connections...".)



In the client window, I type:
> Hello world
dlrow olleHConnection closed by foreign host.
[Valhalla:~] rene%
(Now something happens in the server window:)
[Valhalla:~] rene% /usr/local/php/bin/php socket5.php4
Waiting for connections...
Received connection request
Socket terminated
 [Valhalla:~] rene%




(But when you look at the source code, shouldn't the "Waiting for 
connections" display as soon as the server is running, or at least when 
I try to telnet to it? Why would it wait until terminated??)



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


RE: [PHP] Re: include help please

2003-07-31 Thread Jennifer Goodie
> if (isset($page)) {
> include $$_GET['page'];
> } else {
> $page = $home;
> include $page;
> }
>
> would that be right?
> or should i use
>
> if (isset($page)) {
> include $$_GET['page'];
> } else {
> include $home;
> }
>
> hopefully that's right.  if so, pretty good for a n00b
>

I don't think I'd let someone pass any page they wanted via a get and just
include that page.

If you have URL fopen wrappers on I can create a page on my server and
include it to your page and pretty much execute any code I want on your
server.

example:

http://www.yourdomain.com?yourscript.php?page=http://mydomain.com/myscript.p
hp

Now my code is included in your page and executed.  Do you really trust me
to only have nice code in my page?


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



[PHP] (done) session not carrying...why?

2003-07-31 Thread Ryan A
Hey,
I got it, the problem was that where i was setting the session i didnt have
a session_start().
Thanks anyway.
Cheers,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
for some odd reason, $home wasn't working, so i changed home to main and now
it works

thanks for all the good support guys/gals?

L00NY54LM0N - 16 year old coder in the makin



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



Re: [PHP] Re: include help please

2003-07-31 Thread Matt Matijevich

is there anyway where i can check if page is defined in the url?


not sure I know exactly what you mean but I think you could use
something like this

$foo = @include("index.php");

if ($foo) {
 //index.php was valid
} else {
 //index.php was not valid
}

there also might be a better way to do this.



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



Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
if (isset($page)) {
include $$_GET['page'];
} else {
$page = $home;
include $page;
}

would that be right?
or should i use

if (isset($page)) {
include $$_GET['page'];
} else {
include $home;
}

hopefully that's right.  if so, pretty good for a n00b



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



[PHP] session not carrying...why?

2003-07-31 Thread Ryan A
Hi,
I seem to be setting the session properly but its not showing on the next
page...any idea why?
I am sending data to save.session.php via checkboxes like so:
..";
print_r($not_checked); //working
print_r("".$_SESSION['hide']['noPlatform']); //this prints 1
echo "".$_SESSION['hide']['noPrice']; //this prints 1

if (isset($_SESSION['hide']['noPlatform']))
{ echo "blah blah"; } // this is printing
else {echo "You are doing something wrong";}
?>

then in another page I have:




BestWebHosters.com - Compare 




.

and this gives me:
Notice: Undefined index: hide in
c:\phpdev\www\bwh\project\customize.shared.php on line 14
the value is:


What am i doing wrong?
I checked all my includes every last one of the have a session_start etc...

Please help.

Cheers,
-Ryan





We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



Re: [PHP] Re: include help please

2003-07-31 Thread Brad Pauly
LoonySalmon wrote:
if page is defined in url, include page defined
else include home
You are on the right track. Take a look at the manual.

http://us4.php.net/manual/en/index.php

http://us4.php.net/isset

- Brad



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


Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
ok
i have that done, but now i can't just have index.php because i get an error

is there anyway where i can check if page is defined in the url?

if so, could somebody make me a simple script? this is my first time with
php

i'm guessing that it would be something like this, but summed up



if page is defined in url, include page defined
else include home



that's what i'm thinking, but i'm not sure how to do it



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



Re: [PHP] Re: include help please

2003-07-31 Thread Brad Pauly
LoonySalmon wrote:
that isn't really what i want
i want to have a seperate file where i declare the variables.
what i'm getting at here is this, well, take a look at this page:
http://l33trus.servebeer.com/site/index.php
i just want to include a page into the table where it says that it's
included
what i'm going for here is to choose the page i want in that space by
defining it in the url, such as
http://l33trus.servebeer.com/site/index.php?page=contact
but how would i do that?
Based on the code posted before I think you should be able to do:

include $$_GET['page'];

- Brad



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


Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
that isn't really what i want
i want to have a seperate file where i declare the variables.
what i'm getting at here is this, well, take a look at this page:
http://l33trus.servebeer.com/site/index.php

i just want to include a page into the table where it says that it's
included

what i'm going for here is to choose the page i want in that space by
defining it in the url, such as
http://l33trus.servebeer.com/site/index.php?page=contact

but how would i do that?





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



Re: [PHP] Re: include help please

2003-07-31 Thread Chris Shiflett
> http://localhost/index.php?page=contact.html
> 
> And get rid of your hard-coded set for $contact, and use
> $_GET['contact'] instead.

My apologies. I meant $_GET['page'].

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Using $PHP_SELF

2003-07-31 Thread Matt Matijevich
try $_SERVER["PHP_SELF"]



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



Re: [PHP] Form Retain Info on Back?

2003-07-31 Thread Joona Kulmala
Hi

I have a php form that I run a test to see if they have entered in
all required fields before inserting into a MySQL db.  The PHP script
simply reports what is missing and exits the rest of the page.
However, when you click the back button, all the information that was
entered, is gone.  Is there a simple way of retaining this
information so the user doesn't has to retype all the information in?
If you had a MySQL connection, I think that the easiest (also most safe
and stable) solution would be putting the POST-data and error-report
to session/temporary mysql-table. I've used this kind of solution on
several projects and it has work pretty well. In this you'll also need
to set some information to cookies so user must have cookies enabled on
his/her browser.
* MySQL-table

I've been using specifid session-table in my projects, which also
carries logged users sessionid and other session-data. But you can
also create specific temp-table for incomplete form-data. It could
be something like this
[sql]

CREATE TABLE temp_form_data (
id int(10) UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
stamp int(10) NOT NULL,
data blob NOT NULL,
error blob NOT NULL
);
[/sql]



* Form prosessing

Then in the form prosessing you could make some kind of error array
where to include error information. If any errors occur, save post
and error data to mysql and set cookie with mysqls
mysql_insert_id()
Example:
[code]
$error = array();

// validate fields how you like, I do regexps.
// check for email-address field.
if 
(!preg_match('/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/', 
$_POST['mail'], $res))
{
// make an new index to $error array, you can assign any value
// you like for index.
$error['mail'] = 1;
}

// check if any errors occured
if (count($error) > 0)
{
// make a serialized dump of both $_POST and $error array
$dump_data = addslashes(serialize($_POST));
$dump_error = addslashes(serialize($error));
// build a sql-query to update form and error data to mysql
// table.
$sql  = "INSERT INTO temp_form_data ";
$sql .= "(date, data, error) ";
$sql .= "VALUES (UNIX_TIMESTAMP(),'{$dump_data}','{$dump_error}')";
// execute
if (mysql_query($sql))
{
// set cookie
setcookie('temp_form_data_id', mysql_insert_id());
// get user back to form.
// IMPORTANT: this must be before anything has been printed else
// it won't work.
header ("Location: form.php");
}
else
{
print "MySQL Error: " . mysql_error();
}
}
else
{
// FORM IS VALIDATED SUCCESFULLY
// insert data
}
[/code]

* Form itself

In form you have to first check if "temp_form_data_id" cookie exists.
If does, you should load saved form data from db. After loading data
you should check before every field does error array have index matching
fields name. You should also assign values to fields from db.
Here's an example:
[code]
if (isset($_COOKIE['temp_form_data_id']) && 
!empty($_COOKIE['temp_form_data_id']))
{
$id = $_COOKIE['temp_form_data_id'];

// select
$sql  = "SELECT * ";
$sql .= "FROM temp_form_data ";
$sql .= "WHERE id = {$id} ";
// execute
if ($q = mysql_query($sql))
{
// fetch row
$result = mysql_fetch_row($q);
// unserialize
$error = unserialize(stripslashes($result['error']));
$data = unserialize(stripslashes($result['data']));
else
{
print "MySQL Error: " . mysql_error();
}
}
if ($error) print 'Form was filled incorrectly';

print '';
if ($error['mail']) print 'Error: user valid email address';
print 'Email address:';
print sprintf('', $data['mail']);
print '';
[/code]

This is how it should work. I hope you get the picture.

Cheers, Joona.

--
Joona Kulmala <[EMAIL PROTECTED]>
PHP Finland
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Using $PHP_SELF

2003-07-31 Thread Buntin, Seth - KATE
I am having problems while transfering information to another page.  I
am using $PHP_SELF and I am getting errors here is a bit of code so you
can see what I am saying:
 
echo "$file\n";
 
This is what the browser is saying...
Notice: Undefined variable: PHP_SELF in
c:\inetpub\wwwroot\test\download.php on line 54
 
I don't know what to do.


Re: [PHP] Re: include help please

2003-07-31 Thread Chris Shiflett
--- LoonySalmon <[EMAIL PROTECTED]> wrote:
> INDEX.PHP
> >  require 'files.inc.php';
> $page = $home;
> include $page;
> ?>
> 
> FILES.INC.PHP
> >  $home = 'home.html';
> $forum = 'forum/index.php';
> $contact = 'contact.html';
> ?>
> 
> http://localhost/index.php?page=$contact

http://localhost/index.php?page=contact.html

And get rid of your hard-coded set for $contact, and use $_GET['contact']
instead.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] PHP or CGI in C/C++

2003-07-31 Thread Jeff Harris
On Jul 31, 2003, "David Nicholson" claimed that:

|Hello,
|
|This is a reply to an e-mail that you wrote on Thu, 31 Jul 2003 at
|13:38, lines prefixed by '>' were originally written by you.
|> Greetinx,
|> I'm a newbie and wondering which PHP script or CGI in C/C++
|generally
|> can
|> run/respond faster via http from the same server doing the same
|tasks.
|> I appreciate your comments in advance.
|
|I would expect compiled C/C++ to be faster as there is no need for
|the code to be interperated and compiled on each request.  You will
|need to do your own benchmarking to see if the difference bothers you
|though.
|David.
|--

Usually, though, the speed difference you pick up or lose from one
instruction set is miniscule compared to the time it takes for the html to
speed across the Internet. Asking about speed of a script on one language
against another is a moot point. If you ask "is it faster to save a cookie
on the user's machine or save it in a database," you'd get an answer that
would probably help you design a faster site.

If you have a site getting enough hits per second to actually make a
difference, then there are some other speed considerations before getting
to the output. In this case, you'd have to ask yourself if the speed
picked up on the output is worth the time difference in the development
cycle.

Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



[PHP] Re: include help please

2003-07-31 Thread LoonySalmon
lol, yet again i need some more help

as you guys can see from the scripts before, i am including a file into a
page.  now my only problem is trying to include a different file.


what i have

INDEX.PHP



FILES.INC.PHP




i want to call up my contact page, but how do i do it?

http://localhost/index.php?page=$contact

or how would i do that?



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



Re: [PHP] Yet another socket question...

2003-07-31 Thread Chris Shiflett
--- René_Fournier <[EMAIL PROTECTED]> wrote:
> Is it normal for a socket server to output all the echo'd
> messages only after the socket terminates?

Can you explain what situation you're trying to describe? For example, echo
does not write to a socket, so there's more going on than you're telling us.

In general, regardless of programming language, a socket is only written to
when a call is made to the function that does so. PHP's socket_write() is an
example, and it basically implements the C API's corresponding function.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] standardize @throws for phpdocumentor 2.0?

2003-07-31 Thread Ray Hunter
> @throws constant|classname [description]

I like that and the ability to link.

--
BigDog



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



[PHP] Re: include help please

2003-07-31 Thread Matt Matijevich
I think you want






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



[PHP] Yet another socket question...

2003-07-31 Thread René Fournier
Is it normal for a socket server to output all the echo'd messages only 
after the socket terminates? According to the source code, I would 
think that during its execution any echo "text"; commands would output 
to Terminal, but in practice (at least under Mac OSX), it's only after 
the Socket terminates that those messages appear. Is this normal?

...Rene

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


Re: [PHP] PHP Hosting (somewhat OT)

2003-07-31 Thread Chris Shiflett
--- Matt Giddings <[EMAIL PROTECTED]> wrote:
> I'm currently looking at http://www.phpwebhosting.com/ to move
> a  medium size site to.  Has anyone had any experience with
> them, could you  pass any comments about their service on to me?

I have some accounts with them, and they seem fine to me. All of my use is
restricted to personal use, however. Remember, you're only paying $10/month, so
you're going to be on a shared server, limited support, etc.

Some of my sites generate approximately a million PHP hits (HTTP requests for
*.php) a month, so they can handle moderate traffic as well.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] PHP Hosting (somewhat OT)

2003-07-31 Thread Matt Giddings
Hello,

 I'm currently looking at http://www.phpwebhosting.com/ to move a 
medium size site to.  Has anyone had any experience with them, could you 
pass any comments about their service on to me?

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


Re: [PHP] Querying a form

2003-07-31 Thread Curt Zirzow
* Thus wrote Gerard Samuel ([EMAIL PROTECTED]):
> David Nicholson wrote:
> 
> >You can either use the cUrl functions:
> >
> >http://uk2.php.net/curl
> >
> >or if this is not an option to you, you can use the socket
> >functions:
> >http://uk2.php.net/manual/en/ref.network.php
> >but you will have to deal with sending the HTTP request yourself
> >(which is not very complicated assuming you are not using HTTPS).
> >
> Hehe.  Unfortunately, its going to be HTTPS.  So Ill see what I can come 
> up with.

HTTPS is transparent by the time it gets to php, you can simply use
fopen('https://', ...)  and talk standard HTTP protocol. The data
is encrypted elsewhere.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: include help please

2003-07-31 Thread LoonySalmon
thanks everybody
now it works

"Loonysalmon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> i am looking to use includes on my page,
> this is the code that i want to use to call my files with:
>
> INDEX.PHP
>
>  require 'files.inc.php';
> $page = '$home';
> include '$page';
> ?>
>
> FILES.INC.PHP
>
>  $home = 'home.html';
> $forum = 'forum/index.php';
> $contact = 'contact.html';
> ?>
>
> I try to load up index.php and this is what i get
>
> Warning: main($page) [function.main]: failed to create stream: No such
file
> or directory in C:\swamp\www\site\index.php on line 109
>
> Warning: main() [function.main]: Failed opening '$page' for inclusion
> (include_path='.;c:\swamp\php\includes;C:\swamp\www') in
> C:\swamp\www\site\index.php on line 109
>
>
>
>
> the problem must be when i am trying to include the $page variable
>
> could somebody please help me?
>
>



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



Re: [PHP] load the PHP script last on the page

2003-07-31 Thread Bogdan Stancescu
...or use flush() just before that piece of code, if that's the case (if 
you don't need its output to complete the page). The page will be sent, 
the browser will remain in the "page in progress" state until the whole 
script is done, but that shouldn't bother your users, since they have 
the whole page to look at by that time.

Bogdan

John W. Holmes wrote:

DougD wrote:

I have a page with a particular PHP section that takes quite a time to 
load.
Is there a way I can delay that script to run after everything else has
loaded. I suppose it may need to use Javascript


You could use register_shutdown_function() to execute the code, 
providing you don't need any output sent to the browser. Do some testing 
as to whether PHP still waits for that function to finish or not, but I 
don't think it does.



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


Re: [PHP] include help please

2003-07-31 Thread Matt Matijevich

INDEX.PHP


the problem must be when i am trying to include the $page variable


get rid of the ' around the variable.

$page = "something.php";
include $page;

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



Re: [PHP] include help please

2003-07-31 Thread Chris Shiflett
--- LoonySalmon <[EMAIL PROTECTED]> wrote:
> $page = '$home';
...
> Warning: main($page) [function.main]: failed to create stream:
> No such file or directory in C:\swamp\www\site\index.php on line
> 109

You're trying to include a file named $home, and it doesn't exist. I think you
mean this instead:

$page = $home;

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



RE: [PHP] include help please

2003-07-31 Thread Dan Joseph
Hi,

Take the quotes off around the $page variable.

-Dan Joseph

> -Original Message-
> From: LoonySalmon [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 31, 2003 4:07 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] include help please
> 
> 
> i am looking to use includes on my page,
> this is the code that i want to use to call my files with:
> 
> INDEX.PHP
> 
>  require 'files.inc.php';
> $page = '$home';
> include '$page';
> ?>
> 
> FILES.INC.PHP
> 
>  $home = 'home.html';
> $forum = 'forum/index.php';
> $contact = 'contact.html';
> ?>
> 
> I try to load up index.php and this is what i get
> 
> Warning: main($page) [function.main]: failed to create stream: No 
> such file
> or directory in C:\swamp\www\site\index.php on line 109
> 
> Warning: main() [function.main]: Failed opening '$page' for inclusion
> (include_path='.;c:\swamp\php\includes;C:\swamp\www') in
> C:\swamp\www\site\index.php on line 109
> 
> 
> 
> 
> the problem must be when i am trying to include the $page variable
> 
> could somebody please help me?
> 
> 
> 
> -- 
> 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] include help please

2003-07-31 Thread LoonySalmon
i am looking to use includes on my page,
this is the code that i want to use to call my files with:

INDEX.PHP



FILES.INC.PHP



I try to load up index.php and this is what i get

Warning: main($page) [function.main]: failed to create stream: No such file
or directory in C:\swamp\www\site\index.php on line 109

Warning: main() [function.main]: Failed opening '$page' for inclusion
(include_path='.;c:\swamp\php\includes;C:\swamp\www') in
C:\swamp\www\site\index.php on line 109




the problem must be when i am trying to include the $page variable

could somebody please help me?



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



Re: [PHP] Escaping nasty quotes

2003-07-31 Thread Matthew Vos
On Thu, 2003-07-31 at 14:31, Roy W wrote:
> I have this:
>  
> $query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable FIELDS
> TERMINATED BY ',' ENCLOSED BY '" . '"' . "' ";
> $result = MYSQL_QUERY($query);
> PRINT "$query2";
> 
> The query doesn't take ... but if I cut and paste the printed response into
> the mysql server manually ... works like a charm
>  
> :-(

Try this:

$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ";

It'll get rid of your parse error

Matt


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: Opinions on Micro$oft .NET

2003-07-31 Thread Chris Shiflett
--- DvDmanDT <[EMAIL PROTECTED]> wrote:
> .NET is more built to be together while PHP, MySQL and Apache
> is more like picked the three best avaible... It's like a comp
> where .NET is a complete comp from some company and the
> OpenSource is more like you order all the parts separately to
> get the best of everything...

That's not a bad analogy. It's very similar to the audio industry. You have
stereo receivers that do just about everything, and this is what the majority
of people buy. But, you always have the audiophiles who buy separate components
to get the absolute best sound they can get.

Is it worth the effort? Only if you can hear the difference...

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] Compiling with LDAP support

2003-07-31 Thread Patrick Hutchinson
I was trying to follow the directions to compile PHP with LDAP support. 
It looks like the Netscape Directory Server 4.0 SDK is no longer 
available, and points to the Sun One Directory Server 5.1. I don't need 
to install an entire Directory server, I just need to point --with-ldap= 
 somewhere.

Anyone have any idea what I need to d/l from Sun to do this? I can't use 
OpenLDAP for my environment.

Thanks.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Patrick Hutchinson  [EMAIL PROTECTED]
Engineering Web Systems Administrator   408.527.0305 direct
Cisco Systems, Inc. 408.527.2313 fax
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Opinions on Micro$oft .NET

2003-07-31 Thread DvDmanDT
I'd say try to get some C programmer continuing on php_dotnet.dll and make
it support class constructors or maybe it was arguments that is the current
limit... I know PHP and mono is about to start work together, but sometimes
you need the MS stuff...

ASP.NET is most likely faster as it's compiled into machine code, and stored
in memory... Accutually, I tested and it's true (hate to admit it though)...
ASP.NET also has a better way to combine languages even if I hate that part
to... How much does it matter when you are good with one language? Well,
when you are about to work in teams I guess...

About hardware and linux performing better on same hardware:
Windows uses more cpu and ram as their windowses gets more and more
advanced... However, it's built to handle lots! The worst version of windows
.NET will be able to handle 512GB ram and 64 processors (assuming they are
64 bit)... So I'll agree to Parker and/or Blanchard on this point...

Next, have you got their story on why to upgrade/downgrade? The only reason
I can see is that .NET is more built to be together while PHP, MySQL and
Apache is more like picked the three best avaible... It's like a comp where
.NET is a complete comp from some company and the OpenSource is more like
you order all the parts separately to get the best of everything...

Now, find some pretty good C/C++ guys and try to get them working on PHP as
a .NET language... I can also mention that a project is coming up that will
make your PHP scripts run even faster than ASP.NET technology... Although,
wouldn't really be a PHP script anymore...

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]

"Jay Paulson" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
I know this is a little off topic but I really need some help with this.

The company I work for just got bought out by a larger company.  The larger
company uses .NET from Micro$oft. I of course use all open source stuff for
our web sites and now the new company wants to come in and pretty much blow
away everything I have done and use their .NET setup.

I've basically got a month to do research and get my guns loaded for what
I'm sure will be a heated debate about the Open Source Solution vs the
Micro$oft .NET solution.  So what I am looking for is personal and
professional opinions about both solutions (specifically PHP etc), any and
all links to good articles about both solutions giving the pros and cons of
both technologies.  Any other mailing lists I can get on to get more
opinions about the two technologies.  Are their any links to show the cost
benifits of using Open Source vs Micro$oft .NET? (I know Open Source is free
but I have no clue where to find how much .NET is).

As you can see any and everything would be a great help!!!

Thanks a ton!



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



[PHP] Re: Opinions on Micro$oft .NET

2003-07-31 Thread Bret Conard
My 2 Cents 

I started in PHP/MySQL learned a bunch, became proficient. And personally 
believed that it was the best thing since sliced bread. Did everything 
faster cleaner and with less system resources. (Also there was that 
independent testing that showed PHP/MySQL outperformed MS by alot, search 
the list archive for references) 

Then I got a job at a company that was MS based. Network, Intranet and 
Internet all Windows based. 

I have since had to migrate my skills to .NET and MS SQL. Advantages: All 
sorts of document and data sharing Word, Excel, eMail, and various data 
sources (SQL, Access, Legacy db and flat text files) all blend with little 
or no conflict. (Huge issue with People needing to share MS based documents) 

Disadvantages: OS system costs and the hardware issue. Windows based systems 
require more RAM/HD to be efficient. 

Companies with deeper pockets tend to pick ease of integration over the cost 
savings of Open Source. 

Bottom Line: Learn to program .NET (including C# and VB.Net) or start 
looking for another job. 

BTW I still do alot of PHP/MySQL for myself and others, and for others and 
believe that for strictly Web Based stuff it is the best option. 

Jay Paulson writes: 

I know this is a little off topic but I really need some help with this.   

The company I work for just got bought out by a larger company.  The larger company uses .NET from Micro$oft. I of course use all open source stuff for our web sites and now the new company wants to come in and pretty much blow away everything I have done and use their .NET setup. 

I've basically got a month to do research and get my guns loaded for what I'm sure will be a heated debate about the Open Source Solution vs the Micro$oft .NET solution.  So what I am looking for is personal and professional opinions about both solutions (specifically PHP etc), any and all links to good articles about both solutions giving the pros and cons of both technologies.  Any other mailing lists I can get on to get more opinions about the two technologies.  Are their any links to show the cost benifits of using Open Source vs Micro$oft .NET? (I know Open Source is free but I have no clue where to find how much .NET is). 

As you can see any and everything would be a great help!!! 

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


RE: [PHP] Escaping nasty quotes

2003-07-31 Thread Jennifer Goodie
> I have this:
>
> $query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE
> mytable FIELDS
> TERMINATED BY ',' ENCLOSED BY '" . '"' . "' ";
> $result = MYSQL_QUERY($query);
> PRINT "$query2";
>
> The query doesn't take ... but if I cut and paste the printed
> response into
> the mysql server manually ... works like a charm

What error do you get from mysql_error()?  Are you uusing the same user in
both shell and script?  If not does the script user have the proper
permissions?


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



RE: [PHP] Form Retain Info on Back?

2003-07-31 Thread Jay Blanchard
[snip]
Is there a simple way of retaining this information so the user doesn't
has to retype all the information in?
[/snip]

The answer is in the archives young Grasshopper. Are you saving the data
to a database?

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



[PHP] Form Retain Info on Back?

2003-07-31 Thread Doug Coning
Hi All,

I have a php form that I run a test to see if they have entered in all
required fields before inserting into a MySQL db.  The PHP script simply
reports what is missing and exits the rest of the page.  However, when
you click the back button, all the information that was entered, is
gone.  Is there a simple way of retaining this information so the user
doesn't has to retype all the information in?

Doug 


RE: [PHP] Escaping nasty quotes

2003-07-31 Thread Jay Blanchard
[snip]
Unfortunately, they are indeed enclosed by double quotes
[/snip]

Can you show us a snippet of data.txt?


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



RE: [PHP] Escaping nasty quotes

2003-07-31 Thread Roy W
Unfortunately, they are indeed enclosed by double quotes

Roy

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 31, 2003 12:58 PM
To: Roy W; [EMAIL PROTECTED]
Subject: RE: [PHP] Escaping nasty quotes


[snip]
Sorry...Because of the double quote near the ENCLOSED BY .. It delivers a
PARSE ERROR

$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable FIELDS
TERMINATED BY ',' ENCLOSED BY '"' "; [/snip]

Are the fields enclosed by a quote? If not...

$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable FIELDS
TERMINATED BY ',' ENCLOSED BY '' ";



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



RE: [PHP] Escaping nasty quotes

2003-07-31 Thread Jay Blanchard
[snip]
Sorry...Because of the double quote near the ENCLOSED BY .. It delivers
a
PARSE ERROR

$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS
TERMINATED BY ',' ENCLOSED BY '"' ";
[/snip]

Are the fields enclosed by a quote? If not...

$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS TERMINATED BY ',' ENCLOSED BY '' ";

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



  1   2   3   >