php-general Digest 1 Mar 2004 23:41:36 -0000 Issue 2621
Topics (messages 179158 through 179194):
Re: values from string query
179158 by: Angelo Zanetti
179161 by: Ian Firla
Re: header(Location: question
179159 by: Chris Sandy
Re: How to get the auto-incremented value?
179160 by: Angelo Zanetti
179162 by: Richard Davey
179163 by: John Nichel
FTP alternative to copy() ?
179164 by: raisinlove
179165 by: Richard Davey
179166 by: Raditha Dissanayake
179175 by: raisinlove
Parsing URL's with Apache and PHP
179167 by: Brian J. Celenza
179168 by: Raditha Dissanayake
179169 by: Richard Davey
179178 by: Brian J. Celenza
179179 by: Brian J. Celenza
Undefined offset
179170 by: Jough P
179172 by: Stuart
179173 by: Jough P
179174 by: Raditha Dissanayake
179176 by: Richard Davey
179177 by: Jough P
timer in php-cli
179171 by: nobody
Re: SOLVED: [PHP] Undefined offset
179180 by: Jough P
Re: Cookies
179181 by: Chris Shiflett
Building a C++ extension to PHP
179182 by: Rob Ristroph
need form array help
179183 by: Brian V Bonini
179185 by: Chris W. Parker
179187 by: Chris W. Parker
179188 by: Brian V Bonini
179189 by: Chris W. Parker
179190 by: Brian V Bonini
179191 by: Kelly Hallman
Question about magic quotes NEWBIE QUESTION
179184 by: James Marcinek
179186 by: Richard Davey
proc_open problems
179192 by: Rick Ridgeway
PHP and FLASH progress bar
179193 by: Ryan A
Re: php crash and memory_limit
179194 by: kringla
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, just to let you all know the curly brackets worked!
-----Original Message-----
From: Ben Ramsey [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 4:05 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Re: values from string query
You may want to try putting single quotation marks around your values
and place your array values within curly braces...
VALUES ('{$a_row['p_name']}', '{$a_row['p_company']}',
.. and so forth.
Also, try echoing $c_query to see if the values are being stored in the
variable properly, if you haven't already done so. If the values aren't
showing up in the variable, then you definitely need to include the
curly braces. If they are showing up, then perhaps MySQL needs the
single quotation marks.
--
Regards,
Ben Ramsey
http://benramsey.com
http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Try echoing your query and pasting it into mysql to make sure that the
problem isn't in the structure of your query.
Your connect statement selects a db, right?
Ian
On Thu, 2004-03-25 at 14:01, Angelo Zanetti wrote:
> HI all I have a Select that get a resultset, once I get this then I use the
> values of this resultset to enter them into another table using an INSERT
> statement. I get no errors from the statement but it just doesn't seem to
> see my variables from the recordset,
>
> below is my code:
>
>
>
> $q="select * from prospects where p_id = '$p_id'";
> $result=mysql_query($q, $this->link) or die ("".mysql_error());
>
> while($a_row=mysql_fetch_array($result))
> {
> $c_query="Insert into client (c_name, c_company, c_worktel,
> c_directtel,
> c_hometel, c_fax, c_cell, c_email, c_address, c_city, c_pcode, c_country)
> VALUES ($a_row['p_name'], $a_row['p_company'], $a_row['p_worktel'],
> $a_row['p_directtel'], $a_row['p_hometel'], $a_row['p_fax'],
> $a_row['p_cell'], $a_row['c_email'], $a_row['c_address'], $a_row['c_city'],
> $a_row['c_pcode'], $a_row['c_country'])";
> mysql_query($c_query,$this->link) or die ("".mysql_error());
> }
>
> I echo'd out the values from the Select just to make sure it was getting the
> correct values.
>
> any help will be appreciated, thanx in advance
>
> Angelo
>
> --------------------------------------------------------------------
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Your directing the client to another site. So yes this will work.
-----Original Message-----
From: John [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 29, 2004 6:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] header(Location: question
when you use a command like this:
header("Location:
http://www.highbandwidhtmirror.com/videos/download.mpg");
Is the user downloading off the mirror site or is your server
downloading
from the mirror and passing on to the end user. I want to save bandwidth
by
having mirror urls of funny videos, so will this work?
--
**********************************
Free Nokia Ringtones US
http://www.ring-tones.us
**********************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
run a query:
select query from table order by id desc
hope this helps
-----Original Message-----
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 6:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to get the auto-incremented value?
When I write a record to a MySQL db with an auto-incremented key
column, say it's called "id", what's the easy to retrieve that value?
Do I have to run a query?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Hello Angelo,
Monday, March 1, 2004, 1:18:51 PM, you wrote:
AZ> When I write a record to a MySQL db with an auto-incremented key
AZ> column, say it's called "id", what's the easy to retrieve that value?
AZ> Do I have to run a query?
AZ> run a query:
AZ> select query from table order by id desc
Why waste time running another query? Get the value from
mysql_insert_id() instead.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
Angelo Zanetti wrote:
run a query:
select query from table order by id desc
hope this helps
-----Original Message-----
From: Brian Dunning [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 6:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to get the auto-incremented value?
When I write a record to a MySQL db with an auto-incremented key
column, say it's called "id", what's the easy to retrieve that value?
Do I have to run a query?
http://www.php.net/manual/en/function.mysql-insert-id.php
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Hi, I'd like to know if there's an alternative to copy() to copy a file
from one directory to another, using the FTP functions?
I figured I could probably open the file from the server and save/upload
it to a specified path.
Can this be done? What syntax should I use?
Thank you!
-s
--- End Message ---
--- Begin Message ---
Hello,
Monday, March 1, 2004, 2:24:39 PM, you wrote:
r> Hi, I'd like to know if there's an alternative to copy() to copy a file
r> from one directory to another, using the FTP functions?
r> I figured I could probably open the file from the server and save/upload
r> it to a specified path.
r> Can this be done? What syntax should I use?
You can do this using FXP if both servers support it. However I don't
know if PHP has support for FXP built in or if the standard FTP
commands can handle it. Failing that you'll have to do as you
suggested and download the file to a temp location before uploading it
again.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
Hi,
Are you trying to copy from the FTP to the web server or are you trying
to pass it through to the end user? if you are on the same network other
options include RCP (insecure) and SCP (secure)
Richard Davey wrote:
r> Hi, I'd like to know if there's an alternative to copy() to copy a file
r> from one directory to another, using the FTP functions?
r> I figured I could probably open the file from the server and save/upload
r> it to a specified path.
r> Can this be done? What syntax should I use?
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--- End Message ---
--- Begin Message ---
Raditha Dissanayake wrote:
Hi,
Are you trying to copy from the FTP to the web server or are you trying
to pass it through to the end user? if you are on the same network other
options include RCP (insecure) and SCP (secure)
Actually, it's much simpler than that but it might be overkill.
My overall script is for creating directories on the same server, and
I'd like to copy the main index file to each new directory that is
created. So my intention is exactly the same as copy() since it's on the
same server.
I'm exploring other alternatives because I cant see to get copy()
working as I intend.
-s
--- End Message ---
--- Begin Message ---
I'm trying to setup a system where I can parse the entire URL that is given
in the address bar of the broswer.
My intentions are to make use of the parse_url() function supplied in PHP,
but I cannot find a way to get the full address requested.
Example:
http://bcelenza.somedomain.com/index.php?page=blah
Are there variables or methods with apache I can use to get this entire
address? All I'm seeing is the HTTP Referrer and some other _SERVER vars
that do not give me the whole address.
The reason I am trying to do this is to parse the address
bcelenza.somedomain.com to return the subdomain, bcelenza.
Any ideas are certainly appreciated.
Thank you,
Brian
--- End Message ---
--- Begin Message ---
Are you trying to do dynamic virtual hosting? using PHP for that would
be very inefficient look at the apache documentation for a better solution.
with php splitting by the dot (.) and getting the first part ought to do
the trick. or you can do a preg_match .
Brian J. Celenza wrote:
I'm trying to setup a system where I can parse the entire URL that is given
in the address bar of the broswer.
My intentions are to make use of the parse_url() function supplied in PHP,
but I cannot find a way to get the full address requested.
Example:
http://bcelenza.somedomain.com/index.php?page=blah
Are there variables or methods with apache I can use to get this entire
address? All I'm seeing is the HTTP Referrer and some other _SERVER vars
that do not give me the whole address.
The reason I am trying to do this is to parse the address
bcelenza.somedomain.com to return the subdomain, bcelenza.
Any ideas are certainly appreciated.
Thank you,
Brian
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--- End Message ---
--- Begin Message ---
Hello Brian,
Monday, March 1, 2004, 3:49:09 PM, you wrote:
BJC> Are there variables or methods with apache I can use to get this entire
BJC> address? All I'm seeing is the HTTP Referrer and some other _SERVER vars
BJC> that do not give me the whole address.
Personally I use the following (combined they'll give you the full
address):
$_SERVER['HTTP_HOST'];
$_SERVER['REQUEST_URI'];
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
That'll work!
Didnt' even occur to me to combine two variables from $_SERVER, and at first
I didn't thinkg HTTP_HOST would deliver what i was looking for.
Thanks!
"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Brian,
>
> Monday, March 1, 2004, 3:49:09 PM, you wrote:
>
> BJC> Are there variables or methods with apache I can use to get this
entire
> BJC> address? All I'm seeing is the HTTP Referrer and some other _SERVER
vars
> BJC> that do not give me the whole address.
>
> Personally I use the following (combined they'll give you the full
> address):
>
> $_SERVER['HTTP_HOST'];
> $_SERVER['REQUEST_URI'];
>
> --
> Best regards,
> Richard Davey
> http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
Well, not quite virtual hosting.
Basically, I want to parse the host whatever.somedomain.com and return the
whatever part, whatever being a username for example.. use that username and
draw whatever from the database to display..
So instead of a user having to do something like
www.somedomain.com/index.php?user=bcelenza, they can alternatively just type
bcelenza.somedomain.com
I hope that made some sense. :( I'm horrible with words.
"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Are you trying to do dynamic virtual hosting? using PHP for that would
> be very inefficient look at the apache documentation for a better
solution.
>
> with php splitting by the dot (.) and getting the first part ought to do
> the trick. or you can do a preg_match .
>
>
>
> Brian J. Celenza wrote:
>
> >I'm trying to setup a system where I can parse the entire URL that is
given
> >in the address bar of the broswer.
> >
> >My intentions are to make use of the parse_url() function supplied in
PHP,
> >but I cannot find a way to get the full address requested.
> >
> >Example:
> >
> >http://bcelenza.somedomain.com/index.php?page=blah
> >
> >Are there variables or methods with apache I can use to get this entire
> >address? All I'm seeing is the HTTP Referrer and some other _SERVER vars
> >that do not give me the whole address.
> >
> >The reason I am trying to do this is to parse the address
> >bcelenza.somedomain.com to return the subdomain, bcelenza.
> >
> >Any ideas are certainly appreciated.
> >
> >Thank you,
> >Brian
> >
> >
> >
>
>
> --
> Raditha Dissanayake.
> ------------------------------------------------------------------------
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.
--- End Message ---
--- Begin Message ---
Greetings all, I'm getting "Notice: Undefined offset" regarding this
line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is
the for statement above it.
Here's the while function:
function draw()
{
echo "<FORM METHOD=\"$this->method\" ACTION=\"$this->action\">\n";
if (count($this->inputs) > 0)
{
for($i=0; $i <= count($this->inputs); $i++)
{
if($this->inputs[$i] == "user")
NexForm::drawUserInputs();
if($this->inputs[$i] == "ctc")
NexForm::drawCtcInputs();
}
}
?><INPUT TYPE=SUBMIT NAME="<? echo $this->btnsubmit ?>"
VALUE="<? echo $this->btnsubmitval ?>"><?
echo "</FORM>\n";
}
--- End Message ---
--- Begin Message ---
Jough P wrote:
Greetings all, I'm getting "Notice: Undefined offset" regarding this
line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is the
for statement above it.
It doesn't mean that $i isn't defined. It means that $this->inputs[$i]
isn't defined for the value of $i where the notice is generated.
--
Stuart
--- End Message ---
--- Begin Message ---
Oops, in my previous email I meant to say "Here's the WHOLE function".
sorry about the typo, hope I didn't confuse...
On Mar 1, 2004, at 9:58 AM, Jough P wrote:
Greetings all, I'm getting "Notice: Undefined offset" regarding this
line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is
the for statement above it.
Here's the while function:
function draw()
{
echo "<FORM METHOD=\"$this->method\"
ACTION=\"$this->action\">\n";
if (count($this->inputs) > 0)
{
for($i=0; $i <= count($this->inputs); $i++)
{
if($this->inputs[$i] == "user")
NexForm::drawUserInputs();
if($this->inputs[$i] == "ctc")
NexForm::drawCtcInputs();
}
}
?><INPUT TYPE=SUBMIT NAME="<? echo $this->btnsubmit ?>"
VALUE="<? echo $this->btnsubmitval ?>"><?
echo "</FORM>\n";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
could be your $i > length of array
Jough P wrote:
Greetings all, I'm getting "Notice: Undefined offset" regarding this
line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is
the for statement above it.
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--- End Message ---
--- Begin Message ---
Hello Jough,
Monday, March 1, 2004, 3:58:31 PM, you wrote:
JP> Greetings all, I'm getting "Notice: Undefined offset" regarding
this JP> line of code while inside a for loop: if($this->>inputs[$i]
== "user")
JP> I assume the 'offset' that is undefined is $i. But $i is defined is
JP> the for statement above it.
$i should be in single-quotes, although it isn't the cause of the
error. Your var (inputs) isn't defined in your class.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
I had read elsewhere on this list that it could be the case that
$this->inputs[$i] wasn't defined at $i. That is why I encased the for
loop in the if condition:
if (sizeof($this->inputs) > 0)
{
for($i=0; $i <= sizeof($this->inputs); $i++)
{
.....
I've used both the 'sizeof' functions and 'count'
On Mar 1, 2004, at 10:03 AM, Stuart wrote:
Jough P wrote:
Greetings all, I'm getting "Notice: Undefined offset" regarding this
line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is
the for statement above it.
It doesn't mean that $i isn't defined. It means that $this->inputs[$i]
isn't defined for the value of $i where the notice is generated.
--
Stuart
--- End Message ---
--- Begin Message ---
Hello,
I'm writing a php irc bot. I've come up to the situation where I need a
timer for processing different data in a "special" way. I've searched the
archive of the list but I didn't found nothing helpful (I can't use
JavaScript here, neither cron).
If I use for(;;) or sleep(); the whole script stops (php is not
multithread:(). Eventually I've come up with some ideas about ticks, but
didn't get to finished it my head. So, any ideas?
And is php5 going to be multithreaded? If not, when?:)
--
best wishes,
Strahil Minev,
http://sourceforge.net/users/phuncky/
--- End Message ---
--- Begin Message ---
AH-HA! that was it! I was getting the notices on the last iteration
of $i. I changed this:
for($i=0; $i <= sizeof($this->inputs); $i++)
to this:
for($i=0; $i < sizeof($this->inputs); $i++)
i.e.
I changed <= to <
DOH! I guess I need more coffee...
On Mar 1, 2004, at 10:15 AM, Raditha Dissanayake wrote:
could be your $i > length of array
Jough P wrote:
Greetings all, I'm getting "Notice: Undefined offset" regarding this
line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is
the for statement above it.
--
Raditha Dissanayake.
-----------------------------------------------------------------------
-
http://www.radinks.com/sftp/ |
http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
--- Paul Higgins <[EMAIL PROTECTED]> wrote:
> Miva uses cookies, which is fine. However, the Miva pages would be
> accessed by my PHP pages on the website. Therefore, the cookies have
> nowhere to go.
You can set cookies on the client with the Set-Cookie header or with the
setcookie() function.
> They are not placed on my client, because in this case my web server
> is the client.
Your Web server is acting as both a client and server. You can pass along
any cookies you want.
> Can I trick the Miva pages to believe that I am in fact accessing a
> cookie? By possibly using headers?
I assume that accessing == sending. If so, then yes, you can do this, too,
but I'd need to know how you are sending the requests to Miva. If you're
making the connection and sending the requests yourself, you can send a
cookie by including this header:
Cookie: foo=bar
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
Hi,
I am trying to build a stub of a C++ extension, with just some
empty classes, just so I can get the build and link process
down. I will add real code later.
My two main references for this are this HOWTO and the php
documentation:
http://bugs.tutorbuddy.com/phpcpp/phpcpp/index.html
http://www.php.net/manual/en/zend.creating.php
I have set up the source files account to the tutorbuddy
howto. (They are in an extension directory named cppext2 not
cppext, because I have tried several different things by now.)
When I get everything set up and build, it doesn't build the
class.cpp file, even though that is listed in the config.m4
file. I compared my config.m4 to the one in the cryptocpp
extension also on tutorbuddy (because that was the only other
C++ PHP extension I could find). It seems right. In
particular, the source files are listed in a line like this:
PHP_NEW_EXTENSION(cppext2, cppext2.cpp class.cpp, $ext_shared)
And yet when I configure all of PHP with --with-cppext2, and
build, I get this for the very first part of the build
process:
[EMAIL PROTECTED] php-4.3.4]# make
/bin/sh /root/php-extension/php-4.3.4/libtool --silent --preserve-dup-deps
--mode=compile g++ -Iext/cppext2/ -I/root/php-extension/php-4.3.4/ext/cppext2/
-DPHP_ATOM_INC -I/root/php-extension/php-4.3.4/include
-I/root/php-extension/php-4.3.4/main -I/root/php-extension/php-4.3.4
-I/root/php-extension/php-4.3.4/Zend -I/root/php-extension/php-4.3.4/ext/xml/expat
-I/root/php-extension/php-4.3.4/TSRM -g -O2 -prefer-pic -c
/root/php-extension/php-4.3.4/ext/cppext2/cppext2.cpp -o ext/cppext2/cppext2.lo
/bin/sh /root/php-extension/php-4.3.4/libtool --silent --preserve-dup-deps
--mode=compile gcc -Iext/ctype/ -I/root/php-extension/php-4.3.4/ext/ctype/
-DPHP_ATOM_INC -I/root/php-extension/php-4.3.4/include
-I/root/php-extension/php-4.3.4/main -I/root/php-extension/php-4.3.4
-I/root/php-extension/php-4.3.4/Zend -I/root/php-extension/php-4.3.4/ext/xml/expat
-I/root/php-extension/php-4.3.4/TSRM -march=athlon-xp -O2 -prefer-pic -c
/root/php-extension/php-4.3.4/ext/ctype/ctype.c -o ext/ctype/ctype.lo
As you can see, it only builds cppext2.cpp and then jumps
right to building the next extension. Then at the end,
because it didn't build the class.cpp, it complains about
undefined references and fails to link:
ext/cppext2/cppext2.lo(.text+0xe4): In function `zif_myphpclass(int, _zval_struct*,
_zval_struct*, int)':
/usr/include/c++/3.2.2/bits/stl_alloc.h:664: undefined reference to
`MyPHPClass::MyPHPClass[in-charge](std::basic_string<char, std::char_traits<char>,
std::allocator<char> >)'
ext/cppext2/cppext2.lo(.text+0x26e): In function `zif_myphpclass_getstring(int,
_zval_struct*, _zval_struct*, int)':
/usr/include/c++/3.2.2/bits/basic_string.h:781: undefined reference to
`MyPHPClass::getString() const'
ext/cppext2/cppext2.lo(.text+0x2ab):/usr/include/c++/3.2.2/bits/basic_string.h:391:
undefined reference to `MyPHPClass::getString() const'
ext/cppext2/cppext2.lo(.text+0x416): In function `zif_myphpclass_setstring(int,
_zval_struct*, _zval_struct*, int)':
/usr/include/c++/3.2.2/bits/stl_alloc.h:664: undefined reference to
`MyPHPClass::setString(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >)'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
[EMAIL PROTECTED] php-4.3.4]#
So how do I get it to build all the files ? Do I need to list
the files in another place besides config.m4 ? The cryptocpp
extension also lists them in a Makefile.in, but when I added
such a file on the same pattern listing my files, nothing
different happened in the build.
Do I need to run the phpize command ? I see references to it
in various documentation, but things seem to work as far as
they go without it, and running it puts a lot of stuff in the
extension directory without actually changing anything that
happens when I build.
I think my next step will be to install libcrypto++ on my
machine so I can enable the cryptocpp module, make sure that
works, and then try to copy that to a new extension directory
and gradually strip it down until I have a C++ extension
template. It shouldn't really be this hard, so I must be
missing something simple . . . please respond with any hints
or tips even if you don't know the complete answer to these
problems, I can use all the help I can get.
Thanks in advance !
--Rob
--- End Message ---
--- Begin Message ---
while ($result = mysql_fetch_array($dbresult_riderlist)) {
print('<tr>' . "\n");
print("<td><input type=\"hidden\" name=\"rider_id[]\" value=\"" .
$result["rider_id"] . '" />' . "\n");
print("<input type=\"text\" name=\"rider_name[]\" value=\"" .
$result["rider_name"] . '" size="15" /></td>' . "\n");
print("<td><input type=\"text\" name=\"rider_license_cat[]\" value=\"" .
$result["rider_license_cat"] . '" size="3" /></td>' . "\n");
print("<td><input type=\"text\" name=\"comments[]\" value=\"" .
$result["comments"] . '" size="20" /></td>' . "\n");
print("<td><input type=\"file\" name=\"image[]\" value=\"" .
$result["image"] . '" size="10" /></td>' . "\n");
print("<td>Edit: <input type=\"radio\" name=\"edit_rider_action[]\"
value=\"edit\" /> Delete: <input type=\"radio\"
name=\"edit_rider_action[]\" value=\"delete\" /></td>" . "\n");
print('</tr>' . "\n");
I'm trying to gather the data from this form and test the condition of
the radio button 'edit_rider_action'.
I can traverse the form data array via $_POST and get the key/value
pairs but am not sure how to test the 'edit_rider_action'.
--
Brian V Bonini <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
Brian V Bonini <mailto:[EMAIL PROTECTED]>
on Monday, March 01, 2004 11:00 AM said:
> while ($result = mysql_fetch_array($dbresult_riderlist)) {
> print('<tr>' . "\n");
> print("<td><input type=\"hidden\" name=\"rider_id[]\" value=\"" .
> $result["rider_id"] . '" />' . "\n");
> print("<input type=\"text\" name=\"rider_name[]\" value=\"" .
> $result["rider_name"] . '" size="15" /></td>' . "\n");
> print("<td><input type=\"text\" name=\"rider_license_cat[]\"
> value=\"" . $result["rider_license_cat"] . '" size="3" /></td>' .
> "\n"); print("<td><input type=\"text\" name=\"comments[]\" value=\"" .
> $result["comments"] . '" size="20" /></td>' . "\n");
> print("<td><input type=\"file\" name=\"image[]\" value=\"" .
> $result["image"] . '" size="10" /></td>' . "\n");
> print("<td>Edit: <input type=\"radio\" name=\"edit_rider_action[]\"
> value=\"edit\" /> Delete: <input type=\"radio\"
> name=\"edit_rider_action[]\" value=\"delete\" /></td>" . "\n");
> print('</tr>' . "\n");
i think i see some code in that jungle. allow me to clean it up a bit!
while ($result = mysql_fetch_array($dbresult_riderlist)) {
echo <<<QQQ
<tr>
<td>
<input type="hidden" name="rider_id[]" value="{$result['rider_id']}"
/>
<input type="text" name="rider_name[]"
value="{$result['rider_name']}" size="15" />
</td>
<td><input type="text" name="rider_license_cat[]"
value="{$result['rider_license_cat']}" size="3" /></td>
<td><input type="text" name="comments[]" value="{$result['comments']}"
size="20" /></td>
<td><input type="file" name="image[]" value="{$result['image']}"
size="10" /></td>
<td>Edit: <input type="radio" name="edit_rider_action[]" value="edit"
/>
Delete: <input type="radio" name="edit_rider_action[]" value="delete"
/></td>
</tr>
QQQ;
}
> I'm trying to gather the data from this form and test the condition of
> the radio button 'edit_rider_action'.
>
> I can traverse the form data array via $_POST and get the key/value
> pairs but am not sure how to test the 'edit_rider_action'.
well i think since you're doing a radio button you shouldn't have [] on
the end of your field name in the first place. the [] creates a new
element within an array, in your case an array called edit_rider_action.
but because of the way radio buttons work you will never have more than
one value for edit_rider_action so you don't need it turned into an
array after the form is submitted. therefore the following code:
<td>Edit: <input type="radio" name="edit_rider_action[]" value="edit"
/>
Delete: <input type="radio" name="edit_rider_action[]" value="delete"
/></td>
should be changed into:
<td>Edit: <input type="radio" name="edit_rider_action" value="edit" />
Delete: <input type="radio" name="edit_rider_action" value="delete"
/></td>
after the form is submitted you can get to the value of
edit_rider_action with: (
<?php
$edit_rider_action = $_GET['edit_rider_action'];
?>
note: if you submitted your form via post you'll need to use $_POST and
not $_GET.
hth,
chris.
--- End Message ---
--- Begin Message ---
Chris W. Parker <>
on Monday, March 01, 2004 11:14 AM said:
> i think i see some code in that jungle. allow me to clean it up a bit!
>
> while ($result = mysql_fetch_array($dbresult_riderlist)) {
> echo <<<QQQ
> <tr>
> <td>
> <input type="hidden" name="rider_id[]"
> value="{$result['rider_id']}" />
> <input type="text" name="rider_name[]"
> value="{$result['rider_name']}" size="15" />
> </td>
> <td><input type="text" name="rider_license_cat[]"
> value="{$result['rider_license_cat']}" size="3" /></td>
> <td><input type="text" name="comments[]"
> value="{$result['comments']}" size="20" /></td>
> <td><input type="file" name="image[]" value="{$result['image']}"
> size="10" /></td>
> <td>Edit: <input type="radio" name="edit_rider_action[]"
> value="edit" />
> Delete: <input type="radio" name="edit_rider_action[]"
> value="delete" /></td>
> </tr>
>
> QQQ;
> }
mind the wrap!
c.
p.s. get it? get it?
--- End Message ---
--- Begin Message ---
On Mon, 2004-03-01 at 14:14, Chris W. Parker wrote:
>
> <td>Edit: <input type="radio" name="edit_rider_action[]" value="edit"
> />
> Delete: <input type="radio" name="edit_rider_action[]" value="delete"
> /></td>
>
> should be changed into:
>
> <td>Edit: <input type="radio" name="edit_rider_action" value="edit" />
> Delete: <input type="radio" name="edit_rider_action" value="delete"
> /></td>
>
> after the form is submitted you can get to the value of
> edit_rider_action with: (
>
> <?php
>
> $edit_rider_action = $_GET['edit_rider_action'];
>
> ?>
That make sense except the rendered form is to the effect of:
<tr>
<td><input type="hidden" name="rider_id[]" value="1" />
<input type="text" name="rider_name[]" value="Rider 1" size="15" /></td>
<td><input type="text" name="rider_license_cat[]" value="1" size="3"
/></td>
<td><input type="text" name="comments[]" value="comments here" size="20"
/></td>
<td><input type="file" name="image[]" value="" size="10" /></td>
<td>Edit: <input type="radio" name="edit_rider_action" value="edit" />
Delete: <input type="radio" name="edit_rider_action" value="delete"
/></td>
</tr>
<tr>
<td><input type="hidden" name="rider_id[]" value="2" />
<input type="text" name="rider_name[]" value="Rider 2" size="15" /></td>
<td><input type="text" name="rider_license_cat[]" value="2" size="3"
/></td>
<td><input type="text" name="comments[]" value="comments here" size="20"
/></td>
<td><input type="file" name="image[]" value="" size="10" /></td>
<td>Edit: <input type="radio" name="edit_rider_action" value="edit" />
Delete: <input type="radio" name="edit_rider_action" value="delete"
/></td>
</tr>
<tr>
<td><input type="hidden" name="rider_id[]" value="3" />
<input type="text" name="rider_name[]" value="Rider 3" size="15" /></td>
<td><input type="text" name="rider_license_cat[]" value="3" size="3"
/></td>
<td><input type="text" name="comments[]" value="comments here" size="20"
/></td>
<td><input type="file" name="image[]" value="" size="10" /></td>
<td>Edit: <input type="radio" name="edit_rider_action" value="edit" />
Delete: <input type="radio" name="edit_rider_action" value="delete"
/></td>
</tr>
So I need to test for the state of edit_rider_action in ONE of these and
perform actions based on
it's state. If I do it as above then edit_rider_action is applied to all
rows as in:
while(list($k,$v) = each($rider_id)) {
echo "$k => $v<br />\n";
echo $edit_rider_action . "<br />\n";
}
And of course it' entirely possible I'm just being brain dead at the
moment and am thinking about this all wrong.
--
Brian V Bonini <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
Brian V Bonini <mailto:[EMAIL PROTECTED]>
on Monday, March 01, 2004 11:45 AM said:
> That make sense except the rendered form is to the effect of:
[snip]
ok i see... so you want to account for the possibility that each rider
might have a different state? said differently, you don't want all the
riders to have the same edit_rider_action?
in that case i think php turns form elements with [] on the end of them
into regular arrays. example:
<?php
$edit_rider_action = $_GET['edit_rider_action'];
?>
you then access it just like any other array:
<?php
foreach($edit_rider_action as $key => $value)
{
echo "$key, $value<br/>\n";
}
$action_cnt = count($edit_rider_action);
for($ictr = 0; $ictr < $action_cnt; $ictr++)
{
echo "$ictr, {$edit_rider_action[$ictr]}<br/>\n";
}
?>
does that help?
chris.
--- End Message ---
--- Begin Message ---
On Mon, 2004-03-01 at 15:03, Chris W. Parker wrote:
> in that case i think php turns form elements with [] on the end of them
> into regular arrays. example:
>
> <?php
> $edit_rider_action = $_GET['edit_rider_action'];
> ?>
>
> you then access it just like any other array:
>
> <?php
> foreach($edit_rider_action as $key => $value)
> {
> echo "$key, $value<br/>\n";
> }
>
> $action_cnt = count($edit_rider_action);
>
> for($ictr = 0; $ictr < $action_cnt; $ictr++)
> {
> echo "$ictr, {$edit_rider_action[$ictr]}<br/>\n";
> }
> ?>
>
> does that help?
Sort of:
The count for edit_rider_action will always be 1 and it's key/value
needs to mate with one of the rest of the form rows.
For example
Name Class comments Action
Rider 1 1 foo edit() delete()
Rider 2 2 bar edit() delete()
Rider 3 2 dolar edit() delete()
Name, Class, and comments are all text fields that can be edited. Only
one of these at a time will be edited or deleted. I just need to
determine which row has "Action Selected" and then of course WHICH
action. I can get at the data but if you consider something like this:
while(list($k,$v) = each($rider_id)) {
echo "$k => $v<br />\n";
while(list($key, $value) = each($edit_rider_action )) {
echo "$key => $value<br />\n";
}
}
the edit_rider_action always has an array index of 0 and I'm not sure
how to associate it with a particular row. Perhaps I can not be cause it
has no unique value in each row. Maybe I need to set an index and
associate it that way as in:
$num_rows = mysql_num_rows($dbresult_riderlist);
$i = 0;
while ($result = mysql_fetch_array($dbresult_riderlist)) {
Edit: <input type="radio" name="edit_rider_action[$i]" value="edit" />
Delete: <input type="radio" name="edit_rider_action[$i]"
value="delete" />
$i++;
}
--
Brian V Bonini <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
On 1 Mar 2004, Brian V Bonini wrote:
> while ($result = mysql_fetch_array($dbresult_riderlist)) {
> print('<tr>' . "\n");
> print("<td><input type=\"hidden\" name=\"rider_id[]\" value=\"" .
> $result["rider_id"] . '" />' . "\n");
> print("<input type=\"text\" name=\"rider_name[]\" value=\"" .
> $result["rider_name"] . '" size="15" /></td>' . "\n");
> print("<td><input type=\"text\" name=\"rider_license_cat[]\" value=\"" .
> $result["rider_license_cat"] . '" size="3" /></td>' . "\n");
> print("<td><input type=\"text\" name=\"comments[]\" value=\"" .
> $result["comments"] . '" size="20" /></td>' . "\n");
> print("<td><input type=\"file\" name=\"image[]\" value=\"" .
> $result["image"] . '" size="10" /></td>' . "\n");
> print("<td>Edit: <input type=\"radio\" name=\"edit_rider_action[]\"
> value=\"edit\" /> Delete: <input type=\"radio\"
> name=\"edit_rider_action[]\" value=\"delete\" /></td>" . "\n");
> print('</tr>' . "\n");
Here's one way of doing this:
for($i=0;$i<$maxrows;$i++) { // whatever your loop..
echo <<<EOF
<div>
<input type="hidden" name="chkrow[]" value="{$i}">
<input type="text" name="title[{$i}]" value="{$rowdata[$i]}">
...
<input type="radio" name="mode[{$i}]" value="edit">
<input type="radio" name="mode[{$i}]" value="delete">
</div>
EOF;
}
And reading back the form values:
foreach($_REQUEST['chkrow'] as $v) {
$title = $_REQUEST['title'][$v];
$mode = $_REQUEST['mode'][$v]; // 'edit' or 'delete'
}
Adjust to your particular situation...
--Kelly
--- End Message ---
--- Begin Message ---
Hello everyone!
Are there any concerns with having the 'magic quotes'
enabled or should I use the Add & Strip Slashes? I
will be using a database (MySQL).
thanks,
James
__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools
--- End Message ---
--- Begin Message ---
Hello James,
Monday, March 1, 2004, 7:09:24 PM, you wrote:
JM> Are there any concerns with having the 'magic quotes'
JM> enabled or should I use the Add & Strip Slashes? I
JM> will be using a database (MySQL).
I wouldn't be "concerned" about using them at all - they're not a
security risk or anything (like register_globals). If you know the
environment you are developing for then take advantage of it. The only
reason you need to be careful is if you're writing software to give to
other people (i.e. to install on servers you have no control over) in
which case you cannot ever assume they will have magic quotes on so do
some checks first to find out (there are PHP functions to do this).
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
Hello,
I am using php 4.3.0, and am trying to launch the command line
interface for cisco network registrar, and be able to send commands to
it and read the output from those commands. Problem I am having is that
the commands can take some time to actually respond with output. I can
make it work by putting in a sleep after the write/before the read, but
i'd like to not have to do that. I have pasted some sample code below
(which is basically made up of sample's from the proc_open samples on
the php site).
Any suggestions would be appreciated.
$dspec = array
(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "/tmp/ErrorLog.txt", "a"),
);
$process = proc_open("$cli", $dspec, $pipes);
if (is_resource($process))
{
fwrite($pipes[0], $str."\n");
stream_set_blocking($pipes[1], FALSE);
while ($ret = fgets($pipes[1], 1024))
{
print $ret . "\n";
}
}
fclose($pipes[0]);
fclose($pipes[1]);
$return_value=proc_close($process);
--- End Message ---
--- Begin Message ---
Hi,
This is an older problem that I posted to the list and since the solutions
posted didnt really work,
I started searching for a different solution.
Required result:
After each email show the client a message:
eg:
Sent email #1
Sent email #2
etc
The message should display after each email which is easily enough done via
simple echo but the problem
is that all browsers wait and display a crapload of "sent email #x" instead
of one by one....
I tired Andre's solution of flush() but like its documented in the manual,
its giving problems on NN and
tiny problems on IE :-(....I am sure many of you more seasoned php guys must
have faced a problem
like this and maybe used a flash "progress bar"?
If yes, any chance of sharing that file with me or giving me a URL to one
such file which interacts with
the php "sending mail script"?
Have been searching google for the past 30 mins...will continue to search,
but have not made this myself
as I dont know flash well enough....
Any ideas?
Thanks,
-Ryan
--- End Message ---
--- Begin Message ---
No solution?
--- End Message ---