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




POST Variables And Sockets...


I have a server that uses Cpanel, and my mail server is Cpanel's cppop. I am trying to create an email address. With an older version of Cpanel, you could use this command line through sockets.

GET /frontend/x2/mail/doaddpop.html?email=emailaddress&domain=mysite.ca&password=emailpassword&quota=10 HTTP/1.0
Authorization: Basic $pass

That worked just fine because email addresses were created through GET variables. Now, they have changed it to POST variables. Now, I need to create an email address, while faking the following post variables:

email
domain
password
quota

I know I need to use sockets, and pass the POST variables, but I have no idea how to.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Can't See My Post Variables
I work on an application which runs on our Intranet network, so security it's not a big issue, and my phpinfo() get me register_globals on (php 4.1.2 on a Debian system).
The problems is that I can't see my post variables (only with $_POST) and I don't get it . Is there another setting wich overrides php.ini and stop my register_globals ->on to behave properly ?

With Variables And POST
On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent through the usual metod, i.e.,
<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

However, one variable is a text-area box for a detailed customer
comment, and this variable can get pretty long. But my credit-card
processor has a 256 byte maximum length limit for all POSTed
variables. However, I can add as many of these 256-byte variables as I
like.

So how can I accomplish this in the most simple, efficient, and
elegant manner? How can I break up the text-area vaiable into 256-byte
pieces and then send these variables via POST along with all of the
other form variables which will be POSTed through the usual HTML
means?

POST/GET Into Variables
how does this look? should this by me calling ... myforms = new
forms(); work by turning all key/value pairs for both get and post
into variable names of the same name as the get/post key, and the
variable values as the values from the post/get?

class forms {
// Some stuff
var $MyPosts;
var $MyGets;...

Post Cookie Variables
I have a page that include on the top the result of a cookie (i come form a previous page with some inputs) in the second part of the page a form with name surname email etc etc
On submit all the information (cookie + form) are sent by email...
my problem is this: in the email doesn't appear the cookie values
i try to create in the form tab a hidden fiel d with this value

<input name="NewEoc" type="hidden" value="<?php echo $COOKIE['NewEoc'] ?>">

Variables Past By Get And Post
I'd like a generic include that goes at the top of all pages that mysql escapes the variables past to the script. Is there a way to refer to the each of the variables past, for example (in pseudo code):

for(each $XX in (list of get/post variables)) {
$$XX = mysql_escape_string($$XX);
}

Empty Variables And 4.21 (POST/GET)
With global variables set to on, I always had the following in my script to make sure variables had a default value:

if (empty($var)) {
$var = 1;}

Now with 4.21, I changed it to:

if (empty($_GET['var'])) {
$var = 1;}

The problem is sometimes I use GET and sometimes I use POST. With global variables on it didn't matter. Now it does. Is there a way to do this? When I try if (empty($_GET['var']) || empty($_POST['var'])), it doesn't work because one or the other will always be empty at any one time.

Processing GET And POST Variables
Below is a function adapted from one found in phpMyEdit.class.php
http://platon.sk/projects/release_l...hp?project_id=5
phpMyEdit is a form generator for PHP/MySQL.

I think this function works great, especially for forms where data is
redisplayed due to failed validation of user input. I wonder what the
opinion of other PHP users would be.

function get_cgi_var($name, $default_value = null)
{
// From the phpMyEdit project
// Usage: $name = get_cgi_var('name');
static $magic_quotes_gpc = null;
if ($magic_quotes_gpc === null) {
$magic_quotes_gpc = get_magic_quotes_gpc();
}
global $HTTP_GET_VARS;
$var = @$HTTP_GET_VARS[$name];
if (! isset($var)) {
global $HTTP_POST_VARS;
$var = @$HTTP_POST_VARS[$name];
}
if (isset($var)) {
if ($magic_quotes_gpc) {
if (is_array($var)) {
foreach (array_keys($var) as $key) {
$var[$key] = stripslashes(trim(strip_tags($var[$key])));
}
return $var;
} else {
$var = stripslashes(trim(strip_tags($var)));
}
}
} else {
$var = @$default_value;
}
return $var;
// If data is displayed/posted using htmlspecialchars($var)
// return @$HTTP_POST_VARS ? html_entity_decode($var, ENT_QUOTES) :
$var;
};

$name = get_cgi_var('name');

Passing Variables With POST
I have a file named login.php that basically just checks if a username and password are in a MySQL database. If they aren't then it shows access denied. If they are then I want to pass the $name and $pass to project.php in a different directory. Code:

Looping Thru POST Variables
I need to know how to loop thru the variables my script receives from a form with action=post. I need to build a list of only those variables that comes from my checkboxes.

POST Variables Not Coming Through
For some reason, at random posts, the post variables don't get thru to
the server. For example, if there is are two text fields: name and
email... (I have register_globals on)... When I try to update the
database with a query and use $name, $email, the $name is missing or
the $email is missing. I am building an intranet application and all
the 20 or so clients run IE. This happens very rarely. Something like
once in 100 updates.

But I can see this in the log files as update contact set name="",
email="asda@pol.com" where contact_id=918. Notice the name field is
blank. I have JS checks in the client side which does not allow blank
name field..

Is this an IE random error? How do I get over this?

POST Variables From Programs
we are trying to make a program in C++ that will comminicate with a PHP script. But we dont know how to get the variables from the program. We got it figured out with perl/CGI, but PHP seems to be a better way to connect to SQL server. On PHP the GET works, its easy, but it's not secure enough. I need informtion on what headers does the PHP require to get the POSTed data from a program.

Sending Variables As POST?
I am currently trying to send information to another page using the POST method. Unfortuantley I can not find any information on how to do this. Currently I am trying

Header ("Location: newpage.html?var=test&var2=test2");

Obviously this re-directs with the variables, but they are send using GET. Not what it need. Any ideas on how to post these variables to the new page?

Apache/PHP Post Variables
I'm working with someone on a PHP project. The other person is doing
testing of scripts on their personal machine using Apache as a web server.
The production server and the one I'm using are both using IIS.

This other person reports that in their PHP scripts when tested with Apache,
form variable sent via the POST method are not "coming through." (This is
even using the "long method" of specifying them as $HTTP_POST_VARS['x'].)
These same scripts work fine on the the IIS machine (the POST variable come
through).

I've looked online to see if I can find out if anything special must be
specified in the Apache configuration to enable the POST method, and
although I found other people posting similar problems, I saw no reference
to a solution.

Not Catching The Post Variables
For some reason my PHP script is not catching the post variables that should be being sent by this form. Code:

Forward POST-variables
I have a form which should be submitted with either of two actions. Tried with javascript but this seems unreliable. Now looking at php and a processor page as the action of the form (process.php) which then sends the user to the different actionpages...can't figure out how to forward the post-variables to the different pages. Code:

Post Variables From Header Redirect
I'm using header to redirect the browser to another page and in the url I've added ?var1=value1&var2=value2 to pass some argument as get to that script, can I pass in some way, arguments as post in this case ? may I do it in both methos at the same time ?

Passing Post Variables Using Fopen()
I'm trying to pull data from a website and read it into a file the I
can parse. I've done the before to site without post variables but I
can seem to get my statments to work with the post. Can someone help
me out?below is the code I have so far.

$url="www.somesitethatneedspostvariables.com";

$postdata = http_build_query(
array( 'postvarname1' ='value1',
'postvarname2' ='value2'
)
);
$opts = array('http' =>
array(
'method' ='POST',
'header' ='Content-type: application/x-www-form-
urlencoded',
'content' =$postdata
)
);

$context = stream_context_create($opts);
$file = @fopen($url, "r", $content) or die("Connection Error, Please
contact Webmaster ERROR CODE=0xDEADBEEF");

Get Unknown Number Of Variables From POST Or GET.
I am trying to create a page that redirects users to an advertiser's page. The reason for the redirect is statistics about who clicks where.

The situation is simple when I only need to redirect them to a page, but some of the ads on my site include forms which put data in either POST or GET and I need to know how to allow my redirect page to take that data from POST or GET, whatever that data is, and pass it on to the page that the data were intended for.

I think that once I get the data I can simply create a hidden form, on the redirect page, with the data from POST or GET already in it. However, I don't know how to get an arbitrary number of variables from POST or GET.

Search - Pass Variables Or Self Post
I've created a database of documents that is searchable by a variety of fields. Currently I have a PHP page called search.php with a form to get the keywords from the user and it then passes this back to itself, runs a query and displays the results. Doing it this way the address for the search page and the results of the search is the same.

This all works fine and I'm happy with it but I was wondering if it should be implemented differently where the keywords are used as a part of the address like with search engines with Google. I don't know what the advantages or disadvantages is for either method so I'm keen to hear what others think is the best method.

How Can I Pass Variables Via POST In A Script?
Let's assume we have a script that only accepts POST variable input.. How is it possible to pass variables to it (using a php-script)?

How To Loop Through POST Variables And Contents
I am looking for a standard way/function to loop through all POST variables
and their respective contents to update a database record.

Here's my ideal to pass a function and it update:
session variable - "ID" - that holds the record ID to update
$_POST or $HTTP_POST_VARS

The function would update the $_POST vaiables of the ID record with the
$_POST variable's contents.

Get/Post Variables Not Showing Under Windows
I'm quite rusty with PHP and have a little issue. A script transmit parameters to itself through a simple form. It works fine when I run it on aproduction server (Linux+Apache+PHP4). When I run the same script on my development machine (Win2K+Apache2+PHP5) the submited variables
don't show.

Here's some simplified code:

<HTML>
<BODY>

<?php
print_r ($_SERVER);
print_r ($submit);
switch ($submit) {
// ...
}
?>

<FORM METHOD=Get>Display content of:<BR>
<INPUT TYPE=submit NAME=submit VALUE=APACD1>
<INPUT TYPE=submit NAME=submit VALUE=APACD2>
// ...
</FORM>

</BODY>
</HTML>

PHP Not Populating Form Variables Passed Through POST Or GET
I"m running:

Windows Xp SP2
Apache2
PHP5
MySQL4

Everything seems fine and dandy, and I can do scripting on server side, but for some reason I cannot get data from a form to be put into a variable.

I have a simple form in an html page which submits, and in the php script that handles the input, none of the data in the form is going into the variables.

My php.ini file does have all the GPC's in place(ie variable_order, the way they get processed).

How To Process Some Variables, Then Place Them Into POST And Redirect?
I'd like to do the following in PHP. Is there a way?

Someone submits a form with data. I want to process the data, then once I'm done with it, take two of the variables, make them post variables and basically redirect the browser as if the user pressed the submit button with data filled in.

The variables can't appear in the url.

How Do You Parse Post Variables To A Popup Window?
I know this isnt really a php question but can anyone tell me how
you parse post variables to a popup window, here's my code so far, im
trying to pass the value entered into a radio button:

<head>
<script language="JavaScript" type="text/JavaScript">
var win= null;
function NewWindow(mypage,myname,w,h,scroll)
{
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+','
settings +='width='+w+','
settings +='top='+wint+','
settings +='left='+winl+','
settings +='scrollbars='+scroll+','
settings +='resizable=yes'
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>
<form name="answer" action="result.php" method="post">
<input type="radio" name="group1" value="Milk"> Milk<br>
<input type="radio" name="group1" value="Butter"> Butter<br>
<input type="radio" name="group1" value="Cheese"> Cheese<br>
<input type="submit" name="submit" value="submit" src="result.php"
onClick="NewWindow(this.src,'name',âÆ',âÆ','yes');retur n false" >
</form>
</body>

Post Variables After Java Sort Are Lost
I have an HTML table that is being constructed from a MySQL table and
displays a form that includes a check box on 1 of the fields on the form for
each record. I have included in this PHP program a javascript routine called
sorttable.js which is something I found on the internet for sorting tables
and works quite well. The HTML table includes a check box on each record so
the user can select certain records for passing to the next process. This
works fine unless I sort the table on some column and then the POST
variables are lost. When I run the following code there are no POST
variables that will echo except the submit button.

foreach ($_POST as $varName =$value){
echo ($varName . " = " . $value);
}

However, if I don't sort the table the POST variables will be echoed for
every record in the table. I'm not sure why this is happening or how to go
about solving it. When I check certain records on the form and then sort the
table the checks themself don't disappear only the POST variables do. This
prevents me from looping thru the ARRAY to determine the value of the POST
check box for each record to see if it was checked. If I run the above code
but don't sort it I will have several hundred POST variables (several for
each record).

Could someone give me an idea on how to solve this or offer some sort of
work-around?

Forward To Page Alongwith Variables In POST
How to forward a page to another page alongwith the parameters passed into it

I mean I have page a.php
which is called with some parameters in $_POST and I require to pass these to another page with same variables in $_POST

Passing Variables In Frame Page By Post Method
Is it possible to send  variables by post method through a submit button to a frames page, and have all 3 pages in the frame pick up the variable using the $_request[var] ?In other words, I click on a submit button. in form action method call index.php the index page has a top, main, and a left frame.how do i get each one of those to receive the variable, when i can only sendit to one page? or is it possible to send it to more than one page, but only action to one page?

Problems With Error Checking / Control Of POST Variables
I have a small form that on button press submits to a PHP file for further
processing into a database. I have to change the script as it allows
blank / nothing to be submitted to the database. The intention is that if
any of the two form fields are blank (empty) then the page is resent
stating that they have to fill in all the fields to post (to a database).

If I deliberately leave the fields blank and submit the form, querying the
database shows that both fields are zero / null - so nothing was entered in
to the database.

However, if I use an echo command to see what is going on (before the data
is entered into a database) I get the $TheName field with a "1" and the
$TheComment field with an unknown entry (it doesn't echo anything to the
screen - but it's not empty).

The code I've used to test this is:

$TheName = $_POST[gbName];
$TheComment = $_POST[gbComment];

if (($TheName = NULL) or ($TheComment = NULL))
{
echo 'Quick error check running:<BR>'
echo "Name: $TheName<BR>";
echo "Comment: $TheComment";
exit;
}

This does NOT execute as these fields are not empty. It only runs if I
change to:

if (($TheName = !NULL) or ($TheComment = !NULL))

Which is pointless as it will always execute with genuine entries.

Using the amended code below:

if (($TheName = !NULL) or ($TheComment = !NULL))
{
echo 'Quick error check running:<BR>'
}

echo "Name: $TheName<BR>";
echo "Comment: $TheComment";

I get the result that both the echoed lines are displayed as blank (no
"1").

PHP:Unable To Post Variables From Html Form To Mysql Database
Plz dont treat this as another newbie query , i did my homework but
still getting nowhere :( :( :(

Trying to learn PHP on Fedora core 1 (PHP 4.3,MySQL,HTTPD).Unable to
post data from html form to php file(connecting to mysql database and
inserting into a table) .
This seemingly simple problem is making me go mad !!! I googled
extensively and already tried the following

I enabled " register_globals = On " .... in /etc/php.ini and
also took used _$POST syntax.

wot could be the problem .... is it the case that /etc/php.ini file is
not being read .... how do i know whether this is the default location
for php.ini?
Where can i find the PHPRC environment variable (the variable
responsible for the php.ini default location)

Is the problem something else .....?

Following is the code ...

form.html
---------
<HTML>
<HEAD>
<TITLE> email entry form </TITLE>
</HEAD>
<BODY>

<P>plz fil the form </P>

<FORM METHOD="POST" ACTON="form-handler.php">

NAME: <BR>
<INPUT TYPE=TEXT NAME="givename" SIZE=25> <BR>
AGE: <br>
<INPUT TYPE=TEXT NAME="givenaddress" SIZE=25> <BR>

<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

form-handler.php
-----------------
<HTML>
<HEAD>
<TITLE> EMAIL FORM HANDLER </TITLE>
</HEAD>

<BODY>

<?
mysql_connect("localhost","root") or die("Failure on db connection");

mysql_select_db("mydb");

Sockets
What are some good resources to learn socket programing?

Sockets In Php
I have created a java program to serve as my chat server that connects
to an url and using port 8080...

Then I created a client for the server in java then it worked, but I
came accross a problem. I want a php client via a website, however I
tried the php sockets and I have so many problems. I used php CLI
first to make it easier, then here is the code..:

$fp = fsockopen( "localhost", 8080, $errno, $errstr, 30 ) ;
if( !$fp )
{
echo "$errstr ($errno)<br />
" ;
}
else
{
fwrite( $fp, 'PHP' ) ;
while( !feof( $fp ) )
{
set_time_limit( 30 ) ;
print fgets( $fp, 128 ) ;
}
fclose( $fp ) ;
}

it is working connecting and if another client is sending data it can
read it, but the problem is i cannot send anything...or data to the
server....

Sockets PHP
somebody know or have got some php class to transfer archives between machines
UNIX/LINUX using sockets?

Using Sockets In PHP
We're looking at using sockets in a PHP program we are writing and need to know how common it is for them to be enabled. Anyone know?

Sockets
I'm trying to make an application using XML-RPC, and I have thefollowing problem: I use fsockopen() to simulate a POST to my localweb-server.All goes very well except it's very very slow. PHP Code:

Possible With Sockets?
I can open sockets with websites using fsockopen and socket connect, is it possible to disect a website line by line(meaning the source)? Just wondering if it was possible, i use,

while($data = socket_read($socket,2046)) { echo $data; }

which echos the whole website. Somehting like, on a page i had

<p>test</p>
<a href="www.somewhere.com">Somewhere</a>
<p>test</p>

And i just wanted to get the link?

Sockets
I'm trying to familiarise myself with socket programming in PHP on a XP Home
SP2 box with Apache 2.0.58 / PHP 5.1.4.

I've ran a few basic scripts now which I accessed through a telnet
session. The purpose of these scripts is to simply return the input I type.
They all pretty much have the same routine as shown below:

do {
// read client input
$input = socket_read($spawn, 1024, PHP_NORMAL_READ) or die("Could not read
input
");

if (trim($input) != "") {
echo "Received input: $input
";

// if client requests session end
if (trim($input) == "END") {
// close the child socket
// break out of loop
socket_close($spawn);
break;
}
// otherwise...
else {
// reverse client input and send back
$output = strrev($input) . "
";
socket_write($spawn, $output . "? ", strlen (($output)+3)) or
die("Could not write output
");
echo "Sent output: " . trim($output) . "
";
}
}
} while (true);

-- end code snippet --

Now, I read that the PHP_NORMAL_READ argument to socket_read() is buggy.
This seems to be true for my configuration as well. When ommitting this
argument the server seems to run fine except for 1 thing: The server returns
every single character I type immediately, thus refusing to accept the 'END'
request for instance. I would like to let the server return my input only
when I have hit enter. The PHP manual seems to tell me that that is just
exactly what the PHP_NORMAL_READ argument is supposed to accomplish.

Is this true? And if so, is there a workaround for this?

My goal is to write a low-end game server communicating with a flash client.
I could imagine that in that case this isn't so much of an issue anymore
since this client will probably send a whole 'command' string at a time. Is
this a correct assumption?

Php Sockets?
So I want to make a page on my site, that can (on its own) go to another site I tell it to go to and come back with a certain HTML code. How could I do that?? I looked up some things about php sockets and parsers but it confused me..

PHP Sockets And XML
I have an application which is using PHP to talk to a socket on a service implemented in Delphi. The PHP requests data from the delphi service which is monitoring some third party real time data. The command protocol is simple, a command string is passed by PHP to the service, and it returns an XML formatted set of data.

I first implemented this a year ago, under PHP 5 and apache 2, and it worked fine, but I have recently setup a new system using exactly the same tools and versions and found that any XML fomatted data that I send across the socket is having its tags removed, resulting in just the data items all concatenated together.

I have a service test harness also written in Delphi which is successfully retrieving the entire XML string, so I am confident that it is being sent to the socket OK. It seems that the PHP socket implementation is arbitrarily stripping out the tags. I can see the string as it is received by the PHP and it does not have any tags in it!!! I am using fsocketopen, and fgets (not fgetss) to read the data.

Sockets
With sockets can you create some sort of instant message between you and another pc over the net on a webpage?

Sockets
I have created a server using sockets similar to: http://us.php.net/manual/en/ref.sockets.php. I run the script from the command line using php -q /path to php file. The problem is using mysql queries within the do events. On my script I replaced echo "$buf " with my mysql information and a query string. Code:

PHP Sockets And VISA-1
Anyone ever do socket programming via PHP using VISA-1 protocol?

Usually most clearing houses provide an API, so I have no experience in this. Now I work for a clearing house, and they need a script. Any language will work as an example... I have socket examples, but need a Visa-1 handshake example...

Sockets On Windows
Hey all. I was going through the sockets tutorial and I am painstakingly trying to make windows xp allow me to play around with them but it wont let me.

On my Linux box everything works fine, but windows is denying my socket connections except at the usual telnet port (23).

Does anyone know how to configure port permissions, etc on windows xp?

Windows Sockets (yes I Know Its Old)
sorry to dig back into all this stuff but im having problems with sockets in a win98 env. my PHP is the installer version and i just added the .dll from the .zip after. what is happening is that im following the tutorial and have taken the server.php script at the end of part two and run it i then fire up telnet then connect to 127.0.0.1 (which i specified in the server.php file). then as soon as i type in a key i get a message "connection to host lost" and then in the DOS window where i am running PHP, it quits bqck to the DOS command prompt. any ideas guys?

Enabling Sockets
I'm running windows.

My php.info contains the following

But how do I add the enable socket directive?

I uncommented the socket extension line in php.inf, to no avail.

System Windows NT EWHSERVER142 5.0 build 2195
Build Date Sep 5 2005 15:50:13
Configure Command cscript /nologo configure.js
"--enable-snapshot-build" "--with-gd=shared"
Server API ISAPI
Virtual Directory Support enabled
Configuration File (php.ini) Path C:phpphp.ini
PHP API 20031224
PHP Extension 20041030
Zend Extension 220040412
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp

Sockets Question
1. When reading from a socket, how does socket timeout work?
Will an fgets wait for timeout length per attempt, or timeout is the
time allowed for repeated fgets attempts, such as in a loop?

2. Does timeout have an effect if a socket is set to nonblocking, or
does it apply to blocking sockets only?

Telnet Response Via PHP Sockets
I'm trying to develop a script that I can reuse to run remote commands
on multiple UNIX servers via telnet. I've tried various php scripts
after googling for a good 5 or so hours, but found no luck.

I've created a script (suprisingly) similar to the on found an old post
from 2001
(http://groups.google.com/group/php....5a3bb4ff13e6433)

function getResponse(&$socket) {

//Reading response
echo "Read response: ";

while ($buf = socket_read($socket, 2048)) {
//$output .= $buf;
echo $buf;
}

echo $output."";

return $output;
}

// Create internet socket
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

// Set 30 second timeout
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array("sec" =>
30, "usec" =0));

// Resolve hostname
$address = gethostbyname($host);

// Attempt connection
socket_connect($socket, $address, 23);

echo "Connected!";

// Send telnet Header 1
socket_write($socket, $header1, strlen($header1));
echo "Sent Header 1";
echo getResponse($socket);

//Header 2
socket_write($socket, $header2, strlen($header2));
echo "Sent Header 2";
echo getResponse($socket);

// Do more stuff here once its working...

socket_close($socket);
echo "Socket Closed";

echo $output;

The problem here, is that it doesn't make it past the first
socket_read(). I've even tried other methods using fread(), etc.

The same problem occurring is the response is only 2 characters (of
which are: ²$), and then the connection and script hang on the read
statement.

I've tried running this from a browser, from a command-line, but still
the same result. The only theory I have left, is that it has something
to do with the fact i'm running the script from a windows machine,
rather than a *nix one (This is because of availability issues :().

Can anybody suggest anything? Has anyone had the same problem? Simply
some proof that it works under *nix would be great.

Live Chat With Sockets
I want to make a *real* chat app in php/flash, preferably from first principles so that I can learn what this stuff is all about....so I need to get started with sockets...(flash has an xmlsocket object that will send and receive data on the client side) I've read up on the methods in the manual but would really appreciate a kick-start!

I've searched on this topic and there are a few posts but the responses range from:
. chat in php can only be faked with a db and refreshing the page - Not true!
. php is no good at this, forget it, use java or perl anyone know where I can find an example, got any advice (other than forget it !)?

Libphp4.so With --enable-sockets
I'm using Suse 8.2 out of the box including Apache and PHP. Everthing runs
fine including Apache and PHP.

Now, I want to develop a PHP programing including TCP sockets. This part is
experimental in PHP and not available in the PHP version which comes with
Suse 8.2. During configuration I need the --with-sockets argument.

After downloading the source code of PHP I can use sockets connection in my
program when it runs from the command line. So far, so good.

Now I have to compile the PHP source code for apache (it must generate the
libphp4.so). I added the --with-apxs="path to source apache" argument when
executing the configure script.

After a while it stops with the message : "apxs:Error: @sbindir@/httpd not
found or not executable" The apsx cannot find the httpd executable because
the prefix directory is @sbindir@. It must be /usr/sbin/. When looking into
apsx (perl script) it looks like that all variable are not set.

To solve this i have the following options
1) Does someone have a download location where I can sownload the libphp4.so
for Suse 8.2 with the option --with-sockets
2) Does someone know how to solve the build problem.


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