php-general Digest 14 Sep 2003 13:14:44 -0000 Issue 2296
Topics (messages 162533 through 162552):
Re: Integrating an Applet with PHP
162533 by: Raditha Dissanayake
Re: socket_write eats data - solved
162534 by: Raditha Dissanayake
162535 by: Thomas Weber
162544 by: Raditha Dissanayake
162550 by: Thomas Weber
Trying to submit form to frame and pass php var
162536 by: info.vtwebdesigners.com
Re: Calling functions from Button actions
162537 by: daniel.electroteque.org
162540 by: John W. Holmes
162541 by: daniel.electroteque.org
162542 by: John W. Holmes
162543 by: daniel.electroteque.org
Re: Text into a url
162538 by: daniel.electroteque.org
Re: square brackets in form names violate HTML specs?
162539 by: Robert Cummings
change PHP include directory
162545 by: Tim Thorburn
162546 by: John W. Holmes
162548 by: Tom Rogers
innodb + php caching issues
162547 by: daniel.electroteque.org
162551 by: esctoday.com | Wouter van Vliet
CGI Error, IIS
162549 by: nabil
php sockets was Re: [PHP] socket_write eats data - solved
162552 by: Raditha Dissanayake
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi,
Ouch tried it again and mozilla had a heart attack and core dumped :-((
Then i tried konqueror browser worked like a charm
Gentlemen, i think others in the group must be pretty annoyed about this
thread shall we hop over to a java group?
Raditha Dissanayake wrote:
Mozilla 1.4 Red Hat 9.0 KDE 3.2 JRE 1.4.2
Todd Cary wrote:
Raditha -
I am using NS 7.1 running in Windows 2000. Which version of Netscape
are you running?
This certainly is a strange situation.....
http://www.hexidec.com/ekitdemo.php
No HTML shows in the Editor window on startup with NS; it is there
with IE.....
Todd
Raditha Dissanayake wrote:
HI,
I tried it on netscape and it works. My jre is 1.4.2. AFAIK this is
the only stable jre after 1.3xx series. It's a simple matter to add
a line of code to the java applet to do the base64 decoding if you
are concerned about compatibility.
On the point raised about activex : The default plug in for ie
(extremely crappy) is in fact an activex but that does not mean your
applet behaves like an activex.
Todd Cary wrote:
Dan -
I am surprised that an Open Source applet would rely on ActiveX.
It appears that there is something I am not doing correctly in
setting the DATA param for Netscape.
Please overlook my ignorance about browsers and applets as I try to
get a better understanding, but is BASE64 encoding/decoding a
feature of IE and not , possibly, of Netscape?
Todd
Dan Anderson wrote:
why does it work in IE and not in Netscape 7.1?
I'm pretty sure ActiveX controls don't run on anything besides MS
Windows Lockinware (TM). There are a number of other things that
netscape does not fully support (try loading a page with an iframe
tag
in Netscape). You probably ran into another such problem.
-Dan
--
--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--- End Message ---
--- Begin Message ---
Is IRC UDP?
Thomas Weber wrote:
Hi,
i've checked a hundred things before posting this question, but i forgot the
most important thing, the buffer.
The 'eaten' writes were buffered by the network-kernel and sent as bunch of
data. If too much data for the buffer is sent, the write is broken up and
completed in the next bunch-of-data.
My receive-script hasn't diplayed the raw output, but an unserialized array,
fetched out of the received string.
Maybe this will will help someone in future.
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
----- Original Message -----
From: "Thomas Weber" <[EMAIL PROTECTED]>
To: "PHP-List" <[EMAIL PROTECTED]>
Sent: Saturday, September 13, 2003 9:15 PM
Subject: [PHP] socket_write eats data
Hi,
I am deveoping a chatserver in IRC-style in PHP. For communication it uses
socket-multiplexing aka socket_select. So long so good, works perfectly.
The problem is, than when i make several socket_write's to the same client
without waiting about 0.1sec after each write, the written data gets lost
somewhere. socket_write does NOT throw any error, the data seams just
sended, but the clients never receives it.
Small example of the used code:
-----
var $clients // array of 'client'-objects, each object has it's own
socket-descriptor in the object-variable $socket
function write_to_clients ($text) {
for ($i = 0; $i < count ($this->clients); $i++) {
socket_write ($this->clients[$i]->socket, $text);
}
// usleep (10000); if this is uncommented, all write are received by all
clients
}
for ($i = 0; $i < 10; $i++) {
$this->write_to_clients ("test ".$i);
}
-----
Okay, this doesn't check the client-sockets for readiness to write, but
even
if I check (via socket_select), ALL clients are ready to write and writes
get lost too. It can't be the network-connection, because the tests run
with
standalone PHP-clients on the same machine.
Is there any possibility to make fast writes without waiting after each
write? The wait limits the server to max. 10 writes per second, wich isn't
really enaugh for a good chatserver.
Thanks for your help!
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--- End Message ---
--- Begin Message ---
No, it's TCP and a very uncomplicated protocol, everything is sent in clear
text. Major problem is the socket-multicasting to keep track of all clients
simultanly.
----- Original Message -----
From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
To: "Thomas Weber" <[EMAIL PROTECTED]>; "PHP-List"
<[EMAIL PROTECTED]>
Sent: Sunday, September 14, 2003 2:59 AM
Subject: Re: [PHP] socket_write eats data - solved
> Is IRC UDP?
> Thomas Weber wrote:
>
> >Hi,
> >
> >i've checked a hundred things before posting this question, but i forgot
the
> >most important thing, the buffer.
> >The 'eaten' writes were buffered by the network-kernel and sent as bunch
of
> >data. If too much data for the buffer is sent, the write is broken up and
> >completed in the next bunch-of-data.
> >My receive-script hasn't diplayed the raw output, but an unserialized
array,
> >fetched out of the received string.
> >
> >Maybe this will will help someone in future.
> >
> >Thomas 'Neo' Weber
> >---
> >[EMAIL PROTECTED]
> >[EMAIL PROTECTED]
> >
> >----- Original Message -----
> >From: "Thomas Weber" <[EMAIL PROTECTED]>
> >To: "PHP-List" <[EMAIL PROTECTED]>
> >Sent: Saturday, September 13, 2003 9:15 PM
> >Subject: [PHP] socket_write eats data
> >
> >
> >
> >
> >>Hi,
> >>
> >>I am deveoping a chatserver in IRC-style in PHP. For communication it
uses
> >>socket-multiplexing aka socket_select. So long so good, works perfectly.
> >>The problem is, than when i make several socket_write's to the same
client
> >>without waiting about 0.1sec after each write, the written data gets
lost
> >>somewhere. socket_write does NOT throw any error, the data seams just
> >>sended, but the clients never receives it.
> >>
> >>Small example of the used code:
> >>-----
> >>var $clients // array of 'client'-objects, each object has it's own
> >>socket-descriptor in the object-variable $socket
> >>
> >>function write_to_clients ($text) {
> >> for ($i = 0; $i < count ($this->clients); $i++) {
> >> socket_write ($this->clients[$i]->socket, $text);
> >> }
> >> // usleep (10000); if this is uncommented, all write are received by
all
> >>clients
> >>}
> >>
> >>for ($i = 0; $i < 10; $i++) {
> >> $this->write_to_clients ("test ".$i);
> >>}
> >>-----
> >>
> >>Okay, this doesn't check the client-sockets for readiness to write, but
> >>
> >>
> >even
> >
> >
> >>if I check (via socket_select), ALL clients are ready to write and
writes
> >>get lost too. It can't be the network-connection, because the tests run
> >>
> >>
> >with
> >
> >
> >>standalone PHP-clients on the same machine.
> >>
> >>Is there any possibility to make fast writes without waiting after each
> >>write? The wait limits the server to max. 10 writes per second, wich
isn't
> >>really enaugh for a good chatserver.
> >>
> >>Thanks for your help!
> >>
> >>Thomas 'Neo' Weber
> >>---
> >>[EMAIL PROTECTED]
> >>[EMAIL PROTECTED]
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> http://www.radinks.com/upload
> Drag and Drop File Uploader.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Wouldn't this multiple connections be a problem for php? IMHO one of the
main draw backs of the PHP IMAP library is the fact that you have to
open and close and imap connection for each page. That issue is
multiplied ten fold in this scenario isn't it?
Thomas Weber wrote:
No, it's TCP and a very uncomplicated protocol, everything is sent in clear
text. Major problem is the socket-multicasting to keep track of all clients
simultanly.
----- Original Message -----
From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
To: "Thomas Weber" <[EMAIL PROTECTED]>; "PHP-List"
<[EMAIL PROTECTED]>
Sent: Sunday, September 14, 2003 2:59 AM
Subject: Re: [PHP] socket_write eats data - solved
Is IRC UDP?
Thomas Weber wrote:
Hi,
i've checked a hundred things before posting this question, but i forgot
the
most important thing, the buffer.
The 'eaten' writes were buffered by the network-kernel and sent as bunch
of
data. If too much data for the buffer is sent, the write is broken up and
completed in the next bunch-of-data.
My receive-script hasn't diplayed the raw output, but an unserialized
array,
fetched out of the received string.
Maybe this will will help someone in future.
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
----- Original Message -----
From: "Thomas Weber" <[EMAIL PROTECTED]>
To: "PHP-List" <[EMAIL PROTECTED]>
Sent: Saturday, September 13, 2003 9:15 PM
Subject: [PHP] socket_write eats data
Hi,
I am deveoping a chatserver in IRC-style in PHP. For communication it
uses
socket-multiplexing aka socket_select. So long so good, works perfectly.
The problem is, than when i make several socket_write's to the same
client
without waiting about 0.1sec after each write, the written data gets
lost
somewhere. socket_write does NOT throw any error, the data seams just
sended, but the clients never receives it.
Small example of the used code:
-----
var $clients // array of 'client'-objects, each object has it's own
socket-descriptor in the object-variable $socket
function write_to_clients ($text) {
for ($i = 0; $i < count ($this->clients); $i++) {
socket_write ($this->clients[$i]->socket, $text);
}
// usleep (10000); if this is uncommented, all write are received by
all
clients
}
for ($i = 0; $i < 10; $i++) {
$this->write_to_clients ("test ".$i);
}
-----
Okay, this doesn't check the client-sockets for readiness to write, but
even
if I check (via socket_select), ALL clients are ready to write and
writes
get lost too. It can't be the network-connection, because the tests run
with
standalone PHP-clients on the same machine.
Is there any possibility to make fast writes without waiting after each
write? The wait limits the server to max. 10 writes per second, wich
isn't
really enaugh for a good chatserver.
Thanks for your help!
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--- End Message ---
--- Begin Message ---
IMAP? We were talking about IRC, the Internet Relay Chat.
In detail, my problems doesn't even refer to IRC directly, as i am
developing a server for a html-based webchat, but the server-structure and
the messages are nearly the same.
Once you realize the basics of socket-multicasting, it is no problem to
maintain hundreds of simultanous TCP-connects via arrays of sockets, also
called descriptor-sets. PHP seems to directly use the underlying C-
libraries, so everything you can imagine is possible.
Anyway, the major drawback of PHP in this case is speed. Currently i can
send about seven messages per second (one send means socket-connect of a
input client, some simple processing of the message and sending it to all
connected listening clients) with a dozen listening clients, but only about
three messages per second with two hundred listening clients. As C-written
IRC-servers sometimes have thousands of connected clients, i can only
imagine that it is PHP which has some not so efficent array- or
resource-handling.
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
----- Original Message -----
From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
Cc: "PHP-List" <[EMAIL PROTECTED]>
Sent: Sunday, September 14, 2003 7:26 AM
Subject: Re: [PHP] socket_write eats data - solved
> Wouldn't this multiple connections be a problem for php? IMHO one of the
> main draw backs of the PHP IMAP library is the fact that you have to
> open and close and imap connection for each page. That issue is
> multiplied ten fold in this scenario isn't it?
>
>
> Thomas Weber wrote:
>
> >No, it's TCP and a very uncomplicated protocol, everything is sent in
clear
> >text. Major problem is the socket-multicasting to keep track of all
clients
> >simultanly.
> >
> >----- Original Message -----
> >From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
> >To: "Thomas Weber" <[EMAIL PROTECTED]>; "PHP-List"
> ><[EMAIL PROTECTED]>
> >Sent: Sunday, September 14, 2003 2:59 AM
> >Subject: Re: [PHP] socket_write eats data - solved
> >
> >
> >
> >
> >>Is IRC UDP?
> >>Thomas Weber wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>
> >>>i've checked a hundred things before posting this question, but i
forgot
> >>>
> >>>
> >the
> >
> >
> >>>most important thing, the buffer.
> >>>The 'eaten' writes were buffered by the network-kernel and sent as
bunch
> >>>
> >>>
> >of
> >
> >
> >>>data. If too much data for the buffer is sent, the write is broken up
and
> >>>completed in the next bunch-of-data.
> >>>My receive-script hasn't diplayed the raw output, but an unserialized
> >>>
> >>>
> >array,
> >
> >
> >>>fetched out of the received string.
> >>>
> >>>Maybe this will will help someone in future.
> >>>
> >>>Thomas 'Neo' Weber
> >>>---
> >>>[EMAIL PROTECTED]
> >>>[EMAIL PROTECTED]
> >>>
> >>>----- Original Message -----
> >>>From: "Thomas Weber" <[EMAIL PROTECTED]>
> >>>To: "PHP-List" <[EMAIL PROTECTED]>
> >>>Sent: Saturday, September 13, 2003 9:15 PM
> >>>Subject: [PHP] socket_write eats data
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Hi,
> >>>>
> >>>>I am deveoping a chatserver in IRC-style in PHP. For communication it
> >>>>
> >>>>
> >uses
> >
> >
> >>>>socket-multiplexing aka socket_select. So long so good, works
perfectly.
> >>>>The problem is, than when i make several socket_write's to the same
> >>>>
> >>>>
> >client
> >
> >
> >>>>without waiting about 0.1sec after each write, the written data gets
> >>>>
> >>>>
> >lost
> >
> >
> >>>>somewhere. socket_write does NOT throw any error, the data seams just
> >>>>sended, but the clients never receives it.
> >>>>
> >>>>Small example of the used code:
> >>>>-----
> >>>>var $clients // array of 'client'-objects, each object has it's own
> >>>>socket-descriptor in the object-variable $socket
> >>>>
> >>>>function write_to_clients ($text) {
> >>>> for ($i = 0; $i < count ($this->clients); $i++) {
> >>>> socket_write ($this->clients[$i]->socket, $text);
> >>>> }
> >>>> // usleep (10000); if this is uncommented, all write are received by
> >>>>
> >>>>
> >all
> >
> >
> >>>>clients
> >>>>}
> >>>>
> >>>>for ($i = 0; $i < 10; $i++) {
> >>>> $this->write_to_clients ("test ".$i);
> >>>>}
> >>>>-----
> >>>>
> >>>>Okay, this doesn't check the client-sockets for readiness to write,
but
> >>>>
> >>>>
> >>>>
> >>>>
> >>>even
> >>>
> >>>
> >>>
> >>>
> >>>>if I check (via socket_select), ALL clients are ready to write and
> >>>>
> >>>>
> >writes
> >
> >
> >>>>get lost too. It can't be the network-connection, because the tests
run
> >>>>
> >>>>
> >>>>
> >>>>
> >>>with
> >>>
> >>>
> >>>
> >>>
> >>>>standalone PHP-clients on the same machine.
> >>>>
> >>>>Is there any possibility to make fast writes without waiting after
each
> >>>>write? The wait limits the server to max. 10 writes per second, wich
> >>>>
> >>>>
> >isn't
> >
> >
> >>>>really enaugh for a good chatserver.
> >>>>
> >>>>Thanks for your help!
> >>>>
> >>>>Thomas 'Neo' Weber
> >>>>---
> >>>>[EMAIL PROTECTED]
> >>>>[EMAIL PROTECTED]
> >>>>
> >>>>--
> >>>>PHP General Mailing List (http://www.php.net/)
> >>>>To unsubscribe, visit: http://www.php.net/unsub.php
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>--
> >>http://www.radinks.com/upload
> >>Drag and Drop File Uploader.
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> http://www.radinks.com/upload
> Drag and Drop File Uploader.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hello I was wondering if someone could help me out.
Trying to submit form to frame and pass php var at the same time.
<script language="JavaScript"><!--
function submitform(){
top.admin.document.adminform.submit();
}
//--></script>
and...
<frameset rows="538,83" cols="*">
<frame src="admin.php?order=1" name="admin" id="admin">
<frame src="status.php" name="status" scrolling="auto" id="status">
</frameset>
Link look like: <a href="javascript:submitform();"
target="_parent">Delete</a>
What I need to do though, is run this exact script while passing
($delete=yes) as php at the same time? Basically, run the form and if
delete=yes then use the following form tag : <form name=adminform
method=post action=setup.php?delete=yes target=_parent>
Any ideas? Thanks Brandon
--- End Message ---
--- Begin Message ---
wont they both be set ?
i generally use a button type and onclick document.location.href to enforce
an action in the get variable like something.php?action=something
> Example:
>
> <form action="action.php">
> <input type="submit" name="action1" value="Execute function action1()">
> <input type="submit" name="action2" value="Execute function action2()">
> </form>
>
> action.php:
> function action1() {
> echo "Hello, I'm action1";
> }
>
>
> function action2() {
> echo "Hello, I'm action2";
> }
>
> if(isset($_GET['action1'])) {
> action1();
> }
> if(isset($_GET['action2'])) {
> action2();
> }
>
>
> Dan J. Rychlik wrote:
>> Is their an easy way to call a function based upon a button action?
>>
>> -Dan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
>>Dan J. Rychlik wrote:
>>>Is their an easy way to call a function based upon a button action?
>>
>>Example:
>>
>><form action="action.php">
>><input type="submit" name="action1" value="Execute function
>>action1()">
>><input type="submit" name="action2" value="Execute function
>>action2()">
>></form>
>>
>>action.php:
>>function action1() {
>> echo "Hello, I'm action1";
>>}
>>
>>
>>function action2() {
>> echo "Hello, I'm action2";
>>}
>>
>>if(isset($_GET['action1'])) {
>> action1();
>>}
>>if(isset($_GET['action2'])) {
>> action2();
>>}
>
wont they both be set ?
No, only the button that is clicked will be set.
i generally use a button type and onclick document.location.href to enforce
an action in the get variable like something.php?action=something
I wouldn't rely on Javascript...
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
apologies i generally use this system for deleting records, i give a
confirm box if they press ok it goes to another action, i suppose i should
change this system to submit the form instead and check for the post var ?
i guess at least it could store the http_referer then :\
> [EMAIL PROTECTED] wrote:
> >>Dan J. Rychlik wrote:
> >>>Is their an easy way to call a function based upon a button action?
> >>
> >>Example:
> >>
> >><form action="action.php">
> >><input type="submit" name="action1" value="Execute function
> >>action1()">
> >><input type="submit" name="action2" value="Execute function
> >>action2()">
> >></form>
> >>
> >>action.php:
> >>function action1() {
> >> echo "Hello, I'm action1";
> >>}
> >>
> >>
> >>function action2() {
> >> echo "Hello, I'm action2";
> >>}
> >>
> >>if(isset($_GET['action1'])) {
> >> action1();
> >>}
> >>if(isset($_GET['action2'])) {
> >> action2();
> >>}
> >
>> wont they both be set ?
>
> No, only the button that is clicked will be set.
>
>> i generally use a button type and onclick document.location.href to
>> enforce an action in the get variable like
>> something.php?action=something
>
> I wouldn't rely on Javascript...
>
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
apologies i generally use this system for deleting records, i give a
confirm box if they press ok it goes to another action, i suppose i should
change this system to submit the form instead and check for the post var ?
i guess at least it could store the http_referer then :\
If you're talking about presenting a list of records and using a button
to delete a record, then you should use a method such as this...
<input type="submit" name="delete[xx]" value="Delete">
Where "xx" is the record_id (or equivalent). Then, when the form is
submitted, you just look for $_REQUEST['delete'], make sure it's an
array, grab the key using key(), and delete that record.
Simple, eh? :)
If you want an easy method for presenting a list of records and radio
buttons for each record with different statuses (like open, closed,
pending, delete, etc), and handling the status changes, check out my
column in the latest issue of php|architect. :)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
my form action usually looks like this
some.php?action=update&ID=1
my update will look like update table set *** where _rowid=$_GET['ID']
so therefore its globally used. i'd use the id from the get var
but i guess in the delete function i could place this within the update
action so
case 'update':
delete(tablename);
update(tablename);
break;
i dont tend to like this becuase it'll be in the same action which is why i
tried the location.href way to send it to a different action, as both the
update and delete buttons are within the same form, i'm sure u could have a
delete button in a list although this leads to problems as users generally
would like the delete button in the update/view screen so they know exactly
what they are deleting so therefore which is why the buttons are in the
same form, any ideas ?
> [EMAIL PROTECTED] wrote:
>
>> apologies i generally use this system for deleting records, i give a
>> confirm box if they press ok it goes to another action, i suppose i
>> should change this system to submit the form instead and check for the
>> post var ? i guess at least it could store the http_referer then :\
>
> If you're talking about presenting a list of records and using a button
> to delete a record, then you should use a method such as this...
>
> <input type="submit" name="delete[xx]" value="Delete">
>
> Where "xx" is the record_id (or equivalent). Then, when the form is
> submitted, you just look for $_REQUEST['delete'], make sure it's an
> array, grab the key using key(), and delete that record.
>
> Simple, eh? :)
>
> If you want an easy method for presenting a list of records and radio
> buttons for each record with different statuses (like open, closed,
> pending, delete, etc), and handling the status changes, check out my
> column in the latest issue of php|architect. :)
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
$query = "SELECT name,url FROM clubs WHERE url>'' ORDER BY name";
??
could it not be
$query = "SELECT name,url FROM clubs WHERE url !="" ORDER BY name";
> Hi
> I am havening a problem retrieving url from a mysql database. I have
> the url's stored as text and am using the following code to retrieve
> them
>
>
> $query = "SELECT name,url FROM clubs WHERE url>'' ORDER BY name";
>
> $result = @mysql_query($query) or die ("Query failed");
>
> if (mysql_num_rows($result) == 0) {
>
> print "No Club Links Found.";
>
> } else {
>
> while ($row = mysql_fetch_assoc($result)) {
>
> print $row["name"] . "<A HREF= ".$row['url'].">";
>
>
> This seems to work except the url refers to the previous name on the
> list produced with the first name as a blank url.
> Can anybody help
>
> Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Sat, 2003-09-13 at 17:21, Eugene Lee wrote:
> On Sat, Sep 13, 2003 at 06:15:29PM +0000, Curt Zirzow wrote:
> : * Thus wrote Eugene Lee ([EMAIL PROTECTED]):
> : > Something I've noticed in PHP is a proliferation of code like this:
> : >
> : > <input name="stuff[title]" value="" type="text" size="40">
> [...]
> : The way to properly do it would be to set set your name as:
> :
> : <input name="stuff%5Btitle%5D" value="" type="text" size="40">
>
> Great idea, thanks Curt!
I almost fell for this and updated my code. Then I decided to read the
spec for myself and noticed that it doesn't say anywhere that % is ok
either *grin*.
- ID and NAME tokens must begin with a letter ([A-Za-z]) and
may be followed by any number of letters, digits ([0-9]),
hyphens ("-"), underscores ("_"), colons (":"), and periods
(".").
Cheers,
Rob.
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--- End Message ---
--- Begin Message ---
Hi,
Normally to change a sites include directory for PHP I'd use a .htaccess
file and the following command:
php_value include_path ".:/path/to/web/"
Again normally, I would get the path to the site by doing a simple
phpinfo(); command and find the _ENV["DOCUMENT_ROOT"] line near the end of
the phpinfo(); page.
I've just setup an account with a shared hosting provider - I'm not fully
sure if they allow me to use .htaccess or not, I've got a call into tech
support but waiting is boring. So while I wait - is there a better or more
accurate way of determining the actual path to my site on their
server? I'm sure it has been written into PHP to specifically not allow
this - just curious.
Secondly, if it is proven that my host does not allow .htaccess - is there
another way for me to change the include directory from its default and
into my sites root?
This current site isn't all that large, so I could live without changing
the include path - but my next job (which is already committed to this same
host) is fairly large and will be a necessity for the change to occur.
Thanks
-Tim
--- End Message ---
--- Begin Message ---
Tim Thorburn wrote:
Normally to change a sites include directory for PHP I'd use a .htaccess
file and the following command:
php_value include_path ".:/path/to/web/"
Again normally, I would get the path to the site by doing a simple
phpinfo(); command and find the _ENV["DOCUMENT_ROOT"] line near the end
of the phpinfo(); page.
I've just setup an account with a shared hosting provider - I'm not
fully sure if they allow me to use .htaccess or not, I've got a call
into tech support but waiting is boring. So while I wait - is there a
better or more accurate way of determining the actual path to my site on
their server? I'm sure it has been written into PHP to specifically not
allow this - just curious.
You will be able to get it the same way. Just look at a phpinfo() page
or print the value of $_SERVER['DOCUMENT_ROOT'].
Secondly, if it is proven that my host does not allow .htaccess - is
there another way for me to change the include directory from its
default and into my sites root?
You can use ini_set().
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi,
Sunday, September 14, 2003, 3:25:57 PM, you wrote:
TT> Hi,
TT> Normally to change a sites include directory for PHP I'd use a .htaccess
TT> file and the following command:
TT> php_value include_path ".:/path/to/web/"
TT> Again normally, I would get the path to the site by doing a simple
TT> phpinfo(); command and find the _ENV["DOCUMENT_ROOT"] line near the end of
TT> the phpinfo(); page.
TT> I've just setup an account with a shared hosting provider - I'm not fully
TT> sure if they allow me to use .htaccess or not, I've got a call into tech
TT> support but waiting is boring. So while I wait - is there a better or more
TT> accurate way of determining the actual path to my site on their
TT> server? I'm sure it has been written into PHP to specifically not allow
TT> this - just curious.
TT> Secondly, if it is proven that my host does not allow .htaccess - is there
TT> another way for me to change the include directory from its default and
TT> into my sites root?
TT> This current site isn't all that large, so I could live without changing
TT> the include path - but my next job (which is already committed to this same
TT> host) is fairly large and will be a necessity for the change to occur.
TT> Thanks
TT> -Tim
You can do this at the top of each page if all else fails
ini_set('include_path','new_include_path:'.ini_get('include_path'));
(Use a ; as the separator if on windows)
This puts your directory first in the search path
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hi there i have experienced a wierd bug , where after i commit a query in
innodb that change wont be viewable until i refresh the page , this doesnt
happen in a similar system framwork using myisam tables the change is
viewable, what could be the problem ? should i just give nocache headers
for a quick fix?
--- End Message ---
--- Begin Message ---
Might want to try to send aa 'commit' command to the database. Just the
first thing that enters my mind
-> -----Original Message-----
-> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
-> Sent: zondag 14 september 2003 7:55
-> To: [EMAIL PROTECTED]
-> Subject: [PHP] innodb + php caching issues
->
-> Hi there i have experienced a wierd bug , where after i
-> commit a query in innodb that change wont be viewable until
-> i refresh the page , this doesnt happen in a similar system
-> framwork using myisam tables the change is viewable, what
-> could be the problem ? should i just give nocache headers
-> for a quick fix?
->
-> --
-> PHP General Mailing List (http://www.php.net/) To
-> unsubscribe, visit: http://www.php.net/unsub.php
->
--- End Message ---
--- Begin Message ---
Why this happen with me with IIS
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
--- End Message ---
--- Begin Message ---
Hi thomas,
Thomas Weber wrote:
IMAP? We were talking about IRC,
Used imap as an example.
the Internet Relay Chat.
In detail, my problems doesn't even refer to IRC directly, as i am
developing a server for a html-based webchat, but the server-structure and
the messages are nearly the same.
Yes my questions was how are you going to maintain the connection
between two different connectsion. As far as i know sockets cannot be
serialized in php4.
Once you realize the basics of socket-multicasting, it is no problem to
maintain hundreds of simultanous TCP-connects via arrays of sockets, also
called descriptor-sets. PHP seems to directly use the underlying C-
libraries, so everything you can imagine is possible.
Thanx i am aware of it
--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--- End Message ---