Re: [PHP] Web Services

2003-07-04 Thread Sid
You will need to write a script in PHP to output XML data from the data you
currently have in your db/files.

Hope this helps

- Sid
- Original Message -
From: "Yamin Prabudy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 04, 2003 1:48 AM
Subject: [PHP] Web Services


> Hi there,
> hope someone ini this list can help me out..
>
> I had made a web services using Keith Devens library
> It's already run and OK...
>
> Now I try to make a client using ASP .NET to connect to my web services
>
> Did anyone know how to pull out the classes/function in my web services
with
> kd_xmlrpc ??
> like the google if we try to used the web services server we can see all
the
> available function/class
>
>
> Thanks in Advance
>
> yamin
> - Original Message -
> From: "Boaz Yahav" <[EMAIL PROTECTED]>
> To: "David R" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, July 04, 2003 4:39 PM
> Subject: RE: [PHP] cookie question
>
>
> Go to your browsers setting and ask the browser to prompt before setting
> cookies.
> in IE go to : tools -> Internet Options -> Privacy --> Advanced -->
> Override automatic cookie handling.
>
> See if your page tries to set the cookie at all.
> If not, try to add : error_reporting(2039);
> maybe you are sending the headers before you set the cookie.
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
>
>
> -Original Message-
> From: David R [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 04, 2003 11:25 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] cookie question
>
>
> I tried it that way, and variations on it. I still have had no luck. Any
> other ideas? Thanks again David R Thanks for you he "Boaz Yahav"
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Try
>
> setcookie("auth","$val",time() + 3600,"/",".avenew.com");
>
>
> also look here : http://examples.weberdev.com/get_example.php3?count=67
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
>
>
> -Original Message-
> From: David R [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 04, 2003 9:44 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] cookie question
>
>
> I have never read anything about a production server domain. How do I
> set the cookie for it? Thanks. David R
>
>
> "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > David R wrote:
> >
> > >Hello,
> > >I have a cookie question.
> > >
> > >I have the following code is a file called tc.php
> > >
> > > > >global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ;
> > >$val="123";
> > >setcookie ("auth", $val , time() + 3600);
> > >$cookie = $HTTP_COOKIE_VARS['auth'];
> > >echo "cookie is: $cookie";
> > >?>
> > >
> > >I have no problem retrieving the value cookie value ( 123 ) on my
> > >local machine but when I post to the internet I can't get the cookie
> > >value.
> > >
> > >Any ideas why?
> > >
> > Did you set the cookie for the production server domain?  Cookies for
> > your local machine won't still be there once you upload, you know.
> >
> > --
> > The above message is encrypted with double rot13 encoding.  Any
> unauthorized attempt to decrypt it will be prosecuted to the full extent
> of the law.
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] Uploading files time out every so often

2003-07-04 Thread Sid
Well I have built a script that is responsible for upload 20Mb of files at a
time. The possible probs are
1) A short disconnetion in the net connection can cause the upload to stall
2) Sometimes when I visit / post data on the same domain, the upload stalls
where as if I just leave that upload be and continue surfing on other sites,
it generally runs ok to the end.
3) Free space - wierd things happen when PHP is unable to write files on the
server (like your disk quota gets used up)
4) Check ifyour server has enough bandwidth to manage so many uploads at
once. Make sure the server does not get disconnected (This is unlikely, but
never the less check)

Hope it helps. All the best.

- Sid

- Original Message -
From: "Ivo Pletikosic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 03, 2003 11:29 AM
Subject: [PHP] Uploading files time out every so often


> Hello,
>
> I am currently involved in a site where users frequently need to upload
text
> files of various sizes. Every so often users will experience problems
where
> the uploads will start timing-out and need to be reinitiated.
>
> The timeout problem comes and goes, so far I've been unable to find the
root
> cause. It happens with files of all sizes, from 10k to several MB,
> eventually they all get uploaded, tho sometimes it can take days
re-trying.
>
> Another issue is experienced when the above symptom is happening which
makes
> me think they're related. An additional tool on the site writes out files
> with information provided by a user thru a form. A user submits a form
with
> some text and php writes out a file with the received info and notifies
the
> user the task was done. Every so often the browser will timeout with no
file
> written out by php or notification. This symptom can go on for days. The
> info being written to a file is never longer than a dozen lines of text so
> it's quite small.
>
> Initially we thought that the server just did not have the resources to
> service simultaneous uploads but monitoring tools show the cpu appears to
be
> near idle when this is experienced. I've experienced the file writing
> problem when I was the only user on the server with all unnecessary
services
> disabled. The browser will just time out, then one days voila! it works
> until the next problem day.
>
> This is on a Linux box with Apache 1.3, php 4.2.2 & experienced across
> multiple browsers. All the scripts have set_time_limit(0). File system has
> the proper permissions and with plenty of free space.
>
> We've been collecting quite a lot of info from the server to try to
capture
> it's state at the time of the problem but nothing raises any flags.
>
> Has anyone experienced this issue or a similar issue? Any pointers and
help
> is greatly appreciated.
>
> Ivo
>
> --
> 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] Regex help needed

2003-07-16 Thread Sid
Hello,

Well I am doing by first reg ex operations and I am having problems which I just 
cannot figure out.

For example I tried
echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity');
and this worked perfectly,

but when I chnaged that to
echo eregi_replace ("(\s*)\s*\s*purchasing\s+power\s+parity", '%POWER%', 'sdsdssPurchasing power parity');
It does not detect the string. Srange. According to what I know, \s+ will detect a 
single space also. I tried chnaging the last 2 \s+ to \s* but this did not work also.
Any ideas on this one?

As I proceed I would like the expression to detect the optional face attribute also, 
so I tried
echo eregi_replace ("(\s*)\s*\s*purchasing power 
parity", '%POWER%', 'sdsdssPurchasing power parity');
... and this gave me an error like
Warning: eregi_replace(): REG_EMPTY:çempty (sub)expression in D:\sid\dg\test.php on 
line 2

Any ideas? BTW any place where I can get started on regex? I got a perl book that 
explains regex, but I have got to learn perl first (I dont know any perl)

Thanks in advance.

- Sid

[PHP] Server variables on IIS

2003-08-22 Thread Sid
Hello,

I am trying to migrate a PHP script and just realized that the IIS server I am working 
on does not have the REQUEST_URI, SCRIPT_FILE_NAME and DOCUMENT_ROOT server variables. 
This makes the script malfunction.

Does anyone know how I can get these variables?

If you would like to see info on this server go to http://216.95.232.174/info.php

Thank you,

- Sid


[PHP] Use PHP or MySQL

2003-08-25 Thread Sid
Hello,

This question has been lingering in my mind for some time -
Say we have a function such as MD5, which is available on both PHP and MySQL? Which is 
faster - the PHP version or the MySQL one. Have any benchmarks been made on this? We 
can use the same question for say... arithmetic operations, string contentation...

Thanks in advance.

- Sid 


[PHP] Problem with GET variables

2003-06-23 Thread Sid
Hello,

I just updated PHP on my local computer from PHP 4.0.2 to 4.3.2 (Yes, I know, its a 
very very long time). I also downloded the latest version of Apache and installed PHP 
as a module. Now PHP runs fine on the server. I have a small problem though. Variables 
being sent via the GET method are not getting parsed. I can acess these variables via 
the $_GET["variable"] method but not through $variable. Any idea why. Most of my old 
PHP scripts accessed the variables directly by their name and so this will be a very 
very big problem for me. Any idea how I can get this old feature back.

Thank you.

- Sid


[PHP] Using PHP to cache a flash movie

2003-08-30 Thread Sid
Hello,

Does anyone know a method in which I can load a large flash movie in the background 
and only when it is done, play it. In the mean time, the user should be able to carry 
on surfing normally.

Any ideas?

Thank you,

- Sid


Re: [PHP] Re: Using PHP to cache a flash movie

2003-08-30 Thread Sid
Yes, But I was thinking of something like an invisible frame on top which
loads the movie

- Original Message -
From: "Catalin Trifu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 30 August 2003 Saturday 7:29 AM
Subject: [PHP] Re: Using PHP to cache a flash movie


> > Hello,
> >
> > Does anyone know a method in which I can load a large flash movie in the
background and only when it is done, play it. In the mean time, the user
should be able to carry on surfing normally.
> >
> > Any ideas?
> >
> > Thank you,
> >
> > - Sid
> >
>
> Hi,
>
> Simply put you can not! if the user moves from one page to another,
> the old request goes bye! bye!
>
> Cheers,
> Catalin
>
> --
> 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] PHP installation on IIS

2003-09-03 Thread Sid
Hello everyone,

This is the first time I am installing PHP on IIS and I don't know what I am doing 
wrong. I copied the default php.ini file to the winnt dir.
Then I added an ISAPI extention with .php to the App Mapings tab. (ISAPI caching 
enabled)
Then I made a test.php file with 

but ll I see is the source code when I access this page.

Does anyone have any ideas?

Thank you,

- Sid


[PHP] Benchmarking PHP vs ASP.net

2003-09-08 Thread Sid
Hello,

Many people ask me if ASP.net is faster than PHP. I know for a fact that it is 
(because PHP is not optimized).
But then what about optimized PHP and compiled ASP.net. This would be a fairer 
comparison in my opinion. Anyone seen any benchmarks of this? If so please let me know 
as I would not like to pass on any wrong info.

Thanks

- Sid

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



RE: [PHP] Benchmarking PHP vs ASP.net

2003-09-08 Thread Sid
> Apparently if you read the terms of agreement when installing .NET
> you can't publish your benchmarking results without their
> permission.

Is Micro$oft©® scared of being beaten? Now I am going to get the benchmarking results 
by hook or crook! Now I HATE M$. aahh!!

I've seen a comparison of JSP PHP and CF (Don't remember where - All I know is that it 
came up among the top results in google for I think 'ASP.net vs PHP')

- Sid

On Mon, 08 Sep 2003 14:25:20 +0200, Angelo Zanetti wrote:
> Apparently if you read the terms of agreement when installing .NET
> you can't publish your benchmarking results without their
> permission.
>
> just a thought.
>
>
> would be interesting to see comparison, and maybe also JSP, cold
> fusion
>
>
> -Original Message-
> From: Sid [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 08, 2003 2:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Benchmarking PHP vs ASP.net
>
>
> Hello,
>
>
> Many people ask me if ASP.net is faster than PHP. I know for a fact
> that it is (because PHP is not optimized).
> But then what about optimized PHP and compiled ASP.net. This would
> be a fairer comparison in my opinion. Anyone seen any benchmarks of
> this? If so please let me know as I would not like to pass on any
> wrong info.
>
> Thanks
>
>
> - Sid
>
>
> --
> 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] Whats wrong?

2003-09-13 Thread Sid
Try this



- Sid

On Sat, 13 Sep 2003 08:45:16 -0400, Stevie D Peele wrote:
> Whats wrong with this
>
>
> 
>
>
> where
>
>
> $senderemail = $_POST['from'];
>
>
> It doesnt It only echos thank you.
>
>
> Why?

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



[PHP] Strange error

2003-09-16 Thread Sid
Hello everyone,

Am I having a bad day or WHAT! I have exactly 5 lines of code as follows

and I get this error
Parse error: parse error, unexpected T_STRING, expecting '&' or T_VARIABLE or T_CONST 
in D:\sid\sid-test\index.php on line 3

what is the problem here.

Can someone help

- Sid


Re: [PHP] Strange error

2003-09-16 Thread Sid
You are probably right. I typed in the same code into a new file and it
started to work. Just for the record, I copied and pasted this code from
Opera in Windows. Anyone had similar problems?

- Sid

- Original Message -
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Sid'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 16 September 2003 Tuesday 12:10 AM
Subject: RE: [PHP] Strange error


> Hi
>
> Odd - I copy/paste the code below and run it against windows version of
> php4.0.6 and it's okay
>
> Maybe you've got a hidden char there somewhere?
>
> Martin
>
> -Original Message-
> From: Sid [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 17 September 2003 5:39 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Strange error
>
>
> Hello everyone,
>
> Am I having a bad day or WHAT! I have exactly 5 lines of code as follows
>  function here ($errno, $err_str, $file_name, $line_no, $context_no)
>  {
>  }
> ?>
> and I get this error
> Parse error: parse error, unexpected T_STRING, expecting '&' or T_VARIABLE
> or T_CONST in D:\sid\sid-test\index.php on line 3
>
> what is the problem here.
>
> Can someone help
>
> - Sid
> __ Information from NOD32 1.509 (20030914) __
>
> This message was checked by NOD32 for Exchange e-mail monitor.
> http://www.nod32.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] ignore_user_abort not working

2003-09-17 Thread Sid
Hello,

I am calling ignore_user_abort(true) in one of my scripts, but the script stops just 
like it would if I did not call it.

Any idea why it is not working?

Thanks

- Sid



Re: [PHP] ignore_user_abort not working

2003-09-17 Thread Sid
Sorry, a mistake on my part. The script continues to work, but
connection_aborted() does not detect if the host disconnected. It is all
acting very funny. I also kept witing the return from connection_status ()
to a file and it keeps witing 0 to the file even after the user disconnects.

- Sid

- Original Message -
From: "Sid" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 17 September 2003 Wednesday 1:04 PM
Subject: [PHP] ignore_user_abort not working


> Hello,
>
> I am calling ignore_user_abort(true) in one of my scripts, but the script
stops just like it would if I did not call it.
>
> Any idea why it is not working?
>
> Thanks
>
> - Sid
>
>

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



Re: [PHP] PHP and .HTACCESS

2003-10-03 Thread Sid
If I've got my basics right, the auth user and pass will be sent by the
browser. You will need a way to tell the browser not to send the user and
pass anymore.

- Sid

- Original Message -
From: "James D. Stallings" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 3 October 2003 Friday 9:04 AM
Subject: [PHP] PHP and .HTACCESS


>
> I am new to learning PHP and have learned a lot over the last few weeks.
One
> thing that I can not find anywhere is how to code it so a user can click
logoff
> and have it route them to another page and remove their authentication
that was
> set.
>
> ie... I user goes to www.mysite.com and clicks on a link called STAFF
> The STAFF.mysite.com is protected with authentication using .htaccess
> The staff enters their ID and Password and is allowed in.
> I want to have a button that says LOGOFFF that will remove the
authentication
> I know how to do the header(location... to route them back to another
page, but
> I have not been able to remove the authentication so it will ask them for
their
> password again when they return to staff.mysite.com
>
> I have even tried:
>
> header('WWW-Authenticate: Negotiate');
> header('WWW-Authenticate: NTLM', FALSE);
>
> but no go...
>
> Thanks in advance!!
>
> Jim
>
> --
> 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] Protecting include files

2001-08-18 Thread Sid

Hi,

I have a php script which includes .inc files. Is there any way in which I 
can prevent a normal surferfrom viewing these files. Is there any command 
that I can add to a .htaccess file.

Thanks

  ~~~  \\__
! SIDDHARTH HEGDE /   CHAOSGAMERZ.COM !
!  Webmaster  \  For PC Game screeshots, cheat!
!   http://www.ChaosGamerz.COM o| o  codes, trainers, downloads,  !
![EMAIL PROTECTED]( |_   game music, FREE e-mail and even !
! ICQ 84475206 |--   FREE FULL VERSION games for that !
~~ \___/ 486--


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




[PHP] Re: code to see files in directories

2001-08-18 Thread Sid

Try this -- shorter. I only tested it out in Win(32)though

At 03:00 PM 8/8/01 +0200, you wrote:
>[EMAIL PROTECTED] (Eduardo Kokubo) wrote:
>
>  > I think I saw a code to list the files, subdirectories and the files
>  > in the subdirectories of a simple directory in this list some time
>  > ago, but I didn't save it. Considering the quantitie of messages in
>  > this list, It's quite dificult to find this specific code, so ask the
>  > person who did it or someone else to write this code again.
> >
>  > I'm using this one:
> >
>  > $publico = ftp_nlist ($servidor, "public_html/publico");
>  > $cont = 0;
>  > while ($publico[$cont]){
>  >  print "$publico[$cont]";
>  >  $cont++;}
> >
>  > This code doesn't show the files in the subdirectories and it requires
>  > ftp connection. Not very efficient.
> >
>  > Thanks in advance.
> >
>  > Is there a problem if I just write "thanks in advance"??? It's easier
>  > then writting back to thanks everybody :)
> >
>
>is this what your looking for?
>
>function getDirContents($slashdir) {
> $dh = opendir($slashdir);
>
> while (($file = readdir ($dh))) {
> if (is_dir($slashdir . $file) && $file != "." && $file != "..") {
> getDirContents ($slashdir . $file . "/");
> } else if ($file != "." && $file != "..") {
> echo $file . "";
> }
> }
> closedir($dh);
>}
>
>getDirContents("/test/");
>
>--
>Henrik Hansen
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] HTML mail

2001-09-06 Thread Sid

hi,
How would you send HTML mail using the mail() function in PHP.
SID 


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




Re: [PHP] Wierd for thingy, help!

2001-09-06 Thread Sid

Of cource you can. In the second page just ask PHP to echo the variable in 
the space where the text box accepts preset values some thing like this

" size="30">

where $variable is a variable that is sent from the previous page.

Hope this helps


At 11:38 AM 9/4/01 -0700, you wrote:
>Ok sorry for not looking into this one but is it possible for 1 page to 
>have a variable (not input) and then post it to another page and in an 
>input variable (text box) it will have the variable from the first page as 
>its value. not im confused!
>
>
>-lk6-
>http://www.StupeedStudios.f2s.com
>Home of the burning lego man!
>
>ICQ: 115852509
>MSN: [EMAIL PROTECTED]
>AIM: legokiller666


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




Re: [PHP] what will be the output for this pgm?

2001-09-06 Thread Sid

Of course there will not be any output. That's because when you type in the 
directly type the url in the browser there will not be any referer. Try 
putting a link from another domain to that page and you will get some 
output then / try visiting the page through a search engine. i.e make the 
page come up in you search results and then click on it and when you visit 
the page it will show you the domain of the search engine.

Hope this helps

At 02:05 AM 9/5/01 +0530, you wrote:
>Hi friend,
>what will be the output for the following program?
>
> >>
>
>  $foo=$HTTP_SERVER_VARS["HTTP_REFERER"];
>
>  echo $foo;
>
>?>
>
> >>>
>
>For me it is printing the blank value.
>
>Thanks in advance
>
>Regards
>-Balaji
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] Assigning output of include() to a variable

2001-09-09 Thread Sid

Hi,

I've been trying to figure this thing out for 3 hours now. Lets say we have 
a variable $x. Now I need to assign $x with similar output that comes from 
an include function.

For anyone who did not understand me --> Instead of the stupid include() 
function outputing the file contents to the browser I need it to assign it 
to variable x.

I am pretty sure inlude() cannot do it but is there any other function 
similar to include() that will process the file and then assign the output 
to a variable.

Thanks in advance

SID


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




Re: [PHP] Assigning output of include() to a variable

2001-09-16 Thread Sid

Hey I did it. A special thanks goes out to Michael Kimsal for giving me the 
idea of output buffering. Here is the code I used. Hope this helps

ob_start(); // Start output bufering
include ("$filename"); //$filename is the file you want to include
$x = ob_get_contents(); //Set the contents of the output buffer to variable x
ob_end_clean(); //Stop output buffering and flush its contents without 
giving output. If you want it to give out put change this line to 
ob_end_flush();

Once again thanks to everyone who helped
:-)

SID

At 11:09 PM 9/9/01 -0400, you wrote:
>file() probably won't do it, unless you call an http:// file request to
>your webserver - PHP won't execute other PHP code in another file when
>pulled in thru file().
>
>What you are looking for is most likely output buffering.
>
>Read up on ob_start at php.net/ob_start.  Basically turn output buffering
>on, include() the file, grab the contents from the output buffer, put them
>into $x, and clear the buffer.  There should be an example or 2 at the
>website.  zend.com also had an article on output buffering.
>
>
>
>
>Michael Kimsal
>http://www.tapinternet.com
>734-480-9961
>
>
>On Mon, 10 Sep 2001, Jason Brooke wrote:
>
> > > Hi,
> > >
> > > I've been trying to figure this thing out for 3 hours now. Lets say we
> > have
> > > a variable $x. Now I need to assign $x with similar output that comes 
> from
> > > an include function.
> > >
> > > For anyone who did not understand me --> Instead of the stupid include()
> > > function outputing the file contents to the browser I need it to 
> assign it
> > > to variable x.
> > >
> > > I am pretty sure inlude() cannot do it but is there any other function
> > > similar to include() that will process the file and then assign the 
> output
> > > to a variable.
> > >
> > > Thanks in advance
> > >
> > > SID
> >
> > there's a stupid function called file() that does that
> > it's in the stupid manual - which also explains the behaviour of 
> include for
> > you as well
> >
> > jason
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


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