Re: [PHP] 2 questions: Search in array and detect JS
Ryan A wrote: 1) Is it possible to detect JavaScript via php... and yes I do know that JS is client side while PHP is server...but how else to do it? The reason I ask is before serving an AJAX page I would like to make sure JS is enabled, if not, serve the other normal page... I am sure I am not the first person to come accross this little problem, how did you solve it? The way I do this is to serve the 'notmal page' first, but with the following snippet of JS in it... script language=javascript !-- location.href = '/url/for/ajax/page.php'; -- /script That way if they have JS enabled they'll get sent to the AJAX page. If not they stay on the 'normal page'. 2) How can I search in an array for a particular word? eg: in an array movie I have this kind of data: movie_name= some movie cast= Jim Carrey, Richard Pryor, Eddie Murphy I want to search on either Richard or Richard Pryor (must be case insensitive too) something like a SELECT with a LIKE %% statement I have been fooling around with in_array() but not getting anywhere fast. am I on the right track? Links, code examples or advise would be as alwaysappreciated. You should be able to craft some combination of array_walk and a custom function that checks each element with stristr to do what you need. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache 2.2 problems to protect folder with mod_authz_host
Hello, We're having some trouble with upgrading our webserver from apache 2.0 to apache 2.2. Everything is working fine except one thing: We have created one alias (outside the web root folder). On this folder nobody from the internet should have access to it. Only the webserver should have access to this folder. On Apache 2.0 it was no problem to configure this in the httpd.conf. We loaded the module mod_access (which is now mod_authz_host) and created the alias: Alias /abc c:/apache/xyz/ Options Indexes MultiViews ExecCGI DirectoryIndex index.php Order deny,allow Deny from all Allow from 127.0.0.1 But with this configuration it is possible to get access to our protected folder in Apache 2.2. Where is the error? Best regards. Dennis PS: I don't want to protect this folder with .htaccess, if anybody is asking. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2.2 problems to protect folder with mod_authz_host
On 4/15/06, Dennis Neetix [EMAIL PROTECTED] wrote: Hello, We're having some trouble with upgrading our webserver from apache 2.0 to apache 2.2. Everything is working fine except one thing: Ask the apache mailing list: http://httpd.apache.org/lists.html They will be able to give you a much quicker answer than we will. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how should MS Access DATETIME be handled in PHP?
On 4/14/06, Bing Du [EMAIL PROTECTED] wrote: While all the data-munging in PHP is very interesting... Might I suggest that you just use MySQL's date_format() function to ask MySQL to give you the data you want in the first place? Some purists would claim that the database is not the place to put presentation logic, of course. And for a large-scale library where other users might want to skin a different format, I couldn't agree more. But, really, for a small project, K.I.S.S. wins out, and having MySQL just hand you what you want instead of cluttering up your code with several lines (or a long multi-operation line) of PHP, seems like a cleaner solution. Not to mention that you'll have a lot less headaches like this one. http://mysql.com and search for date_format Thanks, Richard. I agree with you. Is date_format() a MySQL specific funtion? If so, we're out of luck because our backend DB is MS Access. Do the search as Richard suggested. MS Access might have a similar function you can use, but you'll need to do some searching yourself to find the answer. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh PHP page via onclick event
Hi, Sorry to look like stupid for some of you, but i'm still not able to link to link (a /a) or to a button via onclick event) the refresh of my page. i've check META tag and also $PHP_SELF variable, but it does not work. here is what i would like to do. i have 1 PHP page on which i have 3 flags (3 images) if user click on 1 of these flags, $_SESSION['Localization'] is set up to flag language and the page must be refreshed. thanks a lot for some help or tutorials. Alain
Re: [PHP] refresh PHP page via onclick event
On 4/15/06, Alain Roger [EMAIL PROTECTED] wrote: Hi, Sorry to look like stupid for some of you, but i'm still not able to link to link (a /a) or to a button via onclick event) the refresh of my page. i've check META tag and also $PHP_SELF variable, but it does not work. What happens when you try? i have 1 PHP page on which i have 3 flags (3 images) if user click on 1 of these flags, $_SESSION['Localization'] is set up to flag language and the page must be refreshed. Something like this should work: a href=?php echo $_SERVER['PHP_SELF']; ??lang=enEnglish/a a href=?php echo $_SERVER['PHP_SELF']; ??lang=frFrench/a Then check $_GET['lang'] to use the new language var (then set it in the session etc). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh PHP page via onclick event
but i do not want to add some variable at the end of link... when user click on the flag, it should first store language into a $_SESSION variable and after redirect/refresh page. On 4/15/06, chris smith [EMAIL PROTECTED] wrote: On 4/15/06, Alain Roger [EMAIL PROTECTED] wrote: Hi, Sorry to look like stupid for some of you, but i'm still not able to link to link (a /a) or to a button via onclick event) the refresh of my page. i've check META tag and also $PHP_SELF variable, but it does not work. What happens when you try? i have 1 PHP page on which i have 3 flags (3 images) if user click on 1 of these flags, $_SESSION['Localization'] is set up to flag language and the page must be refreshed. Something like this should work: a href=?php echo $_SERVER['PHP_SELF']; ??lang=enEnglish/a a href=?php echo $_SERVER['PHP_SELF']; ??lang=frFrench/a Then check $_GET['lang'] to use the new language var (then set it in the session etc). -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] refresh PHP page via onclick event
On 15 Apr 2006, at 12:51, Alain Roger wrote: but i do not want to add some variable at the end of link... when user click on the flag, it should first store language into a $_SESSION variable and after redirect/refresh page. Not possible. Web pages don't work like that. You need the flags to link somewhere, and only then can it store the details in the session. So either each flag links to its own PHP script (pointless), or you follow the advice of Chris and handle it that way. However you look at it though, you've got to pass a language somehow. Either via the query string, or by calling a unique script that handles that language only. Cheers, Rich -- http://www.corephp.co.uk Zend Certified Engineer PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh PHP page via onclick event
Or, use form and images as button and you will not get variables at the end of the link: form method=post action=?= $_SERVER['PHP_SELF'] ? input type=images src=engFlag.jpg name=lang value=en input type=images src=fraFlag.jpg name=lang value=fr /form and on the top of the page (php file) before you grab info from database and language info (maybe i the header file): ?php if(isset($_POST['lang'])) { $_SESSION['lang'] = mysql_real_escape_string($_POST['lang']); } ? -afan On 15 Apr 2006, at 12:51, Alain Roger wrote: but i do not want to add some variable at the end of link... when user click on the flag, it should first store language into a $_SESSION variable and after redirect/refresh page. Not possible. Web pages don't work like that. You need the flags to link somewhere, and only then can it store the details in the session. So either each flag links to its own PHP script (pointless), or you follow the advice of Chris and handle it that way. However you look at it though, you've got to pass a language somehow. Either via the query string, or by calling a unique script that handles that language only. Cheers, Rich -- http://www.corephp.co.uk Zend Certified Engineer PHP Development Services -- 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] 2 questions: Search in array and detect JS
Hey Stut, Thanks for replying. --- The way I do this is to serve the 'notmal page' first, but with the following snippet of JS in it... script language=javascript !-- location.href = '/url/for/ajax/page.php'; -- /script--Makes sense and pretty easy, this was suggested a while back, since you have supported itI think I'll start using this method.--- You should be able to craft some combination of array_walk and a custom function that checks each element with stristr to do what you need. -Actually, I solved this thanks to Richard from the list who suggested strpos, a function I had never usedbefore ( Tedd from the list gave me the same suggestion as you to use stristr, I didnt want to use stristr as its a bit expensive esp with a really large array) the problem I ran into was that strpos is a php5 functionbut reading the user contributed articles on strpos at thephp site I got the code that does exactly that in 2-3 linesCheers! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh PHP page via onclick event
At 1:40 PM +0200 4/15/06, Alain Roger wrote: Hi, Sorry to look like stupid for some of you, but i'm still not able to link to link (a /a) or to a button via onclick event) the refresh of my page. i've check META tag and also $PHP_SELF variable, but it does not work. here is what i would like to do. i have 1 PHP page on which i have 3 flags (3 images) if user click on 1 of these flags, $_SESSION['Localization'] is set up to flag language and the page must be refreshed. thanks a lot for some help or tutorials. Alain Alain: Try this: http://www.sperling.com/examples/styleswitch/ The demo jumps from one style sheet to another, but with a little alteration it could be expanded to solve your problem. It also stores the user preference in a cookie -- you probably want that as well. However, it does use a POST in the operation, BUT the switch is so fast that the user usually doesn't see it added to the url. Try the above link and see for yourself. HTH's tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 questions: Search in array and detect JS
[snip] script language=javascript !-- location.href = '/url/for/ajax/page.php'; -- /script [/snip] My only concern with this method is that it constitutes an exit trap... For example, if a user connects to your index page from, say, Google they will be redirected over to your Ajax page... All good, except if they click Back to return to the SE page they will immediately bounce back to your Ajax page Something to consider might be: noscript Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser /noscript !-- Normal page functions -- I haven't tested it so there is a chance it's fiction :) Of course, if web standards aren't a concern it makes no difference HTH Dan --- http://chrome.me.uk -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 14:26 To: php Cc: Stut Subject: Re: [PHP] 2 questions: Search in array and detect JS Hey Stut, Thanks for replying. --- The way I do this is to serve the 'notmal page' first, but with the following snippet of JS in it... script language=javascript !-- location.href = '/url/for/ajax/page.php'; -- /script--Makes sense and pretty easy, this was suggested a while back, since you have supported itI think I'll start using this method.--- You should be able to craft some combination of array_walk and a custom function that checks each element with stristr to do what you need. -Actually, I solved this thanks to Richard from the list who suggested strpos, a function I had never usedbefore ( Tedd from the list gave me the same suggestion as you to use stristr, I didnt want to use stristr as its a bit expensive esp with a really large array) the problem I ran into was that strpos is a php5 functionbut reading the user contributed articles on strpos at thephp site I got the code that does exactly that in 2-3 linesCheers! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1490 (20060415) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 questions: Search in array and detect JS
Something to consider might be: noscript Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser /noscript !-- Normal page functions -- I haven't tested it so there is a chance it's fiction :) Of course, if web standards aren't a concern it makes no difference Dan It works and if you want it to validate, just enclose the paragraph in p/p, like so: noscript p Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser. /p /noscript To bad that php within those tags is read regardless or we would have an easy way to detect js. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 questions: Search in array and detect JS
How about ?php $js = true; ? noscript ?php $js = false; ? /noscript ?php if ($js){ // whizzy Ajax code (or file include) } else { // generic warning (or include non-JS base file) } ? I know that would work but does it give the desired effect? Dan --- http://chrome.me.uk -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 15:10 To: Chrome; 'Ryan A'; 'php' Cc: 'Stut' Subject: RE: [PHP] 2 questions: Search in array and detect JS Something to consider might be: noscript Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser /noscript !-- Normal page functions -- I haven't tested it so there is a chance it's fiction :) Of course, if web standards aren't a concern it makes no difference Dan It works and if you want it to validate, just enclose the paragraph in p/p, like so: noscript p Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser. /p /noscript To bad that php within those tags is read regardless or we would have an easy way to detect js. tedd -- http://sperling.com __ NOD32 1.1490 (20060415) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions: Search in array and detect JS
In your script, $js will be false false! Chrome wrote: How about ?php $js = true; ? noscript ?php $js = false; ? /noscript ?php if ($js) { // whizzy Ajax code (or file include) } else { // generic warning (or include non-JS base file) } ? I know that would work but does it give the desired effect? Dan --- http://chrome.me.uk -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 15:10 To: Chrome; 'Ryan A'; 'php' Cc: 'Stut' Subject: RE: [PHP] 2 questions: Search in array and detect JS Something to consider might be: noscript Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser /noscript !-- Normal page functions -- I haven't tested it so there is a chance it's fiction :) Of course, if web standards aren't a concern it makes no difference Dan It works and if you want it to validate, just enclose the paragraph in p/p, like so: noscript p Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser. /p /noscript To bad that php within those tags is read regardless or we would have an easy way to detect js. tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Here is a silly question
Am 2006-04-03 11:58:39, schrieb Wolf: I tend to stick /nav/header.php in for my includes, since I control the server. As long as the site translates root to the main directory of your website and not somewhere else, you can always have your links be /menu.php as server-speak / means rootme. I also use / in my href links in my menus and such so that no matter where the script is called from, it always works. But he is talking about includes, which mean NOT THE WEB-ROOT but the OS-ROOT. Greetings Michelle Konzack -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 questions: Search in array and detect JS
Yep just realised my half-witted mistake (and what tedd was getting at) Sorry about that Dan --- http://chrome.me.uk -Original Message- From: cajbecu [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 15:40 To: Chrome Cc: 'tedd'; 'Ryan A'; 'php'; 'Stut' Subject: Re: [PHP] 2 questions: Search in array and detect JS In your script, $js will be false false! Chrome wrote: How about ?php $js = true; ? noscript ?php $js = false; ? /noscript ?php if ($js) { // whizzy Ajax code (or file include) } else { // generic warning (or include non-JS base file) } ? I know that would work but does it give the desired effect? Dan --- http://chrome.me.uk -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 15:10 To: Chrome; 'Ryan A'; 'php' Cc: 'Stut' Subject: RE: [PHP] 2 questions: Search in array and detect JS Something to consider might be: noscript Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser /noscript !-- Normal page functions -- I haven't tested it so there is a chance it's fiction :) Of course, if web standards aren't a concern it makes no difference Dan It works and if you want it to validate, just enclose the paragraph in p/p, like so: noscript p Sorry! This page requires Javascript to function properly! Please enable it or get a decent browser. /p /noscript To bad that php within those tags is read regardless or we would have an easy way to detect js. tedd __ NOD32 1.1490 (20060415) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions: Search in array and detect JS
js is client-side, php server side... it can't work fabien Chrome wrote: How about ?php $js = true; ? noscript ?php $js = false; ? /noscript ?php if ($js) { // whizzy Ajax code (or file include) } else { // generic warning (or include non-JS base file) } ? I know that would work but does it give the desired effect? Dan --- http://chrome.me.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions: Search in array and detect JS
for js detection, you can use that in a previous page : script type=text/javascript document.write('a href=ajax-page.htmlpage/a'); /script noscripta href=simple-page.htmlpage/a/noscript it is simple, and work fine. no need to have cookies enable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions: Search in array and detect JS
Hey, Thanks for replying. for js detection, you can use that in a previous page : script type=text/javascript document.write('a href=ajax-page.htmlpage/a'); /script noscripta href=simple-page.htmlpage/a/noscript it is simple, and work fine. no need to have cookies enable-Nice, most of the methods discussed focuses on the fact that you are sending this person from a previous page,eg:index.php to- contact_us.phpbut what if you are using AJAX on the first page (eg: index.php)then isnt the location.href = '/url/for/ajax/index2/page.php'; the best solution?Cheers!Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 2 questions: Search in array and detect JS
Ryan A wrote: Hi, Like the subject says; I have two questions: 1) Is it possible to detect JavaScript via php... and yes I do know that JS is client side while PHP is server...but how else to do it? The reason I ask is before serving an AJAX page I would like to make sure JS is enabled, if not, serve the other normal page... I am sure I am not the first person to come accross this little problem, how did you solve it? I have seen some suggestions on google like having a hidden form field and using js to put a value in it, if it exists when the form is sent then JS is on..if not, its not... but that method is not the best in an AJAX situation...right? You don't specifically what would change in the AJAX page (other than make use of AJAX) If it's possible, I would recommend you to serve the normal page and include a snippet to modify its behaviour, so you can save the page reloads (tipical use for AJAX), e.g. window.onload = function( ) { if ( document.frmTest ) { document.frmTest.onSubmit = function( ) { // verify values with ajax before submiting } } } // normal version of the page This way you only change the behaviour when its supported (of course, you would also need a verification for Remote Scripting/AJAX support) And I agree with the others about serving the normal version first, and redirecting via JS (when the behaviour is too different) 2) How can I search in an array for a particular word? eg: in an array movie I have this kind of data: movie_name= some movie cast= Jim Carrey, Richard Pryor, Eddie Murphy I want to search on either Richard or Richard Pryor (must be case insensitive too) something like a SELECT with a LIKE %% statement I have been fooling around with in_array() but not getting anywhere fast. am I on the right track? Links, code examples or advise would be as alwaysappreciated. First, I would suggest you to re-analize why are you searching in an array (of course, you're the only here who knows the reason) Second, you may encounter array_filter() useful, this function uses a callback user-defined function to filter the elements in a given array and build a second (which is the value it returns), so you may use this function along with strpos() (or some other) http://php.net/manual/en/function.array-filter.php -- Atentamente, J. Rafael Salazar MagaƱa Innox - InnovaciĆ³n Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include Problem
Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include Problem
Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problem
Try include($_SERVER['DOCUMENT_ROOT'] . /cms/templates/footer.php); maybe? Dan --- http://chrome.me.uk -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 20:05 To: php-general@lists.php.net Subject: [PHP] Include Problem Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1490 (20060415) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problem
Shaun wrote: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Most assuredly the file isn't there (do you have the include path set?) or the permissions are not sufficient to open the file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 2 questions: Search in array and detect JS
On 4/14/06, Ryan A [EMAIL PROTECTED] wrote: The reason I ask is before serving an AJAX page I would like to make sure JS is enabled, if not, serve the other normal page... I am sure I am not the first person to come accross this little problem, how did you solve it? Dan eluded to a big problem here, regarding the potential exit trap of redirecting a user to a different page. However there's even more at stake--this solution would require you to manage *two* versions of your page. Come on, we can do better than that... What you should do is create your normal page as is, and then write your javascript to attach itself to whatever things you want to AJAXify on that page. Research unobtrusive javascript, it should get you in the right direction. The idea is, you build your page to function normally without any javascript. Then you attempt to hook up the javascript via your page's onload event (there are other methods too I believe, Google it). If javascript is enabled, then the javascript will be hooked in; if not, then no AJAX will be loaded, but your page will still function as needed. HTH, John W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] soapmapper error
Hello, I am trying to connect to a webservice with a wsdl. After creating a new SoapClient, I tried calling one of the methods. It returned this exception. Uncaught SoapFault exception: [SOAP-ENV:Server] SoapMapper:Converting data for SoapMapper failed inside the typemapper in /home/aldug/soap_test.php Other methods on this webservice work fine. How do I go about debugging this problem? Thanks, Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problem
Mark Charette [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Shaun wrote: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Most assuredly the file isn't there (do you have the include path set?) or the permissions are not sufficient to open the file. include_path = .:/lib/php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problem
$_SERVER['DOCUMENT_ROOT'] = /home this isnt the correct path for the file! Chrome [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try include($_SERVER['DOCUMENT_ROOT'] . /cms/templates/footer.php); maybe? Dan --- http://chrome.me.uk -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: 15 April 2006 20:05 To: php-general@lists.php.net Subject: [PHP] Include Problem Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1490 (20060415) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Include Problem
Check the file's permissions with your ftp utility Shaun wrote: Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Common Files
Hi, We have a dedicated UNIX server running FreeBSD, is it possible to set a directory where we can place a set of common files that can be used by all of our web sites? Thanks for your advice -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problem
At 8:03 PM +0100 4/15/06, Shaun wrote: Hi, I am having problems with an include statement, i am using the following statement in an effort to include a footer file on my page: include(/cms/templates/footer.php); However I get the following error: Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(/cms/templates/footer.php): failed to open stream: No such file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line 38 Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion (include_path='.:/lib/php') in /home/m/y/mysite/public_html/cms/news/index.php on line 38 The file is definitely there, the script just doesn't seem to be picking it up, has anyone else had this problem? With your code, I get the exact same error -- however, I don't have the file nor the correct path. So, I think you need to check the path. Try putting the following code in your footer.php and running it directly: print_r($_SERVER['SCRIPT_FILENAME']); That will tell you where the script is located. My guess is that you have a path error somewhere. hth's tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Common Files
We have a dedicated UNIX server running FreeBSD, is it possible to set a directory where we can place a set of common files that can be used by all of our web sites? Sure. Chuck them where-ever you want and then change your include path: http://www.php.net/manual/en/ini.core.php http://www.php.net/manual/en/function.set-include-path.php -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php