[PHP] java.lang.UnsatisfiedLinkError: send trying to install PHP as a Servlet for Tomcat 5.0.18 on FreeBSD
Hi, Ive searched the web and archives - found many with the same problem, but noone with a solution. I followed the following steps (as per /sapi/servlet/README): 1)./configure --with-servlet --with-java 2) make 3) make install 4) copy the phpsrvlt.jar to the context's WEB-INF/lib 5) added the servlet config and mapping to the context's web.xml 6) restarted tomcat First I get this exception (javax.servlet.ServletException: Servlet.init() for servlet php threw exception): java.lang.UnsatisfiedLinkError: no php4 in java.library.path java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403) java.lang.Runtime.loadLibrary0(Runtime.java:788) java.lang.System.loadLibrary(System.java:832) net.php.reflect.loadLibrary(reflect.java:34) net.php.reflect.clinit(reflect.java:29) net.php.servlet.init(servlet.java:157) Then everytime I refresh after that I get this (javax.servlet.ServletException: Servlet execution threw an exception): java.lang.UnsatisfiedLinkError: send net.php.servlet.send(Native Method) net.php.servlet.service(servlet.java:190) net.php.servlet.service(servlet.java:214) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) Does anyone have any idea how to get around this? Thanks for your time, -- Dan Hardiker -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Re: Re: Your document
Your file is attached. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get MySQL table field names
Matt Palermo wrote: How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. http://php.net/mysql_list_fields -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 1 Mar 2004 11:22:50 -0000 Issue 2620
php-general Digest 1 Mar 2004 11:22:50 - Issue 2620 Topics (messages 179139 through 179157): Opps 179139 by: Karl Timmermann Get MySQL table field names 179140 by: Matt Palermo 179141 by: Michael Kunze 179149 by: Five 179151 by: Jason Wong 179153 by: Five 179157 by: Stuart header(Location: question 179142 by: John 179143 by: DvDmanDT Re: php crash and memory_limit 179144 by: kringla Re: PHP Sessions 179145 by: Andre Cerqueira 179150 by: Tom Rogers A question about permissions.might be a bit 0T 179146 by: Ryan A 179154 by: Burhan Khalid Re: Text cleaning? 179147 by: Justin French PHP and determining Business days. 179148 by: Steve Cookies 179152 by: Paul Higgins java.lang.UnsatisfiedLinkError: send trying to install PHP as a Servlet for Tomcat 5.0.18 on FreeBSD 179155 by: Dan Hardiker Re: Your document 179156 by: damien.seguy.nexen.net 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] -- ---BeginMessage--- Sorry, I didn't know what top posting was, but someone just told me. Won't happen again.. Sorry! Karl ---End Message--- ---BeginMessage--- How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. Thanks, Matt http://sweetphp.com ---End Message--- ---BeginMessage--- Matt Palermo wrote: How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. use 'DESC table_name;' -- Michael Kunze http://www.smrealms.de/ Caterva carissima mea est Ille Quis. ---End Message--- ---BeginMessage--- Michael Kunze [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Matt Palermo wrote: How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. use 'DESC table_name;' -- Michael Kunze http://www.smrealms.de/ Caterva carissima mea est Ille Quis. Could you elaborate on that a litttle? I spent about an hour researching and experimenting with DESC and can't get it to work. ---End Message--- ---BeginMessage--- On Monday 01 March 2004 10:04, Five wrote: Michael Kunze [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Matt Palermo wrote: How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. use 'DESC table_name;' Could you elaborate on that a litttle? I spent about an hour researching and experimenting with DESC and can't get it to work. mysql_list_fields(), read it before you use it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A man is only a man, but a good bicycle is a ride -- Murphy's Laws on Sex n50 */ ---End Message--- ---BeginMessage--- Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Monday 01 March 2004 10:04, Five wrote: Michael Kunze [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Matt Palermo wrote: How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. use 'DESC table_name;' Could you elaborate on that a litttle? I spent about an hour researching and experimenting with DESC and can't get it to work. mysql_list_fields(), read it before you use it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A man is only a man, but a good bicycle is a ride -- Murphy's Laws on Sex n50 */ Thanks, that's much easier ---End Message--- ---BeginMessage--- Matt Palermo wrote: How can I get the field names from a specified MySQL table? I don't need the data, I just want to get an array of the tables field names. http://php.net/mysql_list_fields -- Stuart ---End Message--- ---BeginMessage--- 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.
RE: [PHP] Re: values from string query
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header(Location: question
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to get the auto-incremented value?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] values from string query
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] How to get the auto-incremented value?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get the auto-incremented value?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP alternative to copy() ?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP alternative to copy() ?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP alternative to copy() ?
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing URL's with Apache and PHP
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing URL's with Apache and PHP
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing URL's with Apache and PHP
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Undefined offset
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
[PHP] timer in php-cli
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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined offset
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined offset
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined offset
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
Re: [PHP] FTP alternative to copy() ?
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined offset
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined offset
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing URL's with Apache and PHP
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing URL's with Apache and PHP
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SOLVED: [PHP] Undefined offset
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookies
--- 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Building a C++ extension to PHP
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_stringchar, std::char_traitschar, std::allocatorchar )' 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_stringchar, std::char_traitschar, std::allocatorchar )' 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need form array help
while ($result = mysql_fetch_array($dbresult_riderlist)) { print('tr' . \n); print(tdinput 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(tdinput type=\text\ name=\rider_license_cat[]\ value=\ . $result[rider_license_cat] . ' size=3 //td' . \n); print(tdinput type=\text\ name=\comments[]\ value=\ . $result[comments] . ' size=20 //td' . \n); print(tdinput type=\file\ name=\image[]\ value=\ . $result[image] . ' size=10 //td' . \n); print(tdEdit: 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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about magic quotes NEWBIE QUESTION
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need form array help
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(tdinput 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(tdinput type=\text\ name=\rider_license_cat[]\ value=\ . $result[rider_license_cat] . ' size=3 //td' . \n); print(tdinput type=\text\ name=\comments[]\ value=\ . $result[comments] . ' size=20 //td' . \n); print(tdinput type=\file\ name=\image[]\ value=\ . $result[image] . ' size=10 //td' . \n); print(tdEdit: 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 tdinput type=text name=rider_license_cat[] value={$result['rider_license_cat']} size=3 //td tdinput type=text name=comments[] value={$result['comments']} size=20 //td tdinput type=file name=image[] value={$result['image']} size=10 //td tdEdit: 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: tdEdit: input type=radio name=edit_rider_action[] value=edit / Delete: input type=radio name=edit_rider_action[] value=delete //td should be changed into: tdEdit: 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about magic quotes NEWBIE QUESTION
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need form array help
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 tdinput type=text name=rider_license_cat[] value={$result['rider_license_cat']} size=3 //td tdinput type=text name=comments[] value={$result['comments']} size=20 //td tdinput type=file name=image[] value={$result['image']} size=10 //td tdEdit: 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? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need form array help
On Mon, 2004-03-01 at 14:14, Chris W. Parker wrote: tdEdit: input type=radio name=edit_rider_action[] value=edit / Delete: input type=radio name=edit_rider_action[] value=delete //td should be changed into: tdEdit: 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 tdinput type=hidden name=rider_id[] value=1 / input type=text name=rider_name[] value=Rider 1 size=15 //td tdinput type=text name=rider_license_cat[] value=1 size=3 //td tdinput type=text name=comments[] value=comments here size=20 //td tdinput type=file name=image[] value= size=10 //td tdEdit: input type=radio name=edit_rider_action value=edit / Delete: input type=radio name=edit_rider_action value=delete //td /tr tr tdinput type=hidden name=rider_id[] value=2 / input type=text name=rider_name[] value=Rider 2 size=15 //td tdinput type=text name=rider_license_cat[] value=2 size=3 //td tdinput type=text name=comments[] value=comments here size=20 //td tdinput type=file name=image[] value= size=10 //td tdEdit: input type=radio name=edit_rider_action value=edit / Delete: input type=radio name=edit_rider_action value=delete //td /tr tr tdinput type=hidden name=rider_id[] value=3 / input type=text name=rider_name[] value=Rider 3 size=15 //td tdinput type=text name=rider_license_cat[] value=3 size=3 //td tdinput type=text name=comments[] value=comments here size=20 //td tdinput type=file name=image[] value= size=10 //td tdEdit: 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 = $vbr /\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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need form array help
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, $valuebr/\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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need form array help
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, $valuebr/\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 fooedit() delete() Rider 2 2 baredit() 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 = $vbr /\n; while(list($key, $value) = each($edit_rider_action )) { echo $key = $valuebr /\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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need form array help
On 1 Mar 2004, Brian V Bonini wrote: while ($result = mysql_fetch_array($dbresult_riderlist)) { print('tr' . \n); print(tdinput 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(tdinput type=\text\ name=\rider_license_cat[]\ value=\ . $result[rider_license_cat] . ' size=3 //td' . \n); print(tdinput type=\text\ name=\comments[]\ value=\ . $result[comments] . ' size=20 //td' . \n); print(tdinput type=\file\ name=\image[]\ value=\ . $result[image] . ' size=10 //td' . \n); print(tdEdit: 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] proc_open problems
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); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and FLASH progress bar
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php crash and memory_limit
No solution? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 1 Mar 2004 23:41:36 -0000 Issue 2621
php-general Digest 1 Mar 2004 23:41:36 - 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] -- ---BeginMessage--- 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--- ---BeginMessage--- 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
[PHP] IE6 with latest hotfixes breaks forms ...
We're having a weird problem with some of our PHP forms, where, when a client uses IE6 with the latest hotfixes, they are reporting that have to re-submit a couple of times for it to take ... as if somehow the data isn't being passed down properly to the FORM/ACTION ... We're using sessions to pass the data around, and it seems to work with every other browser we've used, including IE6 previous to the latest hotfixes ... but, could it be something that *we* aren't doing right, or is there a known bug with sessions + IE6? Some sort of work around? Thanks ... Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 7615664 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE6 with latest hotfixes breaks forms ...
--- Marc G. Fournier [EMAIL PROTECTED] wrote: We're having a weird problem with some of our PHP forms, where, when a client uses IE6 with the latest hotfixes, they are reporting that have to re-submit a couple of times for it to take ... as if somehow the data isn't being passed down properly to the FORM/ACTION ... I have heard from numerous sources that the latest patch for IE 6 (released a week or two ago) has a bug that causes it to have trouble sending a proper POST request. I don't have access to a Windows machine to test this myself, but it would be very nice if someone could help pinpoint what circumstances cause this behavior (surely it's not all POST requests). Capturing the raw request from a failed transaction would be a good first step, and you can send me this for interpretation if you like. I'm happy to help. 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP alternative to copy() ?
then use `cp source destination` that should work. raisinlove wrote: 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 -- 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
Re: [PHP] IE6 with latest hotfixes breaks forms ...
On Mon, 1 Mar 2004, Chris Shiflett wrote: --- Marc G. Fournier [EMAIL PROTECTED] wrote: We're having a weird problem with some of our PHP forms, where, when a client uses IE6 with the latest hotfixes, they are reporting that have to re-submit a couple of times for it to take ... as if somehow the data isn't being passed down properly to the FORM/ACTION ... I have heard from numerous sources that the latest patch for IE 6 (released a week or two ago) has a bug that causes it to have trouble sending a proper POST request. I don't have access to a Windows machine to test this myself, but it would be very nice if someone could help pinpoint what circumstances cause this behavior (surely it's not all POST requests). Capturing the raw request from a failed transaction would be a good first step, and you can send me this for interpretation if you like. I'm happy to help. k, I have access to at leaset one box running the latest IE6 ... instructions on how to 'capture the raw request'? Don't mind doing the work, just need to know what work needs to be done ... Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 7615664 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE6 with latest hotfixes breaks forms ...
--- Marc G. Fournier [EMAIL PROTECTED] wrote: I have access to at leaset one box running the latest IE6 ... instructions on how to 'capture the raw request'? It's not easy if you've never used it, but I think the best bet for Windows is Ethereal (http://www.ethereal.com/download.html). You want to capture the HTTP traffic for a request/response scenario that fails. By inspecting the request and identifying the flaw in IE, we might be able to recommend a workaround for people. Also, pinpointing the specific circumstances in which IE fails would be very helpful. Thanks for helping. 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: timer in php-cli
A simple timer: ? $length = 10; $timestart = time(); for (;;) { if (time() = $timestart + 10) { // go } } ? Also, you should look at the PEAR::Net_SmartIRC framework (it has timers already). It's a fantastic framework, and there's really no point in re-writing the textbook. http://pear.php.net/package/Net_SmartIRC -- aidan Nobody [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE6 with latest hotfixes breaks forms ...
Marc: This could be related to the problem I described in detail a few days ago. Here was my solution: http://marc.theaimsgroup.com/?l=php-generalm=107751892631059w=2 Please let us know if this helps! Beau We're having a weird problem with some of our PHP forms, where, when a client uses IE6 with the latest hotfixes, they are reporting that have to re-submit a couple of times for it to take ... as if somehow the data isn't being passed down properly to the FORM/ACTION ... We're using sessions to pass the data around, and it seems to work with every other browser we've used, including IE6 previous to the latest hotfixes ... but, could it be something that *we* aren't doing right, or is there a known bug with sessions + IE6? Some sort of work around? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE6 with latest hotfixes breaks forms ...
Chris, you said you could recreate it ... can you check Beau's solution here to see if it solves the problem we are seeing? Beau's problem appears to have been with 5 and 5.5 also, which I didn't think were causing us problems, but it could also be that nobody reported them also ... On Mon, 1 Mar 2004, Beau Hartshorne wrote: Marc: This could be related to the problem I described in detail a few days ago. Here was my solution: http://marc.theaimsgroup.com/?l=php-generalm=107751892631059w=2 Please let us know if this helps! Beau We're having a weird problem with some of our PHP forms, where, when a client uses IE6 with the latest hotfixes, they are reporting that have to re-submit a couple of times for it to take ... as if somehow the data isn't being passed down properly to the FORM/ACTION ... We're using sessions to pass the data around, and it seems to work with every other browser we've used, including IE6 previous to the latest hotfixes ... but, could it be something that *we* aren't doing right, or is there a known bug with sessions + IE6? Some sort of work around? Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ: 7615664 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adverse performance of undefined variables and indexes?
Howdy Fellow PHPers, I am currently recoding the bulk of my web site network. One major change is that I finally made a proper error handling system. To get right down to it, when you use a custom error handler, PHP ignores the error_reporting level you use. Because of this, all those little undefined variable and undefined index notices I never, well, noticed, will call my handler. Of course my handler is currently set to ignore them but it raises a burning question in my mind: Is it more efficient from a performance standpoint to: a.) Not use a custom error handler and let PHP do nothing with the notice errors other than notice them. b.) User my custom error handler and have it ignore notices. c.) Work empty() and isset() into my scripts ever-so gingerly. ? I wish I knew more about the internals of the Zend Engine, but I assume that in order for PHP to designate something as a notice error, it has to call an internal function. Then it has to check the error handling rules and follow them. In cases a and b this would be routine, along with the added function of my error_handler being called in case b. Case c obviously involves lots of added function calls, as I've mentioned empty and isset, along with many new If statements. In some of my scripts, this could amount to lots of new function calls, however that also means that in cases a and b that means a lot of unnoticed errors. I plan on doing some benchmark tests to see myself, but I'm not particularly good at that stuff. I'm hoping someone here can share any benchmarking they've done or even some theory to this. I'd be particularly delighted if someone with knowledge of the internals could set this straight. I appreciate the help and I realize it is better practice to do case c, but as this code is for my eyes only (and I'm the one who has to redo everything should a 'better practice' become mandatory), I am only concerned with the performance, not the sound practice. - Rob Paxon P.S. (offtopic) Speaking of benchmarking, in case anyone is interested I did some testing on the three string syntaxes (single, double, and hereto) with lots of variables and it seemed to me that using single string quotations is more efficient than the other two. $string = 'Blah blah ' . $blah . ' blah blah'; as opposed to $string = Blah blah $blah blah blah; I'd like to dig deeper into this in the future, with varying amounts of variables per string. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Credit Card validation
Hi, I need to validate credit cards on my web site. So i m looking for information as in what all i need to do / have to implement the card validation . I m running .. Php 4.3.3 Apache 1.3.29 Red Hat Linux 9.0 Any advices are most welcome... Thanks in advance Binay
Re: [PHP] Adverse performance of undefined variables and indexes?
On Tue, 2004-03-02 at 00:19, Rob Paxon wrote: Howdy Fellow PHPers, I am currently recoding the bulk of my web site network. One major change is that I finally made a proper error handling system. To get right down to it, when you use a custom error handler, PHP ignores the error_reporting level you use. Because of this, all those little undefined variable and undefined index notices I never, well, noticed, will call my handler. Of course my handler is currently set to ignore them but it raises a burning question in my mind: Is it more efficient from a performance standpoint to: a.) Not use a custom error handler and let PHP do nothing with the notice errors other than notice them. b.) User my custom error handler and have it ignore notices. c.) Work empty() and isset() into my scripts ever-so gingerly. It's more efficient not to have a custom error handler... when your code fires notices and warnings etc. Well written code won't fire any errors or warnings. Well maintained code won't fire notices. So if you have well written and well maintained code... the overhead is negligible since your error handler will never be used except for the odd notice/warning that you'll be sure to fix if your code is well maintained :) Personally I like to run with E_ALL enabled. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] openssl - extracting public key
Hello, I'm trying to use the openssl function and seem to be having a problem extracting the public key from the keypair generated by openssl_pkey_new. Is there a function to do this in PHP? Here is the sample code. ?php $pubkey = ; $privkey = ; $keypair = ; $privkeyout =; $pubkeyout = ; // Generate a new private (and public) key pair $keypair = openssl_pkey_new(); //openssl_get_publickey expects a mixed certificate parameter // begin problem area $pubkey = openssl_get_publickey($keypair); //end problem area //openssl_get_publickey expects a mixed key $privkey = openssl_get_privatekey($keypair); openssl_pkey_export($privkey, $privkeyout); openssl_pkey_export($pubkey, $pubkeyout); echo Private Keybr; var_dump($privkeyout); echo brPublic Keybr; var_dump($pubkeyout); openssl_free_key($keypair); ? Thanks, Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adverse performance of undefined variables and indexes?
Robert Cummings wrote: It's more efficient not to have a custom error handler... when your code fires notices and warnings etc. Well written code won't fire any errors or warnings. Well maintained code won't fire notices. So if you have well written and well maintained code... the overhead is negligible since your error handler will never be used except for the odd notice/warning that you'll be sure to fix if your code is well maintained :) Personally I like to run with E_ALL enabled. Cheers, Rob. Thanks for the response, but my main question is whether or not it is more efficient to leave the notices or to add the extra functions required to not produce them. Let's say, with the default error handler, would it take more overhead for PHP to evaluate all the extra isset() calls and if statements required to eliminate notices or for all the checking it has to do with the notices there. If it isn't considerably more efficient to leave the notices in, then I'd lean towards the side of good practice and code out possible notice errors as I've already begun doing. Again, thanks for the input. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stumped on a totally wierd problem
When you solve your own problem it is best to post a short synopsis of the solution so that people who search the group later can learn from your mistake. ~phillip jackson Brian V Bonini [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] nevermind I got it. snip I have something really wierd going on with a form that let's a user add/edit/delete data from a mysql database. It's like I can not edit any data that was not recently added or if it was added by another user. If I log into mysql directly under the same user I'm using form the php script and run the same query it's fine. But if I run it form the form it behave like everything is ok but the data is not updated. AND only on old data or data someone else added. If add some data I can for a while edit it all I want from the php script but after a while (like the next day) I can no longer edit it. Goes through all the motions, no error messages, but no updates in the db. Yest, as I said, at the same time I can still edit fresh data so the queries must be fine AND I can edit the data directly. I've never encountered this before so any suggestions It's like the data is tied to a certain session or something. I hope that makes sense. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE6 with latest hotfixes breaks forms ...
--- Marc G. Fournier [EMAIL PROTECTED] wrote: Chris, you said you could recreate it ... can you check Beau's solution here to see if it solves the problem we are seeing? I'm confused. You're the one having this problem, right? Why don't *you* try his solution and tell us if it solves your problem. :-) I don't have a Windows box, so no, I never said I could recreate it. If I could, I'd try to solve the problem instead of asking for HTTP dumps. :-) 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php