Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Server HTTP Sends Or Streaming HTTP?


I was wondering if you guys had any ideas to constantly
stream a webpage in case an announcement was posted
or possibly pushing onto the browser information.

What I basically want is for a user browsing my website
to be notified of any new announcements. I thought
about checking everytime he changes pages but then
I realized that I want them to be notified as long as
they have the page open even if it's minimized. So it
would at best be a method to use php force send a msg
after someone posts an announcement.




View Complete Forum Thread with Replies

Related Forum Messages:
Real Audio Http Streaming Without .ram File
I wanted a way to (http) stream Real Audio files without the need to use
..ram files. In case there are others interested in this, the following is
the solution that worked for me:

<?php
Header("Content-Type: audio/x-pn-realaudio");
echo "http://www.domain.com/audiofolder/track1.rm";
?>

View Replies !
Warning: Fopen(http://localhost/.. ?HTTP Wrapper Does Not Support Writeable Conn
I am able to create a pdf using php and ezpdf, its works fine, and display the pdf document in the current server page.

But here are two things i wish to do, first store the pdf and than open, if possible in a new popup window?

When i tried this function below, it gives me an error

Error:
Warning: fopen(http://localhost/pdf/files/tmp1/yasmina.pdf) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections. in C:Program FilesxampphtdocspdfpdfClassesAndFonts_009ecertificate.php on line 139
Could not open file to save PDF. Code:

View Replies !
Questions About HTTP Headers Sent With PHP In HTTP Authentication
Here is an example from the PHP Manual

<?php

if ((!isset($_SERVER['PHP_AUTH_USER'])) || (1==1)) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button'
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</
p>";
}
?>

Questions.

1. This is a status code not a header, right? = header('HTTP/
1.0 401 Unauthorized');

2. According to the change log in the PHP manual, starting with 4.4.2
and 5.1.2 the header function now prevents more than one header to be
sent at once as a protection against header injection attacks. Does
this mean if I make multiple header calls the headers will be sent in
multiple response messages to the browser? Is this allowed? Can a
server send multiple response messages to one request?]

3. If you hit the "cancel" button on the browser user name/password
request dialog (as alluded to in the code snippet above), what message
does the browser send to the server.

View Replies !
Add A 301 Redirect To Move All Access From Http://a.com To Http://www.a.com
I'm currently using the following .htaccess code:

RewriteEngine on
RewriteBase /
ReWriteRule .htaccess [F]
RewriteRule ^([a-zA-Z0-9/-]+)$ index.php?url_path=$1

And I'd like to add a 301 redirect to move all access from http://example.com to http://www.example.com. How can I do it, keeping the current rewrite rule?

View Replies !
Loaded Latest Edition Of Apache Http Server On XP, And Installed Php On That Server...
How do I run a .php program? (I'm starting with the "hello world" script)

View Replies !
Trapping A File Error: Failed To Open Stream: HTTP Request Failed! HTTP/1.1 404 Not Foundin
php
Warning: file(http://shop1.outpost.com/product/5053975)
[function.file]: failed to open stream: HTTP request failed! HTTP/1.1
404 Not Foundin

I am just trying to put some code around this to trap it.

View Replies !
Implement SSL On HTTP Server
Got anyone know about it? i want to know how to do it.

View Replies !
Http 500 Internal Server
what might cause "http 500 internal server errror" to be happening. Chmod ding file. I assume so cause it happened right after I did so. but then I chmoded back. and it still says internal server error. what usually happens.

View Replies !
Http Authentication On A Linux Web Server
I've been running the following authentication in php on a linux web server. I'm trying to move it to a web server on a Windows machine running Omnihttpd. It isn't working. Any ideas?

<?php

if(!isset($PHP_AUTH_USER))
{
Header("WWW-Authenticate: Basic realm="Hardware Review"");
Header("HTTP/1.0 401 Unauthorized");
echo "You are not authorized to view this pagen";
exit;
}
else
{
if ($PHP_AUTH_USER!="hardware"| |$PHP_AUTH_PW!="Speed0")
{
Header("HTTP/1.0 401 Unauthorized");
echo "You are not authorized to view this pagen";
exit;
}
}
?>

View Replies !
Is There An HTTP Server That Parses PHP That Will Run On The Axim X3i?
Is there an HTTP server that parses PHP that will run on the Axim x3i? Code:

View Replies !
Aborting HTTP Connection From Server-side
I wonder if this is possible: I have a script that does things that
take time. In the first part of the script it does data checking and
other verifications, then comes the long part. I wish to be able to
send the result of the first part to the client, disconnect the HTTP
(so the client can do whatever they want), the script should then
continue with the rest of the time consuming tasks, at the end of
execution (or if an error occurs) an e-mail is sent.

The key here is that it's the script that aborts the connection. It
would be like putting the PHP process in the background to return the
hand to web server, which in turn would close the connection.

I already used the ignore_user_abort() to better control what's going
on in the script.

I've had a look at apache_child_terminate() but it still waits that
the PHP script ends.

I don't want to use an HTTP refresh and for security reason I'd rather
avoid using a system() or exec() call.

My script is actually called by another script on another server
(using CURL)

I've also tried to add "Content-length: ..." in the HTTP headers and
use flush() to force the client to read the output and close the
connection when the byte count is reached. But it doesn't seem to work
that well... I can't either set a too short client timeout because it
needs to wait for the first part to be over (and it may depend on
server load.)

Your ideas are welcomed... of course if that could be implemented
inside PHP itself that would be great. I don't think Apache or not
matters...

View Replies !
301 Redirect With PHP Http:// To Http://www.
I'm trying to redirect http://domainname.com to http://www.domainname.com using a 301, on all pages, that means it needs to go in the header file... Here's the code I have:


Quote# <?php
# if(!stristr($_SERVER["HTTP_HOST"], 'www')){
# header("HTTP/1.1 301 Moved Permanently");
# header("Location: http://www.domainname.com/" . $_SERVER["REQUEST_URI"]);
# exit();
# }
# ?>

The only thing is that it redirects every page to http://www.domainname.com/... including http://www.domainname.com/ How do I fix this? What's the solution? I'm assuming there's some more code that needs to go into it. The host doesn't allow me to do this in the htaccess file.

View Replies !
Redirect From Http To Https And Then Back To Https To Http
I need help with redirect from http to https when I user click on register.php and abter he completes the form I want to redirect back to http.

View Replies !
Can't Include 'http...foo.php', But Can Include 'http...foo.txt'
This seems weird, but when I use the following code,

include 'http://www.foo.com/includes.php'

includedfunction();

I am told that it is a call to an undefined function, but
'includedfunction' is on the server.

the following includes work fine, and the run the called function with
no trouble:

include 'http://www.foo.com/includes.phtml'
include 'http://www.foo.com/includes.txt'

all three include.php,.phtml & .txt are on the server and are exactly
identical. I am running php version 4.1.1.

View Replies !
Error "HTTP Error: No Data Present After HTTP Headers"
I am trying to run an example I found for NuSOAP but when I run the client I get the error "HTTP Error: no data present after HTTP headers" the server script PHP Code:

View Replies !
Error Reading WWW Server Response (HTTP Header). Error Code: 0
I have been trying out the web based email program on this website to connect to a pop 3 client...it worked ok...but now when i try to logg in all i get is this error message...on the page Error occurred!

Description: Error reading WWW server response (HTTP Header). Error code: 0(0 = client terminated the connection unexpectedly, 2 = too many header lines) Code:

View Replies !
HTTP Error And Parse Error - I Get HTTP, Friend Gets Parse :S
I have just finished making a script, which basically updates a users account depending on what button they pressed on the previous page, everything looks fine to me, but when I click a button, I get a big HTTP error page, but the strange thing is, when my friend press's a button, he gets a parse error. Code:

View Replies !
Browser Sends To A Server
i would like to know what string browser sends to server (i guess headers), and if there is any way to get that string exactly.

View Replies !
A Link In An Email That, On Click, Sends The Headerinfo To A Server
Is it posible to make a link (to a php-file on a server) in an email
that, when you click on it, sends info about who the reciver of the
email is?

Lets say I send out an email thru an alias to a group of people and I
want to give them the opportunity to sign up for an event using that
link. Those that click the link are added to a post in a database
(MySQL), eg. with their email adress, initials, name... whatever. I
guess that it would be easy if it just takes the contest of the
to-field in the emails headerinfo? If a spammer can do it, so can I :o)

And... if you have an answer please assume that I know practicly
nothing about php :o) I have made a few sites with php and MySQL, but
nothing fancy - just simple guestbooks etc.

View Replies !
Php + Http
How to send variables by POST method using php`s 'header' function?

View Replies !
HTTP 403
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk to
each other. Everything seems to work OK when dealing with databases but as
soon as I use a php-script that use $_server the browser will throw me away
and give me HTTP 403.

It has worked before but that was before I got the communication to work
with MySQL

View Replies !
HTTP/URL
In cURL or Filesystem is there a function that will send data to a url. Like if I wanted to request a url with a specific string in the body how could I do this? I can't find anything.

View Replies !
Http Or Https ??
What variable might i be able to extract the http:// or https:// from to detect which type it is?

On my server i have $_SERVER['SCRIPT_URI'] which contains htis but my friend does not have this variable on his server.

View Replies !
HTTP Authentication With PHP
I have followed 3 different tutorials and none of them seem to work. When I use the following code in the beginning of my PHP script:

if (!isset($PHP_AUTH_USER))
{
header('WWW-Authenticate: Basic realm="Datacenter"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.'
exit;
}

and I attempt to access the script I get the error: "Error 500: Internal Server Error" I reset the permissions to 755 and still no luck. I then, out of frustration created a .htaccess file and tried every possible combination, particularly in the UserAuthFile. I have tried,
UserAuthFile [path]/myscritp.php4
UserAuthFile /dev/null/

I have also tried deleting the line alltogether and what happens in all these cases is that the box comes up but when I enter the info it does not send the variable to the script. If you have any information I would really appreciate it. I could even send you the script to look at the full code if it would help.

View Replies !
Http Auth + Php
Is it possible to get PHP to pass a login/password to an htaccess protected dir?

This is to make a loginform for a page that resides in a protected dir. I want to avoid the normal login dialog the browser uses, so I amongst other things can give the user a few choices when logging in.

View Replies !
Http Or Www Replace
I wanted to know how to replace a URL when it is outputted. I tried to use the following:

$output = ereg_replace('http://([[:graph:]]+) ', '[<a href="http://1">link</a>] ', $output);

$output = ereg_replace('www.([[:graph:]]+) ', '[<a href="http://1">link</a>] ', $output);

but it doesnt work properly, so i want one that replaces the URL when

http://www.?.com

or

www.?.com

and replaces with

[<a href=http://www.111.com">link</a>]

Would i have to use two of these but just in a different way or use one or even use a whole different function.

View Replies !
HTTP Authentification
I need to download an XML file from a website, but everytime I go to the
URL, I need to authenticate(basic) via the http header.

What kind of text should I send to do it via php?

View Replies !
HTTP Variable -
Say I type in an address in my location bar. I press enter and go to the specified page, say http://www.foo.com/foo-foo.php. HTTP_REFERER returns the referring page - which is very close to what I need, but it only works where the user clicked a link to get to foo-foo.php.

If user manally enters the address, HTTP_REFERER is empty. Is there a way to get manually typed in urls? REQUEST_URI returns the actual page the user is on. For my application REQUEST_URI isn't what I need. I'm building an error page and I want a report of any pages users are trying to reach that are not found.

View Replies !
Http-get And Headers
I am looking to write code that can read a file from an http address
(for example: http://www.somesite.com/document.xml) and check it for any
changes (an updated state) then download it if it is a newer version. I
have seen references to the http-get functionality of PHP , but can't
find any examples or tutorials. Apparently I can check some http
headers to determine whether the document is new or not?

Can anyone direct me to some help on this issue?

View Replies !
Using A Http Proxy
I've been trying to get PHP to access all http data via a proxy server - this is the only way I can get anything from port 80 on my Uni connection. I've checked phpinfo() and the environmental variable http_proxy seems to be set, but fopen("http://...") isn't working... I really need to make this work.

View Replies !
Doing An Http Post
For the benefit of others, I want to show how to do
an HTTP POST request using fsockopen(). I banged my
head against a wall for two days trying to figure
this out. I even went to http://php.net/ to find
out how to do this, but it didn't help because
my mind automagically converted the "Content-Length"
header into "Length."

I even went to find out
the specific protocol for HTTP POSTs, but I didn't
find it there. RFC 2616 (HTTP) does not give the
exact format for POST requests.

Question: Where is the format for POST requests defined?

---------------- send_post.php ---------------
<?php
// file: send_post.php
error_reporting(E_ALL & ~E_NOTICE);
$eol = "
";
$errno = 0;
$errstr = ''
$data = 'username=george&password=i81bpz'
$fid = fsockopen('localhost', 8080, &$errno, &$errstr, 30);
if ($fid) {
fputs ($fid, "POST /post/show_post.php HTTP/1.1$eol");
fputs ($fid, "HOST: localhost$eol");
fputs ($fid, "Connection: close$eol");
fputs ($fid, "Content-Type: application/x-www-form-urlencoded$eol");

// Use 'Content-Length' NOT 'Length' !
fputs ($fid, 'Content-Length: ' . strlen($data) . $eol);
fputs ($fid, $eol);
fputs ($fid, $data);
fputs ($fid, $eol);
fpassthru($fid);
}

?>
------------- show_post.php -----------------
<?php
// file: show_post.php
error_reporting(E_ALL & ~E_NOTICE);

echo "<pre>";
echo "------------ POST VARIABLES ----------";
print_r($HTTP_POST_VARS);
echo "------------ SERVER VARIABLES ----------";
print_r($HTTP_SERVER_VARS);
echo "</pre>";
?>

View Replies !
HTTP Expire
I want to cashe database driven forum, but SESSION is used for passing
userID. When I use code below offline browsing is ok, but session variable
is difrent on cashed pages. Some pages stored gost id some admin. How can i
solve this.

<?php
ob_start();
session_cache_limiter('private');

header("Cache-control: private");
header("Content-Type: text/plain");
header("Pragma: public");

session_start();
?>
<!-- SADRŽAJ -->
<?php
ob_end_flush();
?>

View Replies !
Http Referer?
I'm bulding this web site and I do not want other to link to my pages. I can use on every sinle page the http_referer to detect who's the referer and decide if I have to give access or not... but isn't there a better way of doing this instead of putting a piece of code on very single page ?

View Replies !
FsockOpen With Http 1.1
I have the following code that needs to be transferred into HTTP 1.1 I am running on windows and wondered if this is an easy undertaking and what to beware of from user experience. PHP Code:

View Replies !
Include Using Http://
i am using include("http://".$_SERVER['SERVER_NAME']."/db.php"); to include
a file. It isnt returning anything or connecting to the database (which is
what it is supposed to be doing).

any ideas? if i put in the path to the file it works, but I need it to do it
over http the rest of the code is being run over a symbolic link and I need
different connections per website.

View Replies !
Http-Download
I want to load a file from a foreign server down in a certain directory of
my webserver.
How ?
It's no ftp-download.

View Replies !
Http://www.php.net/security
Just wondering...

What does a Square Root have to do with security?

View Replies !
Getting Files Over Ftp/http
Before I go on a mad quest to try to code some pages, I think it's
probably prutent to ask something. If I were to pass a php page either
an ftp or http address of an image file (assuming it had a username and
password coded in), would I be able to make it go and get that file and
save it in a folder local to that page?

View Replies !
Http Headers
[x-posted here and there]

Excuse me if this is OT here. I'm trying to find out what would happen
if I append my:

Content-Type: application/x-javascript
Content-Length: nnn

<javascript data>

To an http answer in transit.
1) Does appending such a thing to an http answer which already has it's
own content-type and length headers and data, is allowed ?
2) How would a typical browser understand it ? Would it just ignore it
?

If the answer to (1) is "no": what would you suggest to do ?
I've thought of capturing the stream, and creating multi-part. The
first part would be the captured one, and the second - the data I want
to append. Does it seem as a good scheme to you ?

View Replies !
Run A Php In The Background Using Http
i have a script (script1) which needs to call another script (script2).
It should not wait for the answer, so script2 should run in the background.

I really need to call the php script using:
http://urlof myscript/script2.php

I don't want to use it as a cgi and use CLI.

I did a test with fsockopen and curl and a timeout of 10 seconds and call
http://urlof myscript/script1.php from my browser:
Script1 stops after 10 seconds => OK
Script2 has been called by script1 and continue to run in the background
=>OK
After 60 seconds Script2 is killed by php!! => KO :(

The script is working fine if i call http://urlof myscript/script2.php from
my browser. It needs around 120 seconds to finish.

Why is it stopping after 60 seconds when I use fsockopen and call it from
script1?

Here is the script in SCRIPT1:
$fp = fsockopen("$host", 80, $errno, $errstr, 30);
stream_set_timeout($fp,10);
if (!$fp) {
echo "$errstr ($errno)<br />
";
} else {
$out = "GET $path HTTP/1.1
";
$out .= "Host: $host
";
$out .= "Connection: Close

";

fwrite($fp, $out);
$status = socket_get_status($fp);

while (!feof($fp) && !$status['timed_out']) {
echo fgets($fp, 128);
$status = socket_get_status($fp);
}
fclose($fp);
}

I have added this in SCRIPT2:
ignore_user_abort(FALSE); // becareful, FALSE really means it should ignore
user abort !!!
set_time_limit (120);
ini_set("max_input_time",120);
ini_set("max_execution_time",120);

Do you have any idea?

View Replies !
Http To Https
i have a page which is a application form and should be in https. it also works with http. is there any script to redirect the page to https when the request is from http?... the server is IIS. i want only that page to be in https and dont want the whole site in https.

View Replies !
Get The 'http://' Section From The Url Bar..
I'm sure this is really simple, but I'm trying to get the full url from the address bar.

I'm using this:
$url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];which works fine except I'm wanting to check whether the page is 'http://', 'https://' or even 'ftp://' and add that to the beginning.

At the moment I get something like:
www.mydomain.com/folder/index.php

View Replies !
HTTP Header
I've got a question concerning the headers sent by the client accessing your page. I have found there are several variables accessible in PHP:

$_SERVER['REMOTE_ADDR'] (which should not be determined by any HTTP headers, but by the web server reading the TCP/IP headers, right?)
$_SERVER['HTTP_VIA'] (which will be filled if there is a transparent proxy)

the above are pretty clear and cause no problems. But when you continue to search for headers that can possibly be sent by a client (may it be a proxy or not), it's getting very confusing:

$_SERVER['HTTP_X_FORWARDED_FOR']
$_SERVER['HTTP_CLIENT_IP']
$_SERVER['HTTP_PROXY_CONNECTION']
$_SERVER['FORWARDED_FOR']
$_SERVER['X_FORWARDED_FOR']
$_SERVER['X_HTTP_FORWARDED_FOR']
$_SERVER['HTTP_FORWARDED']

I mean, they all seem to denote the SAME thing. Why use SEVEN different headers for that? Were the guys who wrote the RFCs bored? Why confuse people with so much possible headers, when it could be in ONE SINGLE header?

Apparently this is not a PHP problem, since PHP just fills these variables by reading the HTTP header lines (X-Forwarded-for: , X-Forwarded: , ...) sent by the client.

I have googled for all of those, but opinions seem to differ on what header line should be taken into account and what header line shouldn't.

So,
1) Why are there so many possible headers? Are some of them obsolete?
2) What is the difference between those headers with a 'X' and those which lack the 'X'?
3) What is the difference between "FORWARDED_FOR" and just "FORWARDED"?

View Replies !
HTTP 500 Error
I have two web site with PHP for my Assignment. Both of them have login page Site 1 is running fine.

But when i run site 2 and try to use login page and submit it shows me a error 500 page I m confused why in the same server one site working fine and another one is not working? [/color]

View Replies !
Http Authenication
I was using this small script to prompt for password on some password protected folders. It was working great but I've moved servers and now the script hangs on the line "if(defined('USER_AUTHENTICATED') && USER_AUTHENTICATED){"  It doesn't like the "USER_AUTHENTICATED" but if I take it out it shows the page while it is prompting for password which I don't want. What could be causing this, is USER_AUTHENTICATED a global variable or something? Code:

View Replies !
PHP And HTTP Auth.
I have been trying to set up a script for HTTP Auth where a user can fill in a form, with a username and password and it logs the user in via .htaccess and http auth.

I have found tutorials online about how to check if someone is logged in or not,,, but thats not what im looking for...

Anyone any idea how this can be done?

View Replies !
HTTP Authentication
I spent quite some time comming up with a suitable, yet basic HTTP Authentication script. I think it works for what I am doing, yet would like some opinions on it, the bads, the worse's and sure, even the goods ;0)

I have a logon for the directory call "widgets". This directory contains semi-sensitive materials, that the general public doesn't need to see. So I have a list of files here:

index.php -- where thbase of my authentication is

include.inc -- an include file, hidden way high up in my server root, above the web root and accessible only with administrative privileges. This file contains my usernames and passwords in comma seperated values ie John,hispass.

and the rest of my files

widgets1.php
widgets2.php
widgets3.php
widgets4.php
widgets5.php .. etc

index.php contains the following code: ...........

View Replies !
HTTP Vs. FTP Upload
I have to implement a file upload for a client who's customers should be able to upload very large files (up to 500 MB). Up to now I always used the regular http upload, but also always experienced some problems with uploading big files (time outs,max_file_size, httpd.conf parameters etc.)

Since I want to make the upload as reliable as possible (and to avoid to make the customers having to start the upload over and over), I am wondering if ftp upload would be a better choice and if it would be more reliable than http.

View Replies !
PHP.ini In Subdirectory Causes HTTP 400
I'm currently working with a new hosting company using Windows IIS running PHP 4.3.6. I am trying to customize the php.ini local to my web domain only. I have downloaded the recommended PHP 4-style php-dist.ini, renamed it to 'php.ini' and put it in the root of my web directory.

However, any browser request returns an HTTP 400 error. I've gone through the settings thoroughly and don't understand what could be causing this to break.

Is there some special step I'm missing? I don't have access to the default php.ini in WINNT, but I made sure to get the critical info (include paths, etc) by running phpinfo() first and set the variables the same in my ini file.

View Replies !
PHP HTTP Headers
I need to get the http entity body in PHP.

View Replies !
HTTP Post With *
If I have a field which I am POSTing, and that field is, say, a mathematical
expression such as:

2*8

must I escap the * somehow? what if it is something like:

8 / 2

How can I escape these String values when I POST them, such that the
subsequent page can retrive the original expression?

View Replies !
HTTP 406 Error - WTF?
So I made a test page to write some code. On ANYTHING I upload, I get a 406 error. All of my pages created previously work fine, but anything new gives a HTTP 406 error. Code:

View Replies !

Copyright Š 2005-08 www.BigResource.com, All rights reserved