RE: [PHP] integrating shipping with shopping cart site - OT
Thanks guys, yes in general we will go with a lookup for each country, it wont be accurate but in future we can build rates for each province / state for each country which an admin would have to complete for each product (time consuming) but for now the solution will work. Thanks for the responses and thoughts, they are much appreciated. I see the UPS class is also quite interesting but its only if you using them :) Cheers Angelo -Original Message- From: Jochem Maas [mailto:joc...@iamjochem.com] Sent: 19 January 2010 04:53 AM To: Angelo Zanetti Cc: 'php-general' Subject: Re: [PHP] integrating shipping with shopping cart site - OT Op 1/18/10 10:47 AM, Angelo Zanetti schreef: Hi all, We are about to start a new project. Custom written shopping cart - quite simple actually. However we have a concern when it comes to calculating the shipping cost for an order. For each product we can determine the base cost based on weight, therefore we can determine the total weight of an order. However we are struggling to determine how to calculate the shipping based on where the delivery is going. In terms of DB and PHP would the best way to calculate it be done by having a list of countries to ship to and a rate for each? Then you can apply the rate to the current order (calculate according to the order weight). Problems arise when shipping to different parts of a country EG: New York vs California (quite far apart). Perhaps we should have a list of cities but that could be massive? I know there is a PHP class / system that integrates with UPS but I don't think the client is going to use UPS. Perhaps you can tell me how you have handled this issue in the past. Apologies if it is slightly off topic but it does still relate to PHP indirectly. I'd start with defining shippingcost 'sets', each defining a number of costs by weight bands, some 'table defs': set: - id name set_bands: -- set_id upper_weightcost then it would be a case of linking (many-to-many relation) 'regions' to sets, if you approach this with a tree of regions you can effectively set values at a continent, country, state/province level ... as such you would only need to relate a 'shippingcostset' to a state if the shippingcosts are different to the given country's shippingcosts. world - north america - california - south america - europe - france - UK then your left with the problem of determining the smallest defined region a given address physically falls into .. using geo-spatial magic in the DB would be one way to do it. this is a hard problem (unless, maybe, the client is willing to sacrifice precision and instead using highly averaged shipping cost definitions to cover the real differences in costs - i.e. a fixed fee for all of europe, whereby such fee is just above the average real cost the client pays for shipping). my guess would be that building such a thing is hard, and would take lots of time ... best bet is to hook into the webservice of whatever shipping company the client intends to use ... even if you have to build your end of the webservice from scratch it will be many factors less hard that building a user-manageable, shipping cost algorythm. - sorry it's all a bit vague, I'm very tired :) my eyes are starting to bleed. Thanks in advance. Angelo http://www.wapit.co.za http://www.elemental.co.za -- 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
[PHP] integrating shipping with shopping cart site - OT
Hi all, We are about to start a new project. Custom written shopping cart - quite simple actually. However we have a concern when it comes to calculating the shipping cost for an order. For each product we can determine the base cost based on weight, therefore we can determine the total weight of an order. However we are struggling to determine how to calculate the shipping based on where the delivery is going. In terms of DB and PHP would the best way to calculate it be done by having a list of countries to ship to and a rate for each? Then you can apply the rate to the current order (calculate according to the order weight). Problems arise when shipping to different parts of a country EG: New York vs California (quite far apart). Perhaps we should have a list of cities but that could be massive? I know there is a PHP class / system that integrates with UPS but I don't think the client is going to use UPS. Perhaps you can tell me how you have handled this issue in the past. Apologies if it is slightly off topic but it does still relate to PHP indirectly. Thanks in advance. Angelo http://www.wapit.co.za http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Form validation and save the form
-Original Message- From: aditya shukla [mailto:adityashukla1...@gmail.com] Sent: 11 January 2010 07:37 AM To: php-general Subject: [PHP] Form validation and save the form Hello Guys, I am trying to validate a form for user input , such that when something is missing load the form again by focusing on the wrong field.Say i don not enter my address so when the form loads everything else is saved and the form points to address field. Thanks Aditya You need Javascript for that not PHP. PHP is server side, javascript is client side (browser). Regards Angelo http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Form validation and save the form
-Original Message- From: aditya shukla [mailto:adityashukla1...@gmail.com] Sent: 11 January 2010 05:03 PM To: Robert Cummings Cc: Angelo Zanetti; php-general Subject: Re: [PHP] Form validation and save the form Thanks for the reply guys.Do you guys know a good resource where i can read from about form validation through PHP.There a lot on google but please suggest something if you guys know. Thanks Aditya I think just do some form validation tutorials (google for them). These will help you to understand the validation process in more detail. Regards Angelo http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Open source project management tool - PHP
Thanks all, for the responses and advice. After much research and trying out we decided to go with: http://www.fengoffice.com/ its PHP based and also uses the EXTJS library. Its got quite a lot of features (calendar, tasks, email, notes, documents, reporting) etc... with a great AJAX interface and good functionality. Regards Angelo http://www.wapit.co.za http://www.elemental.co.za -Original Message- From: Gaurav Kumar [mailto:kumargauravjuke...@gmail.com] Sent: 18 December 2009 10:34 AM To: Robert Cummings Cc: Angelo Zanetti; php-general@lists.php.net Subject: Re: [PHP] Open source project management tool - PHP OK one more the list http://dotproject.net/ Its a nice one with all project management features. Easy to use. Just checkout the website. Gaurav Kumar blog.oswebstudio.com On Fri, Dec 18, 2009 at 12:16 AM, Robert Cummings rob...@interjinn.comwrote: Angelo Zanetti wrote: Hi guys I would like to know what open source project management tools you use for your projects. We are looking at installing one that is PHP based and is easy to use. We have found: http://www.projectpier.org/ and http://trac.edgewall.org/ Has anyone used the above and how did you find them? Also are there any others you would recommend or not recommend and why? I use Mantis for most bug tracking needs. However, I've recently rolled out OpenGoo for a couple of different clients. http://fengoffice.com/web/community/community_index.php Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- 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
[PHP] Open source project management tool - PHP
Hi guys I would like to know what open source project management tools you use for your projects. We are looking at installing one that is PHP based and is easy to use. We have found: http://www.projectpier.org/ and http://trac.edgewall.org/ Has anyone used the above and how did you find them? Also are there any others you would recommend or not recommend and why? Thanks in advance. Regards Angelo http://www.wapit.co.za http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tracking the progress of download
-Original Message- From: Sam [mailto:saminsi...@inbox.ru] Sent: 17 December 2009 08:13 AM To: php-general@lists.php.net Subject: [PHP] Tracking the progress of download Hello to all! Who knows how to track the progress of the download using PHP and JavaScript? I have a script that downloads file from net to the server, and I want to the process including the speed to the clientside. How can I do that? Best regards, Sam Hi Sam, Not sure if its possible but I know that you can perhaps use Ajax to do the upload then they have a percentage indicator. Just google. Regards Angelo http://www.wapit.co.za http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Open source project management tool - PHP
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: 17 December 2009 02:03 PM To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] Open source project management tool - PHP On Thu, 2009-12-17 at 12:24 +0200, Angelo Zanetti wrote: Hi guys I would like to know what open source project management tools you use for your projects. We are looking at installing one that is PHP based and is easy to use. We have found: http://www.projectpier.org/ and http://trac.edgewall.org/ Has anyone used the above and how did you find them? Also are there any others you would recommend or not recommend and why? Thanks in advance. Regards Angelo http://www.wapit.co.za http://www.elemental.co.za If it's open source project management software you're looking for, then I've found openproj and planner to be pretty good. However, I noticed that the links you gave seem to be more focused on task management, which is slightly different from project management. Thanks, Ash http://www.ashleysheridan.co.uk Thanks Ashley, Its not just project managing but I want non technical staff to use the system so we can track progress of tasks and allocate issues / items to people. Anyways thanks for the info on open proj, will check it out. Cheers Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP live chat
-Original Message- From: Ghodmode [mailto:ghodm...@ghodmode.com] Sent: 15 December 2009 09:41 AM To: php-general@lists.php.net Subject: Re: [PHP] PHP live chat I've played around with CraftySyntax LiveHelp, but I haven't deployed it in a production environment. It definitely looks like it's worth a try, though. http://www.craftysyntax.com/ thanks Ghomode, I will have a look at it now. Regards Angelo http://www.elemental.co.za http://www.wapit.co.za On 14/12/09 21:14, Angelo Zanetti wrote: Hi all, I know there are a lot of scripts that one can pay for, for live chat - website support. Are there are any free open source ones that work well? I found: www.phplivechat.com But still waiting to evaluate it. Please send you comments, good or bad and what you would recommend or not recommend and why Thanks in advance. Angelo http://www.wapit.co.za http://www.elemental.co.za -- *Vince Aggrippino* a.k.a. Ghodmode www.ghodmode.com http://www.ghodmode.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP live chat
Hi all, I know there are a lot of scripts that one can pay for, for live chat - website support. Are there are any free open source ones that work well? I found: www.phplivechat.com But still waiting to evaluate it. Please send you comments, good or bad and what you would recommend or not recommend and why Thanks in advance. Angelo http://www.wapit.co.za http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Best ajax library
On Sat, 2009-12-12 at 15:34 +0330, shahrzad khorrami wrote: salam ;) JQuery is good one. Yes I agree with JQuery but you also get JQuery UI (user interface). You can also check out extjs.com. good luck. Angelo http://www.elemental.co.za http://www.wapit.co.za JQuery is good for client-side, did you want something for the server? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: what is php4 popularity?
-Original Message- From: Eric Bauman [mailto:baum...@livejournal.dk] Sent: 08 October 2009 02:39 PM To: php-general@lists.php.net; Paul M. Subject: [PHP] Re: what is php4 popularity? On 8/10/2009 4:28 PM, Paul M. wrote: Hey guys, does anyone have a good link for an article where php4 popularity trends are examined? The best way for me to know php4 % and php5 %. I appreciate any good suggestions. Here's a pretty graph comparing PHP version usage and time: http://www.nexen.net/images/stories/phpversion/200810/evolution.milieu.png Source (French): http://www.nexen.net/chiffres_cles/phpversion/ Thanks for the graph Eric, I know a lot of servers don't support PHP4. but it of course depends on the hosting company. Angelo http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ip-to-country
-Original Message- From: John Black [mailto:s...@network-technologies.org] Sent: 19 October 2009 11:03 AM To: php-general@lists.php.net Subject: Re: [PHP] ip-to-country SED wrote: How can I access an index for IP to a country (or a more detailed location)? I have not yet found a function for that in PHP nor a free to use website that offers a remote search. http://www.hostip.info/ is free, provides a database to download and even allows you to query the database via GET. Downside is that it is not very accurate but it is GPL so it is improved by user and visitors of the site. The most accurate database I have seen so far is the paid database from maxmind.com -- John Thanks for the link John! Angelo http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP live chat
-Original Message- From: Philip Thompson [mailto:philthath...@gmail.com] Sent: 15 December 2009 12:01 AM To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] PHP live chat On Dec 14, 2009, at 2:14 AM, Angelo Zanetti wrote: Hi all, I know there are a lot of scripts that one can pay for, for live chat - website support. Are there are any free open source ones that work well? I found: www.phplivechat.com But still waiting to evaluate it. Please send you comments, good or bad and what you would recommend or not recommend and why Thanks in advance. Angelo We used phplivechat at my last company. I'm pretty sure I was the one who set it up, and I don't remember hating it. It seemed to work pretty reliably and our customers seemed to have enjoyed it. I'd recommend it. ~Philip= Thanks Philip. I will look into it! Regards Angelo http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] tracking forwarded emails using PHP
Hi all, I want to develop a newsletter system, where by users can create newsletters and send them to recipients, that's not a problem. I want to be able to track certain things: 1. When an email is opened. I think this can be done with an img tag where the src is a php script. We can then track when that script is called and from whom. 2. Track if the email was forwarded, not sure how this is done but it should be possible any ideas? I basically need advice on the second point and to know that the first point I am heading in the correct direction. Please send any links if you wish, that will help. Thanks in advance. http://www.elemental.co.za http://www.wapit.co.za http://www.chaperonsa.co.za http://www.tour2africa.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Paging script
Hi All, I am looking for a paging script, not the normal type but slightly different. It must show as follows: 1 2 3 ... 12 Then: 1 ... 678 ... 12 And 1 ... 10 11 12 I have googled and not really found much and don't really want to reinvent the wheel. I am sure I can write my own but due to time constraints ill like to get a script that will assist me. Thanks in advance http://www.wapit.co.za http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Paging script
-Original Message- From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr] Sent: 30 September 2009 12:40 PM To: 'Angelo Zanetti'; php-general@lists.php.net Subject: RE: [PHP] Paging script Sorry but I dont understand what you mean. Can you be more specific? {1} 2 3 ... 12 (Startup / Total 12 pages) When you click 7 1 ... 6 {7} 8 ... 12 When you click 11 or 12 1 ... 10 11 {12} Do you mean something like this? Hi Mert, Yes I mean exactly like you have it there, Regards Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Paging script
_ From: Ruben Crespo [mailto:rumails...@gmail.com] Sent: 30 September 2009 01:23 PM To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] Paging script Hi all, Maybe it is not just what you need but could be helpfull. Here you have the code: //---paginator.php-- -- ?php function paginator ($current, $total, $per_page, $link, $limit) { if ($current == '') { $current = 1; }else{ $current = $current; } $total_pages = ceil($total/$per_page); $previous = $current - 1; $next = $current + 1; /*traduction*/ $toFrom = pPage .$current. of .$total_pages./p; $Goto = Go to Page; $go = Go; $texto = div id='paginacion'.$toFrom. ul; if ($current 1) $texto .= lia href=\$link$previous\laquo;/a/li; else $texto .= liblaquo;/b/li; //Se lista hasta llegar a la posición actual if ($current $limit) { $start = ($current - $limit) + 1; $texto .= lib.../b/li; } else { $start = 1; } for ($start; $start $current; $start++) { $texto .= lia href=\$link$start\$start/a/li; } //mostramos posicion actual $texto .= lib$current/b/li ; //mostramos resto de registros for ($i=$current+1; $i=$total_pages; $i++) { if ($i $limit) { $texto .= lib.../b/li; $i = $total_pages; }else{ $texto .= lia href=\$link$i\$i/a/li ; } } if ($current $total_pages) { $texto .= lia href=\$link$next\raquo;/a/li; }else{ $texto .= libraquo;/b/li; } $texto .= /ul; //a form to go directly to the page you want $texto .= '!--FORMULARIO PAGINADOR-- div id=form_ir form action='.$_SERVER[PHP_SELF].' method=get fieldset p'.$Goto.' input type=text size=3 name=page value= / input type=submit name=ir value='.$go.' //p /fieldset /form /div'; $texto .= 'br class=break / /div '; return $texto; } ? //---paginator.php-- -- //---example.php ?php include (paginator.php); for ($n=0; $n=100; $n++) { $myArray [$n] = $n; } $total = count ($myArray); //the total elements in the array $per_page = 5; //elements the script show $link = example.php?page=; //link $limit = 3; //number of items you show in the paginator list if ($_GET[page]) { $current = $_GET[page]; }else{ $current = $_POST[page]; } $start = ($current-1) * $per_page; $end = $start + $per_page; //call to the paginator function ... echo paginator ($current, $total, $per_page, $link, $limit); //Show the results in different pages for ($i = $start; $i=$end ;$i++) { echo $myArray[$i].br /; } ? //---example.php Thanks ruben very much :-) Regards Angelo http://www.wapit.co.za http://www.elemental.co.za
[PHP] WYSIWYG editor to change textarea
Hi all, I have been looking to implement a WYSIWYG editor that will automatically transform a textarea into a Rich text area / WYSIWYG. We have lots of dynamic content that is pulled from a database and files. Therefore we cant really change the textarea field. I have tried the tinyMCE but its causing conflicts with some existing JS code that cant really be rewritten. A lot of other editors actually generate the rich text area in a strange way and don't use the textarea field at all. Are there any editors that you people will know of that operate in a similar way to tinyMCE, IE you include the JS in your head and it will change all the textarea fields to rich text areas? Thanks in advance. http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SESSIONS lost sometimes - SOLVED
-Original Message- From: Angelo Zanetti [mailto:ang...@zlogic.co.za] Sent: 24 August 2009 04:30 PM To: 'Nitebirdz'; php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes -Original Message- From: Nitebirdz [mailto:nitebi...@sacredchaos.com] Sent: 20 August 2009 02:58 PM To: php-general@lists.php.net Subject: Re: [PHP] SESSIONS lost sometimes On Thu, Aug 20, 2009 at 02:34:54PM +0200, Angelo Zanetti wrote: Hi Leon, No harm intended :) Just thought that people were missing my post now and only answering yours. Angelo, excuse me if I'm bringing up something very basic, but I'm new to this. Just trying to help. I imagine redirects couldn't be the cause of the problem, right? http://www.oscarm.org/news/detail/1877-avoiding_frustration_with_php_session s http://www.webmasterworld.com/forum88/8486.htm Hi thanks for the links it appears that its all in order also I'm not losing SESSIONS on the redirect but somewhere else. I have checked the garbage collection, disk space and other settings in the PHP.ini file. ALL FINE. So now I am really stuck and confused as to what could sometimes cause the loss of these variables and other times it just works fine. Is there possibly a way that I can call some function that will ensure that the sessions are saved (I checked the manual - nothing much). Any other ideas? Anything that you think might be causing issues? Thanks Angelo Hi all, I have solved the issue of lost session variables. It appeared to be losing the SESSION variables when going from a POST from HTTP to HTTPS, however it didn't always happen, so the logging allowed me to narrow down where the losing was occurring. The solution. In my form that I post from the HTTP site, I put a hidden variable in there and with the session variable. In HTTPS it sometimes doesn't carry over the hidden variable therefore we need to start the session with the old SESSION ID from the HTTP site. So what I did was the following on the https site: if (isset($_POST['sessionID'])) { //http://stackoverflow.com/questions/441496/session-lost-when-switching-from -http-to-https-in-php // Retrieve the session ID as passed via the GET method. $currentSessionID = $_POST['sessionID']; //echo $currentSessionID; // Set a cookie for the session ID. $sessionid2 = session_id($currentSessionID); } Therefore setting the session ID with the session_id() function. This must go before the session_start() function!!! Very NB!. Hope this helps anyone who has a similar problem. Regards Angelo http://www.elemental.co.za http://www.wapit.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SESSIONS lost sometimes
-Original Message- From: Nitebirdz [mailto:nitebi...@sacredchaos.com] Sent: 20 August 2009 02:58 PM To: php-general@lists.php.net Subject: Re: [PHP] SESSIONS lost sometimes On Thu, Aug 20, 2009 at 02:34:54PM +0200, Angelo Zanetti wrote: Hi Leon, No harm intended :) Just thought that people were missing my post now and only answering yours. Angelo, excuse me if I'm bringing up something very basic, but I'm new to this. Just trying to help. I imagine redirects couldn't be the cause of the problem, right? http://www.oscarm.org/news/detail/1877-avoiding_frustration_with_php_session s http://www.webmasterworld.com/forum88/8486.htm Hi thanks for the links it appears that its all in order also I'm not losing SESSIONS on the redirect but somewhere else. I have checked the garbage collection, disk space and other settings in the PHP.ini file. ALL FINE. So now I am really stuck and confused as to what could sometimes cause the loss of these variables and other times it just works fine. Is there possibly a way that I can call some function that will ensure that the sessions are saved (I checked the manual - nothing much). Any other ideas? Anything that you think might be causing issues? Thanks Angelo -- 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] SESSIONS lost sometimes
-Original Message- From: Ben Dunlap [mailto:bdun...@agentintellect.com] Sent: 19 August 2009 08:18 PM To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] SESSIONS lost sometimes We have a server with a site that does some XML calls. After lots of testing I have found that the server is losing session variables. [8] Also the site goes from HTTP to HTTPS at some point but this isn't the issue as it loses the sessions as soon as they are set sometimes. Therefore I would like to know what I could check. I have read in other Can you clarify what you mean by losing sessions? Have you taken a network trace to see whether the client is consistently sending the session ID with every request? When the problem happens, is $_SESSION completely empty or is it only missing some variables? Does it seem to happen on any page, or only certain ones? Thanks, Ben Hi Ben, When the problem happens the $_SESSION is partially empty. It only has the some of the variables set. It happens on a certain page only, but the strange thing is that it never happened before its only happening now. But the code hasn't changed so is it safe to assume that it's a server issue? Thanks Angelo -- 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] SESSIONS lost sometimes
Hi Leon and all. LEON you are misunderstanding how the sessions work. Also please start your own thread and don't hijack mine. To the rest that replied. Thanks, I am still stuck with the problem I have asked the hosting company to check the storage capacity and also any other issues with the SESSIONS on the server. However if anyone has other things they think I can look at, I'd appreciate that very much. Thanks Angelo http://www.elemental.co.za -Original Message- From: Leon du Plessis [mailto:l...@dsgnit.com] Sent: 20 August 2009 12:04 PM To: a...@ashleysheridan.co.uk Cc: 'Nitebirdz'; php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes Thanks Ashley, I just want to iterate again that when a new page is opened by another existing page in a new browser or Tab, the session_id is already created and therefore the current way browsers work is in no way compremised. The new browser/tab would receive the session id along with GET or POST variables. What I am suggesting/hoping is that when a new browser is opened or a new tab is opened via the application, the protocols would reckognize that this is the first time the page is served and is not being called from another page. That is, a new page is loaded by the user entering it, and NOT by clicking login or some other link from an existing page. Yes, I know..that creates other scenarios, so is happy to not meddle with the way browsers work. It is just a limitation I will live with and can get by with it. Regards Leon -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: 20 August 2009 11:39 AM To: Leon du Plessis Cc: 'Nitebirdz'; php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes On Thu, 2009-08-20 at 10:50 +0200, Leon du Plessis wrote: It'd make sense for things to run this way, I think. After all, I'd find it quite confusing if I log into Google Docs, open a document (by default, it opens in a new tab) and I had to log in yet again to be able to edit it. Yes. I agree. But in this case the Tab being opened is used with the same authentication details either via POST, GET or Cookie variables. The problem comes in when a totally different set of login credentials are being used (for the same tab/window). Other user's login particulars should not affect your login variables. -Original Message- From: Nitebirdz [mailto:nitebi...@sacredchaos.com] Sent: 20 August 2009 10:40 AM To: php-general@lists.php.net Subject: Re: [PHP] SESSIONS lost sometimes On Thu, Aug 20, 2009 at 09:44:02AM +0200, Leon du Plessis wrote: Since we are on the subject: I have the following similar problem: When testing page on internet explorer, I find that one tab's variables can affect another tab's variables. Thus when having the same web-site open and using SESSION variables but for different users, Internet explorer can become disorientated. This also sometimes happen when I have two separate browsing windows open with Internet Explorer for the same site. I have yet to determine if this is an internet explorer, or PHP or combination of the two that is causing this condition. To my understanding _SESSION variables should be maintained per session, tab or window. If this has been addressed already, my apologies, but thought it worthwhile to mention. I'm a total newbie when it comes to these issues, but it seems to me that Firefox behaves in the very same manner. It's not limited to PHP sessions either. It's always been my experience on any website that requires authentication, including the likes of Google Mail, etc. When I want to run multiple sessions for different GMail accounts, for example, I just create a different user profile in Firefox. It'd make sense for things to run this way, I think. After all, I'd find it quite confusing if I log into Google Docs, open a document (by default, it opens in a new tab) and I had to log in yet again to be able to edit it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The point is you are misunderstanding how browsers work. What the server app is seeing is a new login that replaces the first. This is the way browsers work, and if it changed to the idea you have for it, then millions of sites would suddenly fail to work; i.e. any site that requires a new tab or window to be opened in order to function, like banks, etc. Thanks, Ash http://www.ashleysheridan.co.uk -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SESSIONS lost sometimes
Hi Leon, No harm intended :) Just thought that people were missing my post now and only answering yours. Anyways hope your issue got resolved. Angelo -Original Message- From: Leon du Plessis [mailto:l...@dsgnit.com] Sent: 20 August 2009 01:46 PM To: php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes Hi Angelo, No need to be nasty and touchy. If you have done trouble to read I have closed the discussion in a prior listing and referred back to your original thread. thanks -Original Message- From: Angelo Zanetti [mailto:ang...@zlogic.co.za] Sent: 20 August 2009 01:21 PM To: 'Leon du Plessis'; a...@ashleysheridan.co.uk Cc: 'Nitebirdz'; php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes Hi Leon and all. LEON you are misunderstanding how the sessions work. Also please start your own thread and don't hijack mine. To the rest that replied. Thanks, I am still stuck with the problem I have asked the hosting company to check the storage capacity and also any other issues with the SESSIONS on the server. However if anyone has other things they think I can look at, I'd appreciate that very much. Thanks Angelo http://www.elemental.co.za -Original Message- From: Leon du Plessis [mailto:l...@dsgnit.com] Sent: 20 August 2009 12:04 PM To: a...@ashleysheridan.co.uk Cc: 'Nitebirdz'; php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes Thanks Ashley, I just want to iterate again that when a new page is opened by another existing page in a new browser or Tab, the session_id is already created and therefore the current way browsers work is in no way compremised. The new browser/tab would receive the session id along with GET or POST variables. What I am suggesting/hoping is that when a new browser is opened or a new tab is opened via the application, the protocols would reckognize that this is the first time the page is served and is not being called from another page. That is, a new page is loaded by the user entering it, and NOT by clicking login or some other link from an existing page. Yes, I know..that creates other scenarios, so is happy to not meddle with the way browsers work. It is just a limitation I will live with and can get by with it. Regards Leon -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: 20 August 2009 11:39 AM To: Leon du Plessis Cc: 'Nitebirdz'; php-general@lists.php.net Subject: RE: [PHP] SESSIONS lost sometimes On Thu, 2009-08-20 at 10:50 +0200, Leon du Plessis wrote: It'd make sense for things to run this way, I think. After all, I'd find it quite confusing if I log into Google Docs, open a document (by default, it opens in a new tab) and I had to log in yet again to be able to edit it. Yes. I agree. But in this case the Tab being opened is used with the same authentication details either via POST, GET or Cookie variables. The problem comes in when a totally different set of login credentials are being used (for the same tab/window). Other user's login particulars should not affect your login variables. -Original Message- From: Nitebirdz [mailto:nitebi...@sacredchaos.com] Sent: 20 August 2009 10:40 AM To: php-general@lists.php.net Subject: Re: [PHP] SESSIONS lost sometimes On Thu, Aug 20, 2009 at 09:44:02AM +0200, Leon du Plessis wrote: Since we are on the subject: I have the following similar problem: When testing page on internet explorer, I find that one tab's variables can affect another tab's variables. Thus when having the same web-site open and using SESSION variables but for different users, Internet explorer can become disorientated. This also sometimes happen when I have two separate browsing windows open with Internet Explorer for the same site. I have yet to determine if this is an internet explorer, or PHP or combination of the two that is causing this condition. To my understanding _SESSION variables should be maintained per session, tab or window. If this has been addressed already, my apologies, but thought it worthwhile to mention. I'm a total newbie when it comes to these issues, but it seems to me that Firefox behaves in the very same manner. It's not limited to PHP sessions either. It's always been my experience on any website that requires authentication, including the likes of Google Mail, etc. When I want to run multiple sessions for different GMail accounts, for example, I just create a different user profile in Firefox. It'd make sense for things to run this way, I think. After all, I'd find it quite confusing if I log into Google Docs, open a document (by default, it opens in a new tab) and I had to log in yet again to be able to edit it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The point is you are misunderstanding how browsers work. What the server app is seeing
[PHP] Extract an element from XML
Hi all, I have the following segment of XML: BookingReference ReferenceSource=api165432 /BookingReference Now I want to get the value of the BookingReference where the ReferenceSource = api. In other words I want to get the value 165432. I have the following code: $ItemConfirmationReference2 = $xpath-query('BookingReference ReferenceSource' , $Element); $ItemConfirmationReference = trim($ItemConfirmationReference2-item(0)-textContent); The $Element variable passes the node that contains the BookingReference node. The tricky part for me is the =api part. Thanks in advance. A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Object of class could not be converted to string
Dear all, We are experiencing this error: Object of class xxxClass could not be converted to string I have searched google a lot mostly the results are for Drupal or badly coded sites. I have further found out that the issue is with PHP 5.2 version. There isn't a problem with the script as it works on other servers with prior versions, so I am wondering if any one has any tips or ways to go about this error. Unfortunately we are in a position whereby we cant downgrade PHP as it's a shared hosted server. Any help will be appreciated. Thanks, Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forms validation and creation- easier solution?
-Original Message- From: Manuel Lemos [mailto:mle...@acm.org] Sent: 22 May 2009 09:56 To: Paul M Foster Cc: php-general@lists.php.net; Angelo Zanetti Subject: Re: [PHP] Forms validation and creation- easier solution? Hello, on 05/20/2009 11:09 AM Paul M Foster said the following: Both this class and Manuel Lemos' form generation class (from phpclasses.org) will create beautiful forms for you. However, you may find that the amount of [repetitive] typing you do will be equivalent or greater than simply creating the form by hand. The best solution would probably be a form you fill out which asks you about all the fields you want, and then generates the code to paint the form. There are commercial solutions which do this, and some (not that great) free solutions. I'm working on one myself, which will eventually be a sourceforge/freshmeat project. Thank you for mentioning my package, but I am not sure what you mean. The Forms Generation and Validation package seems to do exactly what you describe and more. IMHO, creating forms by hand is by no means simpler, especially if you want to include browser side (Javascript) validation. I mean, I am not masochist to create something that will give me more work in the end to develop PHP forms based applications than if I would type HTML manually. Furthermore, the plug-ins that come with the package dramatically reduce the amount of code you need to type to achieve the same generating common HTML inputs manually. Anyone can judge by yourself by going here and see several example forms and the actual code that it takes to generate them: http://www.meta-language.net/forms-examples.html For instance this scaffolding plug-in generates CRUD forms that you often need to manage data stored for instance in databases. http://www.meta-language.net/forms-examples.html?example=test_scaffolding_in put For those interested to check it out, the actual class package can be downloaded from here: http://www.phpclasses.org/formsgeneration Here you may watch an extensive tutorial video that covers practically all features: http://www.phpclasses.org/browse/video/1/package/1.html Thanks manuel. I will check out the class. Much appreciated your response. Thanks Angelo Elemental http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forms validation and creation- easier solution?
Hi all. We have done quite a few projects and we are looking to find better ways to implementing forms. Forms seem to be quite time consuming and repetitive. Generally are there any classes or libraries that will assist with: 1. Easy creation of forms (fields and layout) 2. Validation of specific fields within the forms (server side not JS) 3. Decrease in time required to setup the forms pages any other comments are welcome. Thanks in advance Angelo Elemental http://www.elemental.co.za http://www.elemental.co.za/ Dynamic Web and Mobile Solutions
RE: [PHP] Forms validation and creation- easier solution?
_ From: Olexandr Heneralov [mailto:ohenera...@gmail.com] Sent: 20 May 2009 09:08 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] Forms validation and creation- easier solution? Hi! Zend framework has a wonderful solution to solve this task. You can download even the demo showing how to do this task Best regards, Alex. Thanks Alex. But would that mean that I need to implement the entire Framework or can I just use the class to incorporate into our new projects (bespoke applications - custom developed). Looking forward to your reply! Angelo 2009/5/20 Angelo Zanetti ang...@zlogic.co.za Hi all. We have done quite a few projects and we are looking to find better ways to implementing forms. Forms seem to be quite time consuming and repetitive. Generally are there any classes or libraries that will assist with: 1. Easy creation of forms (fields and layout) 2. Validation of specific fields within the forms (server side not JS) 3. Decrease in time required to setup the forms pages any other comments are welcome. Thanks in advance Angelo Elemental http://www.elemental.co.za http://www.elemental.co.za/ Dynamic Web and Mobile Solutions
RE: [PHP] Forms validation and creation- easier solution?
-Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: 20 May 2009 16:09 To: php-general@lists.php.net Subject: Re: [PHP] Forms validation and creation- easier solution? On Wed, May 20, 2009 at 10:08:12AM +0300, Olexandr Heneralov wrote: 2009/5/20 Angelo Zanetti ang...@zlogic.co.za Hi all. We have done quite a few projects and we are looking to find better ways to implementing forms. Forms seem to be quite time consuming and repetitive. Generally are there any classes or libraries that will assist with: 1. Easy creation of forms (fields and layout) 2. Validation of specific fields within the forms (server side not JS) 3. Decrease in time required to setup the forms pages any other comments are welcome. Hi! Zend framework has a wonderful solution to solve this task. You can download even the demo showing how to do this task Best regards, Alex. Both this class and Manuel Lemos' form generation class (from phpclasses.org) will create beautiful forms for you. However, you may find that the amount of [repetitive] typing you do will be equivalent or greater than simply creating the form by hand. The best solution would probably be a form you fill out which asks you about all the fields you want, and then generates the code to paint the form. There are commercial solutions which do this, and some (not that great) free solutions. I'm working on one myself, which will eventually be a sourceforge/freshmeat project. Hi Paul. This sounds Great. Thanks for the advise. Just as a matter of interest do you know the location / path to Jay's class? I tried searching the archives but couldn't find it/ Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Extract code from XML
_ Hi all, I have the following snippet of XML: Code: HotelDetails Hotel HasExtraInfo=true HasMap=true HasPictures=true Item Code=AME![CDATA[ AMERICAN ]]/Item I need to get the Code for the item, IE get the value AME from the XML. I am using PHP5 and the following code which I can extract the value of the Item: AMERICAN. PHP Code: $hotelElements = $xpath-query( 'HotelDetails/Hotel', $searchHotelPriceReponseElement ); foreach( $hotelElements as $hotelElement ) { $item = $xpath-query( 'Item' , $hotelElement ); I know you can use an @ sign but I am not 100% sure. Thanks in advance. Kind regards, Angelo Zanetti Application Developer _ Telephone: +27 (021) 552 9799 Mobile: +27 (0) 72 441 3355 Fax:+27 (0) 86 681 5885 Web: http://www.elemental.co.za E-Mail: ang...@elemental.co.za
RE: [PHP] Extract code from XML
-Original Message- From: Per Jessen [mailto:p...@computer.org] Sent: 30 January 2009 11:53 To: php-general@lists.php.net Subject: Re: [PHP] Extract code from XML Angelo Zanetti wrote: Hi all, I have the following snippet of XML: Code: HotelDetails Hotel HasExtraInfo=true HasMap=true HasPictures=true Item Code=AME![CDATA[ AMERICAN ]]/Item I need to get the Code for the item, IE get the value AME from the XML. I am using PHP5 and the following code which I can extract the value of the Item: AMERICAN. PHP Code: $hotelElements = $xpath-query( 'HotelDetails/Hotel', $searchHotelPriceReponseElement ); foreach( $hotelElements as $hotelElement ) { $item = $xpath-query( 'Item' , $hotelElement ); I know you can use an @ sign but I am not 100% sure. Yes, you use an '@' to retrieve attributes of an element. query( 'HotelDetails/Hotel/@Code' Thanks Per but I didn't send all the XML but you see that there is a city code and an item code: Hotel HasExtraInfo=true HasMap=true HasPictures=true Recommended = true City Code=AMS![CDATA[ Amsterdam ]]/City Item Code=AME![CDATA[ AMERICAN ]]/Item How would I get the Item code then? Based on your answer above? Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Last working day of a month
Hi all, I am busy trying to figure out how to get the last working day in a month. I was wondering if there was a script already written, but this is what I imagine should work: Get the current day and see if it's the last day of the month. If its true check if it's a Saturday or Sunday if it's either of those 2 days then return false else return true? I also need to take public holidays into account. What would be the best solution for that? Store the public holidays in a table and check if the current day isn't a public holiday? Any advice is appreciated. TIA Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading XML
Hi all, I have a script that I call with CURL and get an XML response with a few parameters. I need to be able to read that XML but not sure how to. I know of simpleXML but the server is php4. Would xml_parse be the thing to look at? What is the simplest way to accomplish this small challenge? Thanks in advance.
[PHP] Sending out mass emails
Hi all, We would like to send out mass emails for some of our clients, these are HTML email and text alternative for the email clients that cant read those HTML emails. We have developed some scripts to send the emails using phpmailer. Now we anticipate sending emails in batches but not sure how many at once. Also what is the best way about going around being black listed due to spam issues. I know that the headers need to be set to avoid being detected as spam. Any advice is appreciated. Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading file outside WEB Root
Hi All, For security purposes I would like to upload a file outside the webroot. I have got this to work on my local dev machine but it doesn't seem to work on the live server. I have tried both the relative path and also the full path (from the $_SERVER[DOCUMENT_ROOT] variable). Now I can't get the upload to work and have no idea what the problem could be. I have also set the permissions of the folder, so that can't be a problem. Could it be a problem with server hosting restrictions? Or maybe the server is setup for virtual hosting? Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SOLVED]RE: [PHP] restricted file access
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 28 August 2008 21:19 To: php-general@lists.php.net Subject: RE: [PHP] restricted file access At 10:50 AM +0200 8/28/08, Angelo Zanetti wrote: Thanks for your reply. But what happens if the file is situated here: www.site.com/include/documents/file.doc and someone knows that path file somehow or they get a program to crawl the site. Then they would be able to get that file. How do we prevent that? You don't! But file.doc doesn't have to be anything either. Try this: http://sperling.com/file.doc -- you won't find anything there. However, if I wanted something to be there for someone, I could put it there. Understand? // Hi guys I put the documents outside the webroot. And just redirect to it using the Headers and then the readfile() function. Thanks Angelo http://www.elemental.co.za Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- 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] restricted file access
Thanks for your reply. But what happens if the file is situated here: www.site.com/include/documents/file.doc and someone knows that path file somehow or they get a program to crawl the site. Then they would be able to get that file. How do we prevent that? Thanks in advance. -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 27 August 2008 17:29 To: php-general@lists.php.net Subject: Re: [PHP] restricted file access At 4:13 PM +0200 8/27/08, Angelo Zanetti wrote: Hi all, We have a site and we have created an admin section where the admin can upload documents. We have made a user login section where they can view a list of the documents (from the DB) and download the file. We want to make the site however not allow ppl to type in the path of the document and retrieve the file. How is this accomplished? Are the documents stored in a hidden / non-web accessible directory? Or is this restricted with APACHE? Please advise Well...none of the above. I would have a php script deliver the files and not allow the user to see the path. Here's an example: http://php1.net/b/file-browser/index.php It would be a simple matter not to show the path but rather just show what's available to the user and then let the php script deliver the product to the user via a common url, like the demo does. In other words, the most that any user can get is the path to one spot where your script deposits the file for download. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- 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
[PHP] restricted file access
Hi all, We have a site and we have created an admin section where the admin can upload documents. We have made a user login section where they can view a list of the documents (from the DB) and download the file. We want to make the site however not allow ppl to type in the path of the document and retrieve the file. How is this accomplished? Are the documents stored in a hidden / non-web accessible directory? Or is this restricted with APACHE? Please advise Thanks in advance. Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newsletter code
Hi All, I have a question related to newsletter subscriptions to websites as well as sending out of the newsletters. Here is the scenario: Client wants a subscribe to newsletter dialog on website, typically just an email address. Then in his admin section he wants to send out HTML newsletters/plain text depending on the user's email client. Now how would I go about creating the newsletter in the backend? Using a WSIWIG editor? Or is there some code that you guys use as there are also things to consider such as: -bulk mailing, instead of sending many mails at once. Rather send out some scheduled emails -Plain text vs HTML email Etc... What do you guys use if you are building a custom web app? I have seen Webinsta before it works well but it's a separate system. Let me know, Thanks Kind regards Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading big files with PHP
Hi all We are pitching to develop a website where the admin has to upload big video files but I'm not sure how this can be done as the file upload will most probably time out. How do current websites do it? Is there somehow a way to make use of FTP to transfer the files? Any links, help, advice will be appreciated. Thanks in advance Angelo http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uploading big files with PHP
-Original Message- From: Thijs Lensselink [mailto:[EMAIL PROTECTED] Sent: 25 July 2008 12:08 To: php-general@lists.php.net Subject: Re: [PHP] uploading big files with PHP Quoting Angelo Zanetti [EMAIL PROTECTED]: Hi all We are pitching to develop a website where the admin has to upload big video files but I'm not sure how this can be done as the file upload will most probably time out. How do current websites do it? Is there somehow a way to make use of FTP to transfer the files? Any links, help, advice will be appreciated. Thanks in advance Angelo http://www.elemental.co.za Uploading big files should not be a problem. Make sure the some .ini settings are correct for you: max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data max_input_nesting_level = 64 ; Maximum input variable nesting level ; Maximum size of POST data that PHP will accept. post_max_size = 8M The first 3 you can set with ini_set. You could of course use the ftp functionality available in PHP. http://nl3.php.net/ftp - Thanks Thijs, It does make sense to change the post_max_size value. But what if the file is for example a 100MB file or bigger. This probably isn't the best way to handle this? I'm trying to find the best practices to do this or is this totally the wrong way to go about this? Thanks again! Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DB search and case sensitive comparison
Hi all, I have a question and I can't seem to get around the problem or finding a total solution. I have a DB with a list of entries, one of the tables has fields and one of the fields is called the lookup_string field. This field is used to checkup values when users enter the site (explained below). So basically what happens is that the user will enter the site and I will get their user agent from the $_SERVER variable. What I want to do is to find out which entries in the DB are present in the useragent string. Eg: lookup_string (in db): Mozilla useragent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15' So what I did was I used the locate function in my mysql query which gives me the correct result set. Now what I need to do is to ensure that the lookup_string is in the useragent string and the CASE is the same: IE: Mozilla and not MOZILLA or mozilla etc... I am using the following If (however it fails because its part of the useragent string and not the whole complete string therefore providing a mismatch). if(strcmp($userAgent, $lookup_string)==0){ //matches } Else { //doesn't match } Which way could I accomplish searching for the lookup_string in the useragent and that it's the correct case? Thanks in advance. Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SCanning text of PDF documents
Hi All. This is a quick question. A client of ours wants a solution that when a PDF document is uploaded that we use PHP to scan the documents contents and save it in a DB. I know you can do this with normal text documents using the file commands and functions. Is it possible with PDF documents? My feeling is NO, but perhaps someone will prove me wrong. Thanks in advance. Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] AI file and mapping with PHP
Hi Guys, We have a project where by we have a map in ai format (vector format). What we want to do is to programmatically come up with a solution that say on the map there is a restaurant at a certain location, that we can zoom into the map on that specific area. I really am not sure where to start. I guess image maps arent going to work are they? Should I be using the GD library for manipulating the images and doing zooming? Also will the ai format be supported? Please guys, any tips, links or help is appreciated. TIA Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] AI file and mapping with PHP
_ From: Aschwin Wesselius [mailto:[EMAIL PROTECTED] Sent: 07 May 2008 12:21 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] AI file and mapping with PHP Angelo Zanetti wrote: Hi Guys, We have a project where by we have a map in ai format (vector format). What we want to do is to programmatically come up with a solution that say on the map there is a restaurant at a certain location, that we can zoom into the map on that specific area. I really am not sure where to start. I guess image maps arent going to work are they? Should I be using the GD library for manipulating the images and doing zooming? Also will the ai format be supported? Hi Angelo, I can't find anywhere what this is about? Is it a web based solution? Is it an desktop application? Is it console based? Hi Aschwin, Yes it will be a web based solution. Thanks Angelo
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Ford, Mike [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 12:25 To: php-general@lists.php.net Subject: RE: [PHP] FRench characters not displayed correctly On 17 April 2008 10:05, Robert Cummings advised: On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 ,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. Er, no, that's what kind of content the browser is prepared to accept back from the server -- the headers starting from the GET line are what the browser sends to the server as part of the request. The lines starting at the HTTP/1.x line are what the server returns. In this case, you're getting a 304 Not Modified, which means the server is not even serving any content on this request, nor, probably, even a full set of headers -- it's just telling the browser it can use its cached page. To be absolutely sure what the relevant headers are, you need to force the server to send the full page -- usually, the best way to do this is to hold down the Ctrl key whilst clicking the Refresh/Reload button. Incidentally, I notice that what's being served here is a .html page, and the presence of a 304 response, and no PHP headers, suggests it actually is plain HTML, and not a disguised script, so this whole thread is really very OT...!! ;) However, this being the case, it suggests you have a static .html file on your site claiming to be charset=utf-8, but not saved in UTF-8! There are two obvious ways to solve this: (i) convert the file into UTF-8, or (ii) edit it to have the correct charset= value in the tag. -- Mike, thanks very much I have done a ctrl+F5 And have the following: -- http://fr.x.com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html HTTP/1.1 Host: fr.x.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr.xx.com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=5d5af707c9c34205d30708326872ad27 Pragma: no-cache Cache-Control: no-cache HTTP/1.x 200 OK Date: Thu, 24 Apr 2008 08:34:10 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Last-Modified: Sat, 17 Nov 2007 11:40:26 GMT Etag: 6b97e-a9d-619b9e80 Accept-Ranges: bytes Content-Length: 2717 Keep-Alive: timeout=15, max=198 Connection: Keep-Alive Content-Type: text/html I can now see that the response is a 200 OK response. So basically to get these pages to serve the French characters correctly would I need to do the following: (i) convert the file into UTF-8, or (ii) edit it to have the correct charset= value in the tag. When you refer to charset are you referring to: iso-8859-1 or UTF-8? (iii) Also would I need to send the PHP headers as follows: header( 'Content-type: text/html; charset=iso-8859-1' ); (iv) Also does the fact that there is no DOCTYPE declaration have any impact on the showing of the French characters? Anyone who feels like that are able to comment on the above please assist, as it is greatly appreciated. Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] French character string encoding
Hi all, If I have the following French character : #65533; And I want to display it properly, IE: how it is meant to be displayed as the proper french character, which encoding do I need to use? Or is there a string function which can convert this to the correct character? Thanks in advance. Angelo Zanetti Application Developer : Telephone: +27 (021) 552 9799 Mobile: +27 (0) 72 441 3355 Fax:+27 (0) 86 681 5885 Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] French character string encoding
-Original Message- From: Per Jessen [mailto:[EMAIL PROTECTED] Sent: 24 April 2008 18:26 To: php-general@lists.php.net Subject: Re: [PHP] French character string encoding Angelo Zanetti wrote: Hi all, If I have the following French character : #65533; And I want to display it properly, IE: how it is meant to be displayed as the proper french character, which encoding do I need to use? Or is there a string function which can convert this to the correct character? Your #65533; didn't display properly at all - I tried ISO-8859-1 and UTF8. /Per Jessen, Zürich Hi Per thats the problem I am having, this is how data from a project I inherited is saved in the DB and I cant get it to show. However I get normal data eg: ème est très haute. To show if its saved like that in the DB, I just do: echo utf8_encode(ème est très haute.); and it works well. Is there anyway you think I can get the data in the DB to format correctly perhaps using some sort of string command? Thanks for your help again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FRench characters not displayed correctly
Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? I have seen that there is no DOCTYPE declaration, could this be the problem if this is omitted? If you have any suggestions, please let me know. TIA. Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Angelo Zanetti [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 09:48 To: php-general@lists.php.net Subject: [PHP] FRench characters not displayed correctly Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? I have seen that there is no DOCTYPE declaration, could this be the problem if this is omitted? If you have any suggestions, please let me know. TIA. Angelo Web: http://www.elemental.co.za I have also found that we can do this: html lang=fr But I am interested in finding out if the doctype declaration is a contributing factor. Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 10:38 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] FRench characters not displayed correctly On Thu, 2008-04-17 at 09:47 +0200, Angelo Zanetti wrote: Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? You certainly wouldn't want both utf-8 and iso-8859-1 declared at the same time. It sounds like what you want is iso-8859-1 and NOT utf-8. Check the encoding of either your files or your database content. Also check what headers PHP is sending to the browser. If you're using Firefox you can check the page info to see what charset it thinks it received. Cheers, Rob. -- Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? What else should I be checking for? Could it be a PHP problem where PHP isn't decoding the characters properly? Thanks again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 11:05 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: RE: [PHP] FRench characters not displayed correctly On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. You want the following somewhere near the beginning of your script: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? Cheers, Rob. - Thanks again, but as far as I have read, it seems that UTF-8 has better handling for French characters? We have the following in our HTML page: meta http-equiv=Content-Type content=text/html;charset=utf-8 Would the header not conflict with this meta tag? Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic dropdown lists (select)
Hi all, I am looking at options for creating a dynamic dropdown list. Ok here is the scenario: All values in the dropdown list (select/option field) are coming from the database. So there will be 2 dropdown lists. First one say gets (for example) a list of cars, Then once the car is choosen the second list is populated with the list of models for the car choosen. I would like to know if its possible to do this without posting as well as without the use of JS. I have seen js examples where the values are all stored in arrays. This is not desireable as I will be getting the values from the the DB using PHP, unless I can write the JS values to the arrays using PHP? Also not sure of that. Is there any other idea or thing I can do? Im thinking maybe AJAX but this is for a mobile site (WAP/xHTML) site and Im not sure if the functionality will work on these devices. Please advise. Thanks in advance Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: SESSION Array problem - possibly different PHP versions?
-Original Message- From: Al [mailto:[EMAIL PROTECTED] Sent: 10 March 2008 18:23 To: php-general@lists.php.net Subject: [PHP] Re: SESSION Array problem - possibly different PHP versions? Put a print_r($_SESSION) at the top and bottom of your page code so you can see what's happening. Also check your code that updates the session assignment by the GET value. It appears your code maybe unset()ing the session assignments. Are you using Cookies? If so, check this code carefully as it can cause non obvious things depending on whether the client machine has cookies enabled or disabled. - Thanks will do so going to check the unset() as well as the print_r at top and bottom, also I am not using cookies hope to get this sucker working. Will keep you posted. Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SESSION Array problem - possibly different PHP versions?
Hi All, I have a problem that only occurs on our live server and not our local server. It works fine locally. Basically I am using a session array to store values of product colours. A user can add colours to the session array. The session is defined as follows: $_SESSION['color'][$counter] = $color; Obviously the first time we validate and the $counter is set to 0. When more colours are added the $counter variable increments and should increment the value of the array. The colours are added through a popup window. Before I open the popup window I print_r($_SESSION['color']) to view the contents of the array and make sure that they are valid and it is an array. Output is as follows: [color] = Array ( [0] = #339933 [1] = #00 ) etc... Then once the popup opens I do the same print_r And it now shows: [color] = #339933 There fore it isn't an array of colors within the session array. How can PHP change this? Also the strange thing is that locally it works fine but not live. So I am guessing that there is a problem with a certain version of PHP? Also Im not sure what else could be causing this problem? Any ideas or hints would be appreciated. Thanks Kind regards, Angelo Zanetti Application Developer Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SESSION Array problem - possibly different PHP versions?
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: 10 March 2008 16:04 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] SESSION Array problem - possibly different PHP versions? On Mon, Mar 10, 2008 at 9:22 AM, Angelo Zanetti [EMAIL PROTECTED] wrote: There fore it isn't an array of colors within the session array. How can PHP change this? Also the strange thing is that locally it works fine but not live. So I am guessing that there is a problem with a certain version of PHP? From where is the color data coming in to the script, a database? Check to make sure that the array is being populated. Also, you're not attempting to pass the session from your dev box to your live box, are you? Hi Daniel, thanks for the reply. The system works as follows. There is a colour picker, when a user clicks on a colour then it opens a popup window with the color set as a GET variable. They can then enter the price per colour etc... once done, they save it. It then saves the details to a session. The user then closes the window and it refreshes the parent page which has the colour picker and a listing of selected colours already choosen, after the refresh it shows the array values (print_r) and is correct the first time: [color] = Array ( [0] = #339933 Then if they do the same procedure again, once the popup opens it shows the session variable as: [color] = #339933 But nothing has been done to the SESSION variables since the save, so somehow between the the click and the popup opening something strange is happening. Like I mentioned it works on a local laptop as well as our local server so its strange, I have tried many times closing the browser to ensure all sessions are cleared. Any ideas what might be causing this error? Thanks very much -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Logging session timeout in DB
Thanks Daniel, this is a good solution, I will implement it and get it working! Cheers Angelo -Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: 05 March 2008 20:37 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] Logging session timeout in DB On Wed, Mar 5, 2008 at 3:08 AM, Angelo Zanetti [EMAIL PROTECTED] wrote: [snip!] No what I would like to know is how can I record when a user closes the browser or the session expires? There is no action for these items. So what would the best way be to keep a record of this? Would the use of a cron job be appropriate? I read in the archives that the banks use javascript but I don't want to go that route. One way that comes to mind right off the bat would be to utilize an idea similar to the following. You'll need to secure it and tailor it to your own needs, but it should point you in the right direction. ? // Place this function in a file that's included // in all pages for users that are logged in. // The field last_seen is INT(10) function updateLoginTable($uid) { $sql = UPDATE yourTable SET last_seen='.time().' WHERE uid='.$uid.' LIMIT 1; mysql_query($sql); } ? ? // This will be your cron job. // Include your database config here. // The field is_active is BOOL $secs = 600; // Number of seconds to wait before considering logged out $diff_secs = (time() - $secs); $sql = UPDATE yourTable SET is_active='0' WHERE last_seen '.$diff_secs.'; mysql_query($sql); ? Then, add this to your crontab: */1 * * * * `which php` /path/to/cron/script.php It will run every minute, making users who have not accessed a page within the previous 10 minutes inactive. It's untested, but hopefully it will point you in the right direction anyway. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- 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
[PHP] Logging session timeout in DB
Hi all, I am implementing a system where when a user is logged in and out that a date time is set in a database for each action for each used. We can then trace who logged in a and when. No what I would like to know is how can I record when a user closes the browser or the session expires? There is no action for these items. So what would the best way be to keep a record of this? Would the use of a cron job be appropriate? I read in the archives that the banks use javascript but I don't want to go that route. If anyone has any idea how to do this please let me know, thanks in advance. Elemental Telephone: +27 (021) 552 9799 Mobile: +27 (0) 72 441 3355 Fax:+27 (0) 86 681 5885 Web: http://www.elemental.co.za E-Mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Variable post as array
Have you tried print_r($_FILES); to see all the values in the variable? Its difficult to see whats going on as you posted your whole file. -Original Message- From: Pieter du Toit [mailto:[EMAIL PROTECTED] Sent: 05 March 2008 12:38 To: php-general@lists.php.net Subject: [PHP] Re: Variable post as array Just to add, if i try to echo the $_FILES['txtPhoto']['temp_name'] it tells me that temp_name is also an array, but when i echo $_FILES['txtPhoto']['name'] it gives me the correct name. Also with a vardump i can see that temp name is [tmp_name]= string(14) /tmp/phplR1WSl and not an array by itself. Im going crazy here Pieter du Toit [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I have this weird problem, when i select a file to upload, the variable arrives as an array at the action php file, this is the code, and the variable name is txtPhoto ? include (userpass.inc); ? html link rel=STYLESHEET type=TEXT/CSS href=specials.css titleSpecials Update/title /head ? include (body_begin.inc); ? ? echo form ENCTYPE=\multipart/form-data\ method=\POST\ name=\Edit Special\ action=\specials_proc.php\\n; echo input type=\hidden\ name=\keyClient_Id\ value=\$g_client_id\; echo input type=\hidden\ name=\keySpecial\ value=\$special\; echo input type=\hidden\ name=\k_subsystem_id\ value=\$k_subsystem_id\; echo table align=\center\ class=\EditView\ border=\0\ cellspacing=\0\ cellpadding=\0\ width=\80%\\n; if ($special != ) { $new = 0; echo tr class=\MainHeader\th colspan=\2\Edit Special/th/tr\n; $result = mysql(zululandcoza, select * from client_specials where client_id = $g_client_id and special = $special); if (list($client_id, $special, $description, $special_type, $price, $discount, $startdate, $enddate) = mysql_fetch_row($result)) { } } else { $new = 1; echo tr class=\Header\th colspan=\2\h1New Special (this page is undergoing maintenance, please try again later)/h1/th/tr\n; $result = mysql(zululandcoza, select max(special) from client_specials where client_id = $client_id); if (list($max_special) = mysql_fetch_row($result)) { $special = $max_special + 1; } } echo tr class=\Update\\n; echo td align=\left\ class=\Prompt\Specialnbsp;Number/td\n; if ($new) echo td align=\left\ class=\Number\input type=\text\ name=\txtSpecial\ maxlength=\5\ size=\5\ value=\$special\/input/td\n; else echo td align=\left\ class=\Number\input type=\text\ name=\txtSpecial\ maxlength=\5\ size=\5\ value=\$special\ enabled=\0\/input/td\n; echo /tr\n; echo tr class=\Update\\n; echo td align=\left\ class=\Prompt\Description/td\n; echo td align=\left\ class=\Text\input type=\text\ name=\txtDescription\ maxlength=\200\ size=\50\ value=\$description\/input/td\n; echo /tr\n; echo tr class=\Update\\n; echo td align=\left\ class=\Prompt\Specialnbsp;Type/td\n; echo td align=\left\ class=\Selection\\n; $optPRICE = ; $optDISC = ; $optFROM = ; if ($special_type == FROM) $optFROM = SELECTED; elseif ($special_type == DISC) $optDISC = SELECTED; else $optPRICE = SELECTED; echo select name=\cbxSpecial_Type\\n; echo option value=\PRICE\$optPRICESpecial Price/option\n; echo option value=\DISC\$optDISCDiscount %/option\n; echo option value=\FROM\$optFROMFrom/option\n; echo /select\n; echo /td\n; echo /tr\n; echo tr class=\Update\\n; echo td align=\left\ class=\Prompt\Price/td\n; echo td align=\left\ class=\Currency\input type=\text\ name=\txtPrice\ maxlength=\20\ size=\10\ value=\$price\/input/td\n; echo /tr\n; if ($k_subsystem_id == 2) { if (! $new) { echo tr class=\Update\\n; echo td align=\left\ class=\Prompt\Current Photo/td\n; echo td align=\left\ class=\Currency\img src=\showpic.php?keySystem_Id=2keyClient_Id=$g_client_idkeySpecial=$speci al\/td\n; echo /tr\n; } echo tr class=\Update\\n; echo td align=\left\ class=\Prompt\New Photo/td\n; echo td align=\left\ class=\Currency\input type=\file\ name=\txtPhoto\ size=\50\/input/td\n; echo /tr\n; } echo tr class=\Footer\\n; echo td colspan=\2\\n; if ($new) { echo input type=\submit\ name=\cmdAdd\ value=\Add\nbsp;\n; } else { echo input type=\submit\ name=\cmdUpdate\ value=\Update\nbsp;\n; echo input type=\submit\ name=\cmdDelete\ value=\Delete\nbsp;\n; } echo input type=\submit\ name=\cmdCancel\ value=\Cancel\\n; echo /td\n; echo /tr\n; echo /table\n; echo /form\n; ? ? include (body_end.inc); ? /html -- 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] Re: Variable post as array
What is on line 49? What variable are you passing as the parameter? -Original Message- From: Pieter du Toit [mailto:[EMAIL PROTECTED] Sent: 05 March 2008 13:36 To: php-general@lists.php.net Subject: [PHP] Re: Variable post as array This is my problem Warning: fopen() expects parameter 1 to be string, array given in /usr/www/users/zululr/marketplace/myzululand/specials_proc.php on line 49 Colin Guthrie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Pieter du Toit wrote: Hi I have this weird problem, when i select a file to upload, the variable arrives as an array at the action php file, this is the code, and the variable name is txtPhoto I'd give a shorter example. People don't want to read through all your code.. Also you shoudl post some sort of indication of what you are trying to do to get the results you describe... just saying the variable arrives as an array and we don't really know how you are accessing the variable. A short example and expected/actual behaviour listing is good :) Col -- 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] Re: Variable post as array
Well check what the value is. I think you must do more testing yourself instead of just posting here because then you will not learn and also if you trouble shoot it yourself it will allow you to fix errors in the future. -Original Message- From: Pieter du Toit [mailto:[EMAIL PROTECTED] Sent: 05 March 2008 13:43 To: php-general@lists.php.net Subject: Re: [PHP] Re: Variable post as array This is line 49 $txtPhotoData = addslashes(fread(fopen($txtPhoto, r), filesize($txtPhoto))); the $txtPhoto is the parameter Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What is on line 49? What variable are you passing as the parameter? -Original Message- From: Pieter du Toit [mailto:[EMAIL PROTECTED] Sent: 05 March 2008 13:36 To: php-general@lists.php.net Subject: [PHP] Re: Variable post as array This is my problem Warning: fopen() expects parameter 1 to be string, array given in /usr/www/users/zululr/marketplace/myzululand/specials_proc.php on line 49 Colin Guthrie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Pieter du Toit wrote: Hi I have this weird problem, when i select a file to upload, the variable arrives as an array at the action php file, this is the code, and the variable name is txtPhoto I'd give a shorter example. People don't want to read through all your code.. Also you shoudl post some sort of indication of what you are trying to do to get the results you describe... just saying the variable arrives as an array and we don't really know how you are accessing the variable. A short example and expected/actual behaviour listing is good :) Col -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] \n problems when creating an email
Hi guys, I am making email text based on some fields the user fills in and then email the admin the details. I am having a problem where sometimes the \n (new line) works and sometimes it just does nothing. Im not sure the cause but I cant seem to figure it out. Here is a segment of code: .\nHow far would they be prepared to travel to .\n event venue? \n\t\t\t\t\t. $travel .\nDo you have a specific location . \n of preference? \n\t\t\t\t\t. $locationPref .\n City or country preference:\t. $cityPref Here is the output: How far would they be prepared to travel to event venue? Z Logic e Business Cape Do you have a specific location of preference? Z Logic e Business Cape City or country preference:Z Logic e Business Cape As you can see the first line doesn't go to the next row before event But it works fine for the location \n preference Is there any reason it works for the 1 piece of code and not the next? Do spaces affect anything? Kind regards, Angelo Zanetti Application Developer Telephone: +27 (021) 552 9799 Mobile: +27 (0) 72 441 3355 Fax:+27 (0) 86 681 5885 Web: http://www.elemental.co.za E-Mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] \n problems when creating an email
Looks like you're using Outlook. It has an annoying feature where it helpfully removes extra line breaks. This would appear to be what's happening here. When it does this it usually displays a notice somewhere to say it's done this and offers a way to undo it. Thanks, dam I been wasting my time trying to figure out the solution... However I see that with the tabbed (\t) formatting its very inconsistent in many email and web clients... Do you have a solution to ensure that the output is consistent always? Please send some links or any advice, TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best way to automatically get mySQL database.
Hi Jay Thanks again, Now how would I do the SELECT remote_stuff INTO local_table; ? as these are on two different MySQL connections? Im not sure if this is possible to do in one statement or query? Seems possible in theory but I'm not sure. original message: Im wondering the best to do this. Is it to get all the information into result sets for each table and then delete the contents of each local table and then looping through the result sets just insert the information into the local tables? This seems like a good solution but I wonder if there are any out there before going ahead with development. [/snip] TRUNCATE local_table; SELECT remote_stuff INTO local_table; -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Best way to automatically get mySQL database.
hi guys. We've got a local system (PHP intranet) and we need to connect to a live mySQL server get some of the tables (contents) and overwrite the same tables in the local mySQL database. This needs to be done with PHP. Im wondering the best to do this. Is it to get all the information into result sets for each table and then delete the contents of each local table and then looping through the result sets just insert the information into the local tables? This seems like a good solution but I wonder if there are any out there before going ahead with development. Let me know your views etc... Thanks in advance -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best way to automatically get mySQL database.
thanks thought there was something simpler Jay Blanchard wrote: [snip] We've got a local system (PHP intranet) and we need to connect to a live mySQL server get some of the tables (contents) and overwrite the same tables in the local mySQL database. This needs to be done with PHP. Im wondering the best to do this. Is it to get all the information into result sets for each table and then delete the contents of each local table and then looping through the result sets just insert the information into the local tables? This seems like a good solution but I wonder if there are any out there before going ahead with development. [/snip] TRUNCATE local_table; SELECT remote_stuff INTO local_table; -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] languages and PHP
Hi all. this is more of a general question but Im sure some people will have experience and also it will be useful to others who are looking for the same answers as I am. What are the implications of having a site that has many different languages, including latin and non latin characters? Firstly, can a mysql database handle these characters normally? or would you have to have a table for each language and set a different CHARSET for each language depending on the type of language? Secondly, PHP and displaying the information: Is there anything that needs to change with regards to PHP and handling of these characters? OR is it able to handle all characters fine? HTML: I assume the charset changes in the metatag in the head of the document? Is there anything else that I might be missing or other problems that I should be aware of? Thanks in advance. -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] languages and PHP
Paul Scott wrote: On Thu, 2007-09-27 at 12:15 +0200, Angelo Zanetti wrote: What are the implications of having a site that has many different languages, including latin and non latin characters? Keep everything as universal (UTF-8) as possible, and make sure that you code for right-to-left languages as well. Thanks Paul, How do you code for that? do you just align right or do you have to do some other wonderful stuff? --Paul Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] languages and PHP
Per Jessen wrote: Paul Scott wrote: On Thu, 2007-09-27 at 12:15 +0200, Angelo Zanetti wrote: What are the implications of having a site that has many different languages, including latin and non latin characters? Keep everything as universal (UTF-8) as possible, and make sure that you code for right-to-left languages as well. Also be careful about how you use setlocale(). When/if you change it, make sure that your mysql connections has the same locale as your PHP code. Also don't make assumptions about the locale setting, but always set it explicitly. Something similar goes for timezone I believe. setlocale() caused me all kinds of grief 2-3 years ago. Thanks will keep this in mind. Very much appreciated. /Per Jessen, Zürich -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MIME type
GOt it working by adding the MIME type to the .htaccess file on the server. Angelo Zanetti wrote: Thanks heavyccasey Im not sure which comment you are referring to, perhaps this one? There are many posts. |?php $file = '/var/www/html/file-to-download.xyz'; header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Length: ' . filesize($filename)); header('Content-Disposition: attachment; filename=' . basename($file)); readfile($file); ?| [EMAIL PROTECTED] wrote: Look up readfile(); Make sure you read the comments. On 9/11/07, Angelo Zanetti [EMAIL PROTECTED] wrote: Hi guys. I am linking to a file on a WAP site. the backend is written in PHP. However I need to link to a file but set the content type. I've done the following and am wondering if this is correct: ? // We'll be outputting a PDF header('Content-type: application/vnd.symbian.install'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=../File/norEnglish.sis'); ? So basically I set the HREF to the file above (filename .php). Let me know if there is anything that im doing incorrectly. Thanks -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MIME type
Thanks heavyccasey Im not sure which comment you are referring to, perhaps this one? There are many posts. |?php $file = '/var/www/html/file-to-download.xyz'; header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Length: ' . filesize($filename)); header('Content-Disposition: attachment; filename=' . basename($file)); readfile($file); ?| [EMAIL PROTECTED] wrote: Look up readfile(); Make sure you read the comments. On 9/11/07, Angelo Zanetti [EMAIL PROTECTED] wrote: Hi guys. I am linking to a file on a WAP site. the backend is written in PHP. However I need to link to a file but set the content type. I've done the following and am wondering if this is correct: ? // We'll be outputting a PDF header('Content-type: application/vnd.symbian.install'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=../File/norEnglish.sis'); ? So basically I set the HREF to the file above (filename .php). Let me know if there is anything that im doing incorrectly. Thanks -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MIME type
Hi guys. I am linking to a file on a WAP site. the backend is written in PHP. However I need to link to a file but set the content type. I've done the following and am wondering if this is correct: ? // We'll be outputting a PDF header('Content-type: application/vnd.symbian.install'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=../File/norEnglish.sis'); ? So basically I set the HREF to the file above (filename .php). Let me know if there is anything that im doing incorrectly. Thanks -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and SOAP calls
Richard Lynch wrote: On Fri, August 24, 2007 12:55 am, Angelo Zanetti wrote: Dear All I have been using nusoap to development a client that makes SOAP calls to a server. I have however been stuck on a small issue but can't seem to solve it and therefore I need to relook at using another package to get a solution. So I have read that PEAR also has a package that makes SOAP calls (PEAR::SOAP). And there is PHP-SOAP. Now Im running PHP 4.4xxx and I need to get this up and running ASAP. What would you suggest I use as the package to make the client calls? I have read that the PEAR::SOAP thing is fairly easy to use? Does anyone have suggestions or recommendations or what not to use and why? I have fought with SOAP in PHP 5, and PHP 4, and I think maybe even PHP 3 (shudder). I've used nuSoap, and I think I used PEAR::SOAP once. I also tried to use some other SOAP package once, I think, that failed miserably. My recommendations: #1 If you can move to PHP 5 and use the built-in SOAP there, do it ASAP. It's like night and day. #2 If you are stuck in PHP 4, try the PEAR::SOAP. I believe it will handle the whatsit tag namespace-y thingie you are getting with that tag:0 business better than nuSoap, as I recall. I won't swear to it in court, though, as I only use PEAR::SOAP once before I moved to PHP 5 and my SOAP life was way way way cleaner. Thanks Richard. I've pretty much got it working with nuSoap but lack of documentation and support makes it difficult to progress quickly and is very frustrating. Angelo -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
Thijs Lensselink wrote: On Fri, 24 Aug 2007 13:55:29 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: On Fri, 24 Aug 2007 12:39:06 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: On Fri, 24 Aug 2007 11:53:12 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; The action variable is that the URL of the WSDL? $results = $client-send($msg, $action, 60, 60); Why do you have 60 twice? As far as I can see in the API the send document is only receiving 3 parameters? I have posted to many SOAP forums and the mailing list. No luck what so ever. Your the first to reply thanks, I think this could work. Your help is very much appreciated. regards Angelo Hey Angelo, I know getting info for NuSOAP is a b*tch. Maybe switch to PHP5 and the SOAP extension? The $action variable is not the WSDL url. I missed that part in your first post. The $action var is actually build up from two parts. The first part being the webservice location. And the second part is /webserviceAction The reason i have two 60's in the method call is because in the soapclient class the method looks like this: function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) { But in the meantime i've been trying some other things with NuSOAP. And got this to work with WSDL. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; $params = array('request' = $request); $operation = 'WebserviceAction'; $result = $client-call($operation, $params, $namespace); Hope this helps. Hi, yes I have done it as you have specified with the call method unfortunately for some weird reason that creates the duplication. However I have almost got your previous mail working. But in the XML request I have: Now I see this is present: xmlns:0= -- its an error thats making the XML invalid any reason why its making that? ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:0= Another thing i that I have made the action variable to : wsdlURL/SubscriptionStatus where wsdlURL is the URL of wsdl. This also doesnt work but it might have to do with the above invalid XML so perhaps this is the correct way to create the action parameter? Thanks again very much. The empy xmlns means there is no namespace set. I guess you didn't provide a namespace in the serializeEnvelope method. The 3rd parameter is set to false in the example. But that's where you should set the $namspace. The WSDL url should work if you take of the ?wsdl part. Thanks again. I have specified the namespace but the problem is that its creating the weird characters: xmlns:0= :0 Im not sure where they come from and I'm not sure I need the name space anyway Any idea why its causing this character? thank try this: $msg = $client-serializeEnvelope($request, '', array(), 'document', 'literal'); That worked! I assume that it was send it as an array element therefore the 0 appeared causing the XML page to be invalid. Thanks -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
Thijs Lensselink wrote: Angelo Zanetti wrote: Thijs Lensselink wrote: On Fri, 24 Aug 2007 07:57:48 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: Dear all Im using nusoap to create a cleint and I am having a small issue but its a fairly large one because I cant get the correct XML to send. I have a scenario as follows: My client: $wsdlfile=http://xxx_WSDL.xml?wsdl;; $client=new soapclient($wsdlfile, true); //, true); $client-soap_defencoding = 'utf-8'; $nameSpace = xxx; Tried this: $parameters = SubscriptionStatus xmlns='http://localhost/'; $parameters .= ISPIDxx/ISPID; $parameters .= ISPPasswordyy/ISPPassword; $parameters .= ISPUserIDAngelo1/ISPUserID; $parameters .= /SubscriptionStatus; $result = $client-call('SubscriptionStatus', $parameters, $nameSpace); To call the SubscriptionStatus process. I have also tried: /*$Request = array( array( 'ISPID' = 'xx', 'ISPPassword' = 'yy', 'ISPUserID'='Angelo1') ); $result = $client-call('SubscriptionStatus', $Response, $nameSpace); The request must look like this: ?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body SubscriptionStatus xmlns=http://localhost/; ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /soap:Body /soap:Envelope But in fact it looks like this: ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:tns=http://devbit.openbit.com/SOS/; SOAP-ENV:Body SubscriptionStatus xmlns=http://...; SubscriptionStatus xmlns=http://..; ISPIDlighthouse/ISPID ISPPassword***/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /SubscriptionStatus /SOAP-ENV:Body /SOAP-ENV:Envelope as you can see the SubscriptionStatus xmlns=http://...; has been repeated. This is causing my problems. I am not sure what is causing it? Does it have something to do with name spaces? OR the way the client object is created? This is a straight forward call but I have been searching through so many posts and have not had any luck. Please any links or any ideas are most welcome. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; $results = $client-send($msg, $action, 60, 60); Seems to make the XML request correctly but now the response from the server is the WSDL file? strange even though my request is correct. Im not 100% sure about the $action parameter? What must be entered here? Also mustn't I specify the Element that is being consumed in the webservice IE: SubscriptionStatus? THanks again The action parameter is something like: http://domain.com/webservice From the WSDL file you can get the soapAction. This is where the requests go. I think you are sending the XML correctly. But to the wrong endpoint. (https://netshop.openbit.com/SOS/SOSServlet) Thanks once again. I think its working nicely but I don't get anything from my send command but I can see the response and its not the WSDL now but the response from the server. Will have to check that its working 100% but is there any reason why there is no result from the send command? $result = $client-send($msg, $wsdlfile, 60, 60); thanks again -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and SOAP calls
Paul Scott wrote: On Fri, 2007-08-24 at 07:55 +0200, Angelo Zanetti wrote: I have been using nusoap to development a client that makes SOAP calls to a server. I have however been stuck on a small issue but can't seem to solve it and therefore I need to relook at using another package to get a solution. Instead of starting again, what is your small issue? Can that not be solved rather? --Paul Hi Paul I have posted it in a seperate thread just after this one. If you can help id really appreciate that. Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
Thijs Lensselink wrote: On Fri, 24 Aug 2007 07:57:48 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: Dear all Im using nusoap to create a cleint and I am having a small issue but its a fairly large one because I cant get the correct XML to send. I have a scenario as follows: My client: $wsdlfile=http://xxx_WSDL.xml?wsdl;; $client=new soapclient($wsdlfile, true); //, true); $client-soap_defencoding = 'utf-8'; $nameSpace = xxx; Tried this: $parameters = SubscriptionStatus xmlns='http://localhost/'; $parameters .= ISPIDxx/ISPID; $parameters .= ISPPasswordyy/ISPPassword; $parameters .= ISPUserIDAngelo1/ISPUserID; $parameters .= /SubscriptionStatus; $result = $client-call('SubscriptionStatus', $parameters, $nameSpace); To call the SubscriptionStatus process. I have also tried: /*$Request = array( array( 'ISPID' = 'xx', 'ISPPassword' = 'yy', 'ISPUserID'='Angelo1') ); $result = $client-call('SubscriptionStatus', $Response, $nameSpace); The request must look like this: ?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body SubscriptionStatus xmlns=http://localhost/; ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /soap:Body /soap:Envelope But in fact it looks like this: ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:tns=http://devbit.openbit.com/SOS/; SOAP-ENV:Body SubscriptionStatus xmlns=http://...; SubscriptionStatus xmlns=http://..; ISPIDlighthouse/ISPID ISPPassword***/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /SubscriptionStatus /SOAP-ENV:Body /SOAP-ENV:Envelope as you can see the SubscriptionStatus xmlns=http://...; has been repeated. This is causing my problems. I am not sure what is causing it? Does it have something to do with name spaces? OR the way the client object is created? This is a straight forward call but I have been searching through so many posts and have not had any luck. Please any links or any ideas are most welcome. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; $results = $client-send($msg, $action, 60, 60); Thanks Thijs, This looks interesting will try it and give you feedback -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; The action variable is that the URL of the WSDL? $results = $client-send($msg, $action, 60, 60); Why do you have 60 twice? As far as I can see in the API the send document is only receiving 3 parameters? I have posted to many SOAP forums and the mailing list. No luck what so ever. Your the first to reply thanks, I think this could work. Your help is very much appreciated. regards Angelo Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
Thijs Lensselink wrote: On Fri, 24 Aug 2007 07:57:48 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: Dear all Im using nusoap to create a cleint and I am having a small issue but its a fairly large one because I cant get the correct XML to send. I have a scenario as follows: My client: $wsdlfile=http://xxx_WSDL.xml?wsdl;; $client=new soapclient($wsdlfile, true); //, true); $client-soap_defencoding = 'utf-8'; $nameSpace = xxx; Tried this: $parameters = SubscriptionStatus xmlns='http://localhost/'; $parameters .= ISPIDxx/ISPID; $parameters .= ISPPasswordyy/ISPPassword; $parameters .= ISPUserIDAngelo1/ISPUserID; $parameters .= /SubscriptionStatus; $result = $client-call('SubscriptionStatus', $parameters, $nameSpace); To call the SubscriptionStatus process. I have also tried: /*$Request = array( array( 'ISPID' = 'xx', 'ISPPassword' = 'yy', 'ISPUserID'='Angelo1') ); $result = $client-call('SubscriptionStatus', $Response, $nameSpace); The request must look like this: ?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body SubscriptionStatus xmlns=http://localhost/; ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /soap:Body /soap:Envelope But in fact it looks like this: ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:tns=http://devbit.openbit.com/SOS/; SOAP-ENV:Body SubscriptionStatus xmlns=http://...; SubscriptionStatus xmlns=http://..; ISPIDlighthouse/ISPID ISPPassword***/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /SubscriptionStatus /SOAP-ENV:Body /SOAP-ENV:Envelope as you can see the SubscriptionStatus xmlns=http://...; has been repeated. This is causing my problems. I am not sure what is causing it? Does it have something to do with name spaces? OR the way the client object is created? This is a straight forward call but I have been searching through so many posts and have not had any luck. Please any links or any ideas are most welcome. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; $results = $client-send($msg, $action, 60, 60); Seems to make the XML request correctly but now the response from the server is the WSDL file? strange even though my request is correct. Im not 100% sure about the $action parameter? What must be entered here? Also mustn't I specify the Element that is being consumed in the webservice IE: SubscriptionStatus? THanks again -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
Thijs Lensselink wrote: On Fri, 24 Aug 2007 11:53:12 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; The action variable is that the URL of the WSDL? $results = $client-send($msg, $action, 60, 60); Why do you have 60 twice? As far as I can see in the API the send document is only receiving 3 parameters? I have posted to many SOAP forums and the mailing list. No luck what so ever. Your the first to reply thanks, I think this could work. Your help is very much appreciated. regards Angelo Hey Angelo, I know getting info for NuSOAP is a b*tch. Maybe switch to PHP5 and the SOAP extension? The $action variable is not the WSDL url. I missed that part in your first post. The $action var is actually build up from two parts. The first part being the webservice location. And the second part is /webserviceAction The reason i have two 60's in the method call is because in the soapclient class the method looks like this: function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) { But in the meantime i've been trying some other things with NuSOAP. And got this to work with WSDL. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; $params = array('request' = $request); $operation = 'WebserviceAction'; $result = $client-call($operation, $params, $namespace); Hope this helps. Hi, yes I have done it as you have specified with the call method unfortunately for some weird reason that creates the duplication. However I have almost got your previous mail working. But in the XML request I have: Now I see this is present: xmlns:0= -- its an error thats making the XML invalid any reason why its making that? ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:0= Another thing i that I have made the action variable to : wsdlURL/SubscriptionStatus where wsdlURL is the URL of wsdl. This also doesnt work but it might have to do with the above invalid XML so perhaps this is the correct way to create the action parameter? Thanks again very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nuSoap client SOAP Call problem
Thijs Lensselink wrote: On Fri, 24 Aug 2007 12:39:06 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: Thijs Lensselink wrote: On Fri, 24 Aug 2007 11:53:12 +0200, Angelo Zanetti [EMAIL PROTECTED] wrote: It's probably better to ask on a NuSOAP list. The call method needs an array with parameters as far as i remember. But i never use the call method anyway. I always go for the send method. First create your request XML. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; Then serialize the envelope so it looks like a SOAP request. $msg = $client-serializeEnvelope($request, false, false, 'document', 'literal'); And use the send method to make a connection and send the request. $action = 'location of the webservice'; The action variable is that the URL of the WSDL? $results = $client-send($msg, $action, 60, 60); Why do you have 60 twice? As far as I can see in the API the send document is only receiving 3 parameters? I have posted to many SOAP forums and the mailing list. No luck what so ever. Your the first to reply thanks, I think this could work. Your help is very much appreciated. regards Angelo Hey Angelo, I know getting info for NuSOAP is a b*tch. Maybe switch to PHP5 and the SOAP extension? The $action variable is not the WSDL url. I missed that part in your first post. The $action var is actually build up from two parts. The first part being the webservice location. And the second part is /webserviceAction The reason i have two 60's in the method call is because in the soapclient class the method looks like this: function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) { But in the meantime i've been trying some other things with NuSOAP. And got this to work with WSDL. $request = 'SubscriptionStatus xmlns='http://localhost/' ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus'; $params = array('request' = $request); $operation = 'WebserviceAction'; $result = $client-call($operation, $params, $namespace); Hope this helps. Hi, yes I have done it as you have specified with the call method unfortunately for some weird reason that creates the duplication. However I have almost got your previous mail working. But in the XML request I have: Now I see this is present: xmlns:0= -- its an error thats making the XML invalid any reason why its making that? ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:0= Another thing i that I have made the action variable to : wsdlURL/SubscriptionStatus where wsdlURL is the URL of wsdl. This also doesnt work but it might have to do with the above invalid XML so perhaps this is the correct way to create the action parameter? Thanks again very much. The empy xmlns means there is no namespace set. I guess you didn't provide a namespace in the serializeEnvelope method. The 3rd parameter is set to false in the example. But that's where you should set the $namspace. The WSDL url should work if you take of the ?wsdl part. Thanks again. I have specified the namespace but the problem is that its creating the weird characters: xmlns:0= :0 Im not sure where they come from and I'm not sure I need the name space anyway Any idea why its causing this character? thank -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and SOAP calls
Dear All I have been using nusoap to development a client that makes SOAP calls to a server. I have however been stuck on a small issue but can't seem to solve it and therefore I need to relook at using another package to get a solution. So I have read that PEAR also has a package that makes SOAP calls (PEAR::SOAP). And there is PHP-SOAP. Now Im running PHP 4.4xxx and I need to get this up and running ASAP. What would you suggest I use as the package to make the client calls? I have read that the PEAR::SOAP thing is fairly easy to use? Does anyone have suggestions or recommendations or what not to use and why? Thanks in advance. -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] nuSoap client SOAP Call problem
Dear all Im using nusoap to create a cleint and I am having a small issue but its a fairly large one because I cant get the correct XML to send. I have a scenario as follows: My client: $wsdlfile=http://xxx_WSDL.xml?wsdl;; $client=new soapclient($wsdlfile, true); //, true); $client-soap_defencoding = 'utf-8'; $nameSpace = xxx; Tried this: $parameters = SubscriptionStatus xmlns='http://localhost/'; $parameters .= ISPIDxx/ISPID; $parameters .= ISPPasswordyy/ISPPassword; $parameters .= ISPUserIDAngelo1/ISPUserID; $parameters .= /SubscriptionStatus; $result = $client-call('SubscriptionStatus', $parameters, $nameSpace); To call the SubscriptionStatus process. I have also tried: /*$Request = array( array( 'ISPID' = 'xx', 'ISPPassword' = 'yy', 'ISPUserID'='Angelo1') ); $result = $client-call('SubscriptionStatus', $Response, $nameSpace); The request must look like this: ?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body SubscriptionStatus xmlns=http://localhost/; ISPIDxx/ISPID ISPPasswordyy/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /soap:Body /soap:Envelope But in fact it looks like this: ?xml version=1.0 encoding=utf-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:si=http://soapinterop.org/xsd; xmlns:tns=http://devbit.openbit.com/SOS/; SOAP-ENV:Body SubscriptionStatus xmlns=http://...; SubscriptionStatus xmlns=http://..; ISPIDlighthouse/ISPID ISPPassword***/ISPPassword ISPUserIDAngelo1/ISPUserID /SubscriptionStatus /SubscriptionStatus /SOAP-ENV:Body /SOAP-ENV:Envelope as you can see the SubscriptionStatus xmlns=http://...; has been repeated. This is causing my problems. I am not sure what is causing it? Does it have something to do with name spaces? OR the way the client object is created? This is a straight forward call but I have been searching through so many posts and have not had any luck. Please any links or any ideas are most welcome. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] import spreadsheet
Richard Lynch wrote: On Fri, July 27, 2007 4:01 am, Angelo Zanetti wrote: Does anyone have any resources or links as to how to import a spreadsheet but it might have different number of columns and many sheets (those tab things at the bottom). What I thought of doing was creating a table that has 10 fields and if the file thats being imported only has 4 fields then the remaining six fields are blank. So basically my script must dynamically take the format (which changes) and try save it in the database in a semi standard format. If anyone thinks its possible or not please advise. Any help or advice would be greatly appreciated. I didn't actually import multiple sheets, but the tool I used returned an array sheets and the 0-th element was the only sheet in there, so I suspect a second sheet would have been the next element... It's a PECL package up on sourceforge: http://sourceforge.net/projects/phpexcelreader/ As far as columns and rows goes, it just built an array the right size to hold everything in the spreadsheet. Though if you've got a stray space in column ZZZ row 65535, then I suppose you could be in trouble... It's got a bug as of a couple weeks ago where it tries to 'include' a file that doesn't exist... Change that to include the similarly-named file that's actually there and bob's your uncle. YMMV PS Watch out for those serial killer dates... :-) I blogged a little bit about this here: http://richardlynch.blogspot.com/2007/07/php-microsoft-excel-reader-and-serial.html hi guys. Thanks to those that responded, I will check out all the responses! Much appreciated! regards Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] import spreadsheet
Hi guys Does anyone have any resources or links as to how to import a spreadsheet but it might have different number of columns and many sheets (those tab things at the bottom). What I thought of doing was creating a table that has 10 fields and if the file thats being imported only has 4 fields then the remaining six fields are blank. So basically my script must dynamically take the format (which changes) and try save it in the database in a semi standard format. If anyone thinks its possible or not please advise. Any help or advice would be greatly appreciated. THanks in advance -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading really big files
clive wrote: Angelo Zanetti wrote: Dear all We need to develop a system where we can upload really big files. IE 15 - 25 Mb. I know its not a php answer, but if you have ever uploaded a file with facebook then you will have seen the little applet they push down to your browser, perhaps investigating something like might prove useful, I doubt they wrote it themselves, then again maybe they did. yeah seen that its a Java applet was going to research it but didnt have time. Quite a cool component though! Thanks -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading really big files
Richard Lynch wrote: On Wed, May 30, 2007 8:47 am, Angelo Zanetti wrote: We need to develop a system where we can upload really big files. IE 15 - 25 Mb. You're pushing the limit on user patience and browser timeouts... So I know you can set the limit of the upload thats not a problem, I know a problem that we might experience is that the browser might time out. Is there any way around this? Nope. The browser gets tired of waiting around for the upload to complete because your server is too slow/busy, and the user has a very bad experience. file upload was grafted onto HTTP rather late in the game, and shows the scars badly. and also are there other problems I might encounter? Woof. Yes, there are many problems you might encounter :-) Users on slow/flaky connectionns will never have a good experience with HTTP file upload. Give them FTP or SCP or something that is more stable and will re-try. You also have to consider what users might choose to upload that is not what you wanted. There are all kinds of people out there looking to upload interesting content that you don't actually want, most likely. There is a Flikr book out there that might have some insight for you. They obviously dealt with this already, and wrote a whole book all about Flikr, so it's probably got something in there covering this. thanks for the replies. But how does a site like: http://www.yousendit.com/ do the upload of really huge files? Normal upload? thanks -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading really big files
Zoltán Németh wrote: 2007. 05. 30, szerda keltezéssel 15.47-kor Angelo Zanetti ezt írta: Dear all We need to develop a system where we can upload really big files. IE 15 - 25 Mb. So I know you can set the limit of the upload thats not a problem, I know a problem that we might experience is that the browser might time out. Is there any way around this? and also are there other problems I might encounter? http://www.php.net/manual/en/ref.info.php#ini.max-execution-time yes it does! thanks cheers -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading really big files
Dear all We need to develop a system where we can upload really big files. IE 15 - 25 Mb. So I know you can set the limit of the upload thats not a problem, I know a problem that we might experience is that the browser might time out. Is there any way around this? and also are there other problems I might encounter? Thanks in advance angelo -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with composing URL with GET Variables
Dear all. I have a script that is called by an AJAX popup. Now I use an image file to get the path of an image for an img tag eg: img border=0 id=middleImage name=middleImage src=? echo $getImageURL; ? the $getImageURL is composed as follows: $getImageURL = getImage.php?imageid=. $imageID.height=275width=375quality=65; However when I look at the URL that gets sent its as follows: getImage.php?imageid=10amp;height=275amp;width=375amp;quality=65 Which is obviously incorrect. So I tried: $getImageURL = html_entity_decode(getImage.php?imageid=. $imageID.height=275width=375quality=65); But that doesn't seem to be working. . . As the html_entity_decode should the amp sign to the sign? Am I going in the right direction or can anyone else let me know if there is something I am missing or should be doing? Thanks in advance. -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOLVED Re: [PHP] problem with composing URL with GET Variables
SOLVED. seems that something else was causing the script not to work. Thanks anyway Angelo Zanetti wrote: Dear all. I have a script that is called by an AJAX popup. Now I use an image file to get the path of an image for an img tag eg: img border=0 id=middleImage name=middleImage src=? echo $getImageURL; ? the $getImageURL is composed as follows: $getImageURL = getImage.php?imageid=. $imageID.height=275width=375quality=65; However when I look at the URL that gets sent its as follows: getImage.php?imageid=10amp;height=275amp;width=375amp;quality=65 Which is obviously incorrect. So I tried: $getImageURL = html_entity_decode(getImage.php?imageid=. $imageID.height=275width=375quality=65); But that doesn't seem to be working. . . As the html_entity_decode should the amp sign to the sign? Am I going in the right direction or can anyone else let me know if there is something I am missing or should be doing? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong with this INSERT?
$result = mysql_query($sql) or die(Fatal Error :.mysql_error()); where do you define $sql? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong with this INSERT?
Rahul Sitaram Johari wrote: Oh I¹m sorry! I was messing with the code when I copied it to the mailing list. This is the actual code: $sql = mysql_query(INSERT INTO olivejuice (WHEN, WHAT, WHO) VALUES ('$WHEN','$WHAT','$WHO')); And the entire code: ?php //Add Record Function if($_POST['Submit']) { $db = mysql_connect(localhost,usr,pwd); mysql_select_db(thedb,$db) or die(Critical Error :.mysql_error()); $WHEN = date(mdyHi); $WHAT = $_POST['WHAT']; $WHO = $_POST['WHO']; echo SPAN CLASS='BlackText'$WHEN, $WHAT, $WHO/SPANbr; $sql = mysql_query(INSERT INTO tbl (WHEN, WHAT, WHO) VALUES ('$WHEN','$WHAT','$WHO')); $result = mysql_query($sql) or die(Fatal Error :.mysql_error()); echo span class='SmallText'EMSTRONG~: message sent :~/STRONG/EM/spanBRBR; } ? you still doing the same thing running mysql_query on mysql_query, see the other guy's post for the correct answer Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CURL questions
Hi all. I have a script on a server that does some processing, now I want to execute that script using cURL. This is a basic scenario and I assume its possible but its not working. The script is as follows: $url = http://www/test.php;; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 100); $data = curl_exec($ch); curl_close($ch); echo DATA: . $data; Now the $url I have taken out the path for obvious reasons. I get a 500 Internal server error, not sure why as this page being called just inserts a word into a database. Could the cause be something else network related? What else can I troubleshoot? or is my code incorrect? TIA Kind regards -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CURL questions
y Erik Jones wrote: On Mar 29, 2007, at 11:15 AM, Angelo Zanetti wrote: Hi all. I have a script on a server that does some processing, now I want to execute that script using cURL. This is a basic scenario and I assume its possible but its not working. The script is as follows: $url = http://www/test.php;; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 100); $data = curl_exec($ch); curl_close($ch); echo DATA: . $data; Now the $url I have taken out the path for obvious reasons. I get a 500 Internal server error, not sure why as this page being called just inserts a word into a database. Could the cause be something else network related? What else can I troubleshoot? or is my code incorrect? Well, have you tested callling the script directly from a browser? Also, note that your setting CURLOP_RETURNTRANSFER twice and that my be messing with the curl call. yes i have tested with the browser, it works fine. I have removed the duplicate entry however its still giving the error do you think they are blocking the request? or should I be doing the request on a certain port? thanks in advance -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELO command when sending email using PHP
Hi all. I am sending emails using the SMTP connection with PHP using the HTMLMimeMail class. Now there is a setting there for the HELO command text, can anyone explain to me what this is and what it should be set to? TIA. -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELO command when sending email using PHP
demo wrote: please check the RFC 821, it shows the SMTP protocol. HELO domain.com it should fill your Mail server domain in order to prevent email going through most of anti-spam. Thanks, so if Im running localhost, the HELO command will also be localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running PHP on a windows server-your views
thanks to everyone for the answers, much appreciated and if there are more I'd gladly like to hear those views/opinions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: CONTENT-type for sending HTML attachments
Manuel Lemos wrote: Hello, on 03/16/2007 12:16 PM Angelo Zanetti said the following: Hi guys. Im using the HTML Mime Mail http://www.phpguru.org/static/mime.mail.html class from phpguru.org. Anyway I've written a few scripts that use the class to attach files to it. These files are HTML reports but Im not sure what MIME content-type to use. The content type I use to for the attachments is text/html. But Im not sure that the content type for the email itself should be plain/text as this just displays the HTML attachment as garbage in the body text. You should never send HTML only messages, as most spam filters will discard your message. Usually you need to have an alternative text part like the messages composed by normal mail clients. So if the HTML files are attachments and the text is just plain text then will the content-type of the message be text/plain and then each attachment be multipart/alternative. Please note that the HTML files need to be sent as attachments and not part of the body. On my email client I was receiving the emails correctly (IE: message body and HTML files as attachments) but on my client's email client they were just receiving blank messages. I'm just a little confused about the content types as you might have gathered. TIA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php