Re: [PHP] Help w/ $_SESSION
Hey, I do have it in a variable but I just choose to leave it out. Ive tried so many different things with this and even what you gave me for some reason didnt work. The variables are being set, if I echo $_SESSION['user'] then right data is shown. However as soon as I put it in the mysql_query it stops working. Im using it for a login script that I include at the start of every page. Heres what I got: ?php session_start(); ? ?php $_SESSION['user'] = $_POST['user']; $_SESSION['pass'] = $_POST['pass']; ? ?php $db = mysql_connect($host, user, pass); mysql_select_db($dtb,$db); $result = mysql_query(select count(*) AS numfound from admins where user='{$_SESSION['user']}' AND pass='{$_SESSION['pass']}',$db); echo .$_SESSION['user']. .$_SESSION['pass'].; $result_ar = mysql_fetch_array($result); if ($result_ar['numfound'] 1) { session_unset(); session_destroy(); include(error.php); exit; } ? I include that at the top of every page I want to protect. Lee Jason Wong [EMAIL PROTECTED] wrote in message news:200211121537.49604.php-general;gremlins.com.hk... On Tuesday 12 November 2002 15:05, conbud wrote: Hey, How would I insert $_SESSION['user'] and $_SESSION['pass'] into this mysql_query(select count(*) AS numfound from admins where user='$user' AND pass='$pass',$db); right now I have $_SESSION['user'] = $_POST['user'] $_SESSION['pass'] = $_POST['pass'] and I need to put $_SESSION['user'] where the $user is in the above statement and so one w/ $pass You mean like this? mysql_query(select count(*) AS numfound from admins where user='{$_SESSION['user']}' AND pass='{$_SESSION['pass']}',$db); BTW, it is much better to assign your query to a variable, eg $qry, then do mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); That way if your query doesn't work you'll at least know why. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Perhaps the biggest disappointments were the ones you expected anyway. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help w/ $_SESSION
Also the echo statement is just there for testing purposes to make sure the variable were containing the correct data. Lee Conbud [EMAIL PROTECTED] wrote in message news:20021112075942.16291.qmail;pb1.pair.com... Hey, I do have it in a variable but I just choose to leave it out. Ive tried so many different things with this and even what you gave me for some reason didnt work. The variables are being set, if I echo $_SESSION['user'] then right data is shown. However as soon as I put it in the mysql_query it stops working. Im using it for a login script that I include at the start of every page. Heres what I got: ?php session_start(); ? ?php $_SESSION['user'] = $_POST['user']; $_SESSION['pass'] = $_POST['pass']; ? ?php $db = mysql_connect($host, user, pass); mysql_select_db($dtb,$db); $result = mysql_query(select count(*) AS numfound from admins where user='{$_SESSION['user']}' AND pass='{$_SESSION['pass']}',$db); echo .$_SESSION['user']. .$_SESSION['pass'].; $result_ar = mysql_fetch_array($result); if ($result_ar['numfound'] 1) { session_unset(); session_destroy(); include(error.php); exit; } ? I include that at the top of every page I want to protect. Lee Jason Wong [EMAIL PROTECTED] wrote in message news:200211121537.49604.php-general;gremlins.com.hk... On Tuesday 12 November 2002 15:05, conbud wrote: Hey, How would I insert $_SESSION['user'] and $_SESSION['pass'] into this mysql_query(select count(*) AS numfound from admins where user='$user' AND pass='$pass',$db); right now I have $_SESSION['user'] = $_POST['user'] $_SESSION['pass'] = $_POST['pass'] and I need to put $_SESSION['user'] where the $user is in the above statement and so one w/ $pass You mean like this? mysql_query(select count(*) AS numfound from admins where user='{$_SESSION['user']}' AND pass='{$_SESSION['pass']}',$db); BTW, it is much better to assign your query to a variable, eg $qry, then do mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); That way if your query doesn't work you'll at least know why. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Perhaps the biggest disappointments were the ones you expected anyway. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mcrypt Under IIS 5 / Win32?
I'm trying to load it via php.ini w/ extension=php_mcrypt.dll and php_mcrypt.dll is in the extension_dir - When php_mcrypt.dll is not in the right place, it tells me it can't load the dll. Is there something other than the cygwin1.dll and php_mcrypt.dll that I have to install on the system - all the documentation (what little there is that I have found) has said that I don't need anything other than these 2 files. -Original Message- From: Ray Hunter [mailto:[EMAIL PROTECTED]] Sent: Monday, November 11, 2002 12:48 PM To: Nick Richardson Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32? Basically, Are you loading the dll via the file or php? Make sure that the directory(s) where the dlls are located are in your windows path. If that doesnt work then you can always put the dll in your systems dll directory... On Mon, 2002-11-11 at 19:58, Nick Richardson wrote: Ok, another question if you can help. I have (I think) all the components I need (cygwin1.dll, php_mcrypt.dll, etc...). Php_mcrypt.dll is in the PHP dir, everything else is in %windir%. When I try to use any of the mcrypt stuff now, I get: PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The specified procedure could not be found. in Unknown on line 0 You have any idea what I might be doing wrong? //Nick -Original Message- From: .: B i g D o g :. [mailto:[EMAIL PROTECTED]] Sent: Monday, November 11, 2002 4:50 AM To: Nick Richardson Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32? You need to uncomment the dll in the php.ini file...do a search for it and then uncomment it or add it to the php.ini file... That will load it... *Note: i would add that directory to your path that contains the mcrypt dll or all dlls for php and the extension directory to... On Mon, 2002-11-11 at 19:42, Nick Richardson wrote: Yes, there is a DLL for it, but getting PHP to know it is there is where I'm having the problem - I don?t know how to get PHP to under windows to do the equivalent of --with-mcrypt in configure under linux. - maybe I havn't registered the mcrypt dll's correctly or something like that... But I just can't get it to work. Everytime I try to do it I get 'call to undefined function . ' //Nick -Original Message- From: .: B i g D o g :. [mailto:[EMAIL PROTECTED]] Sent: Monday, November 11, 2002 4:37 AM To: Nick Richardson Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32? is there not a dll for mcrypt? On Mon, 2002-11-11 at 19:34, Nick Richardson wrote: I asked this before, but didn't get a response. Anyone out there have any experience a/o know where I can find information on getting the mcrypt functionality to work under Win32 - I have found a port of mcrypt for Win32, and also learned that you can compile it using cygwin - but I don?t know how to register mcrypt w/ PHP and 'turn on' the mcrypt* functions. If anyone has any information or urls / how-tos it would be greatly appreciated! Thanks! //Nick Richardson // [EMAIL PROTECTED] --- Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002 -- .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002 -- Thank you, Ray Hunter --- Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help w/ $_SESSION
On Tuesday 12 November 2002 15:59, conbud wrote: Hey, I do have it in a variable but I just choose to leave it out. Ive tried so many different things with this and even what you gave me for some reason didnt work. *Why* doesn't it work? The variables are being set, if I echo $_SESSION['user'] then right data is shown. However as soon as I put it in the mysql_query it stops working. Im using it for a login script that I include at the start of every page. Heres what I got: I repeat: mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); That way if your query doesn't work you'll at least know why. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Matz's Law: A conclusion is the place where you got tired of thinking. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can PHP perform DNS zone transfers etc.?
Hello. I'm about to write a DNS-related project in PHP4 and would like to use TSIG-signed DNS-updates, AXFR-based zonetransfers etc. When using Perl I could use the excellent Net::DNS module for this. Does anyone know if there exists anything like that for PHP4? I have searched on the PHP website and the mailinglists without finding anything like that. -- Regards Eivind Olsen [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can somebody help me with making a login Script?
Hi Matt, can somebody please help me make an login script step one by one? My website is Http://tweak2x.cjb.net and I am looking for a login section for memebers. Start by reading this article: http://zend.com/zend/tut/authentication.php And then get back to us with any problems you run into. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] random numbers
Hi Tamas, /* srand is not important since php v=4.2.0 */ $numbers = range (1,90); $x = array_rand ($numbers, 5); foreach ($x as $v) echo {$numbers[$v]} ; It works fine, except the first query: php may restart the random numbers, if it is not used for some seconds. I'm not sure how to solve this, but I'm curious as to why you don't want to use mt_rand: ?php for ($i=1; $i=6; $i++) $x[] = mt_rand(1, 90); foreach ($x as $current) echo $current. br /; ? You still get an array at the end of it, which seems to be what you're after. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _POST _GET
**WARNING** longer post that usual **WARNING** longer post that usual **WARNING** At 07:54 12.11.2002, Chris Shiflett said: [snip] Anyway, thanks for your insight. Some of these slightly off-topic issues are more interesting than the on-topic ones. :-) Maybe our community needs a historian to collect some of this information for those of us who are interested (or am I the only one?). [snip] It's slightly more than historical - in fact the behavior of GET and POST is quite clearly laid out in RFC2616 (http://ftp.rfc-editor.org/in-notes/rfc2616.txt) which represents the proposed standard for HTTP/1.1. To start with, data passed within the URI is called query, as laid out in rfc2616, 3.2.2: 3.2.2 http URL The http scheme is used to locate network resources via the HTTP protocol. This section defines the scheme-specific syntax and semantics for http URLs. http_URL = http: // host [ : port ] [ abs_path [ ? query ]] [...] Si I assume the correct way to call our GET variables would be query variables, and the $_GET superglobal should rather be the $_QUERY superglobal... Rfc2616 also deals with the server side implications of GET and POST methods: 9.1.1 Safe Methods Implementors should be aware that the software represents the user in their interactions over the Internet, and should be careful to allow the user to be aware of any actions they might take which may have an unexpected significance to themselves or others. In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered safe. This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is made aware of the fact that a possibly unsafe action is being requested. Naturally, it is not possible to ensure that the server does not generate side-effects as a result of performing a GET request; in fact, some dynamic resources consider that a feature. The important distinction here is that the user did not request the side-effects, so therefore cannot be held accountable for them. In plain english, developers SHOULD use $_GET variables only to _compose_ information, not to take some action to _create_ information. We should always be aware that an URI can always be saved in a link collection (Favirites), or used as a link target, as opposed to POSTed data. 9.5 POST The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions: - Annotation of existing resources; - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - Providing a block of data, such as the result of submitting a form, to a data-handling process; - Extending a database through an append operation. The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. [...] Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource. [...] This is as clear as it can be - use POST to perform server-side actions with side effects, like creating a database entity, modifying/deleting a document, etc. Contrary to GET, a POST URI cannot be saved or hyperlinked to, at least not in conjunction with posted data. Of course the RFC is quite alert of any side effects that might be introduced by us developers ;- and adds as a note: 13.9 Side Effects of GET and HEAD Unless the origin server explicitly prohibits the caching of their responses, the application of GET and HEAD methods to any resources SHOULD NOT have side effects that would lead to erroneous behavior if these responses are taken from a cache. They MAY still have side effects, but a cache is not required to consider such side effects in its caching decisions. Caches are always expected to observe an origin server's explicit restrictions on caching. We note one exception to this rule: since some applications have traditionally used GETs
Re: [PHP] random numbers
Jon! ?php for ($i=1; $i=6; $i++) $x[] = mt_rand(1, 90); foreach ($x as $current) echo $current. br /; ? Thanks for help, but your program may generate same numbers between the 5 generated numbers, hovewer I want to generate different numbers such as lottery-numbers. array_rand() is a very nice solution for this problem, other solutions with mt_rand() should be much longer. (I should care about if this random number has generated already or not) But if this is the only solution I'll do it in this way... (in this case there are a lot of useless php functions, that use random numbers adjusted to the simple srand() such as shuffle()) Tamas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Timer + Java
At 22:28 11.11.2002, Mohsin Rahman said: [snip] 1) How to pass the STARTTIME only when the START TASK button is pressed? Apprently using echo input type=button value=\Start\ onclick=\window.open('popup.html?clientid=$starttime=strtotime(\now\)$th isclientidprojectid=$thisclientid','TEST','height=200,width=300,resizable=y es,toolbar=no,status=no,menubar=no,scrollbars=no')\; does not pass the unixtime (now) to the popup. You're merging the function call strtotime() into a string - that won't work. The other query parameters seem also not to be correctly identified. Try this: $starttime = =strtotime('now'); $uri = 'popup.html?' . clientid=$thisclientid . projectid=$thisprojectid . starttime=$starttime; echo 'input type=button value=Start', 'onclick=window.open(\'', $uri, '\',\'TEST\',', '\'height=200,width=300,resizable=yes,toolbar=no,', 'status=no,menubar=no,scrollbars=no\')'; 2). Since this is a Java popup, how do I get the close form action back and insert my endtime into the database from the popup? I don't know - this depends on how the Java applet is written. Basically it should issue a request to an URI passing either the time, or the elapsed time, as a parameter. Caution - this would pass the time at the client workstation which might differ considerably from the server time. I'd suggest a solution where the server generates some kind of client token that's passed to the Java applet. The server would then associate this token with what he knows as project start time. Upon hitting the stop button at the client's the applet would just pass back this token, annotated by the action (stop, reset, cancel, whatever). The server would then have a chance to take the appropriate action. 3). How do I mix php in a Java function? You don't. PHP is a server side issue, Java runs at the client's (at least in this scenario). The client browser starts the Java applet on behalf of the HTML code your server-side application outputs. The Java applet can only communicate with the server using URI requests. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] random numbers
Hi Tamas, ?php for ($i=1; $i=6; $i++) $x[] = mt_rand(1, 90); foreach ($x as $current) echo $current. br /; ? Thanks for help, but your program may generate same numbers between the 5 generated numbers, hovewer I want to generate different numbers such as lottery-numbers. That's not a problem: just add a couple of lines to test for existence: $i = 0; while ($i6) { $pick = mt_rand(1, 90); if (!in_array($pick, $x)) { $x[] = $pick; $i++; } } But if this is the only solution I'll do it in this way. It's *never* the only solution :-) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Rotation of images
I can use ImageMagick to rotate images, and that would be my preferred technique, but I was wondering how you might use GD to rotate images. As far as I can see, it's not possible. Anyone tried it? Mick e-ssociate EPSON (UK) Ltd. Tel 01442 227374 www.epson.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Genrate a graph
Howdi All Anyone know if there is a function in php that can take values and generate a graph ??? Thanks in advance C -- Chris Grigor -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Genrate a graph
No, there is not, but there are classes for that, look for jgraph Chris Grigor wrote: Howdi All Anyone know if there is a function in php that can take values and generate a graph ??? Thanks in advance C -- Chris Grigor -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] left click downloads
I want to make it easier for people to download files from my website by having the download start when the visitor clicks a link (as opposed to right click / save target as). How can I achieve this with PHP? Do I include the file in a header() call ? Thanks, javier _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Genrate a graph
On Tuesday 12 November 2002 19:04, Marek Kilimajer wrote: No, there is not, but there are classes for that, look for jgraph I believe you mean jpgraph ! -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* When angry, count four; when very angry, swear. -- Mark Twain, Pudd'nhead Wilson's Calendar */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Genrate a graph
Yes, you are right, I was too lazy to look it up :-) Jason Wong wrote: On Tuesday 12 November 2002 19:04, Marek Kilimajer wrote: No, there is not, but there are classes for that, look for jgraph I believe you mean jpgraph ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Would appreciate thoughts on session management
Seems to me like this would generate a lot of extra server traffic, and a little confusion... The only benefit I can see is that you're getting rid of ugly page URLs. Problems I can see: 1. sessions need to be carried around... if your user has cookies turned off, or you wish not to use them; a) the sessions will break, or b) you will need to carry the SID around in a URL So, your URLs will actually look like http://www.site.com/article.php?PHPSESSID=12413523245546453 Nothing I can see in your code/idea changes the fact that EACH INSTANCE OF A SCRIPT NEEDS TO MAINTAIN STATE (carry the session around). You have two choices: - cookies - URL - compile with trans-sid -- uses cookies if possible, otherwise uses URL I have never seen anything else work. 2. bookmarking/linking/etc... essentially what you're saying is that one URL, page.php, will do many different things (like present many different articles), based on session information... this doesn't sound to good to me... bookmarking, search engines, etc etc might all get it wrong, and certainly would make it hard for people to email the URL to a friend, or link to it from another site. You *may* want to consider the apache mod_rewrite stuff. I spotted an article on sitepoint.com about it erm... here we go: http://www.webmasterbase.com/article/910 Instead of: http://site.com/page.php?article=4, you can do things like: http://site.com/page.php/article/4, which are very bookmark / link / session / searchengine friendly. Just one last note... PHP sessions, by default, store the session variables in files transparently (ie, you don't have to do much), NOT a database. So, writing a script that requires sessions will NOT require MySQL. Just look at amazon, yahoo, msn, or any other big site... they just pass the sid around in URLs, and people deal with it. Learn from the best. Cheers, Justin on 12/11/02 5:55 PM, Charles Wiltgen ([EMAIL PROTECTED]) wrote: I posted this yesterday: Specifically, I'm considering using hidden fields for persistent object properties because (1) I don't want cookies to be an issue, (2) I prefer not to have session IDs appear in a URL, and (3) I prefer not to use require a database just to store persistent properties. After Justin and Ernest straightened me out, I went back to the drawing board and came up with a method that I call Invisible GET. Let's say my page is at http://www.getsome.com/. When I want to change the month (for example), I... (1) Open http://www.getsome.com/submit.php?month=3; target=http://www.getsome.com/. (2) In submit.php script, I throw all $_REQUEST variables (except target and PHPSESSID) into $_SESSION variables, and... (3) ...redirect to $_REQUEST['target'] via header(). I've sure I've invented something that nobody's done before. :^P This method feels about perfect. Users won't be seeing or bookmarking garbage-filled URLs, and I'm not using lots of hacky stuff to achieve it. I wish I could generate submit.php on the fly, though -- I'm trying very hard not to pollute the web folder with anything that I don't have to, and file creation/deletion is very expensive since I have to do it via FTP. Any ideas on this one? -- Charles Wiltgen Justin French Creative Director http://Indent.com.au Web Developent Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Here Document on Mac OS X
I have been trying to include an echo statement incorporating a here document on pages being served by my Mac OS X (v10.1.5) and Apache (v1.3) When I try to browse test.php, which contains... ?php echoENDOFECHO html hello...hello... /html ENDOFECHO; ? I get a parse error. When I upload it to my ISP it works as expected, but again it won't work on my server. What can I change or where can I go for an answer. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rotation of images
You could write your own rotation code, moving every pixel one by one, Otherwise I've not used GD enough to know one... but actually quickly looking at the GD Function list I found: http://www.php.net/manual/en/function.imagerotate.php Voila Andrew - Original Message - From: Sear, Mick [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 10:43 AM Subject: [PHP] Rotation of images I can use ImageMagick to rotate images, and that would be my preferred technique, but I was wondering how you might use GD to rotate images. As far as I can see, it's not possible. Anyone tried it? Mick e-ssociate EPSON (UK) Ltd. Tel 01442 227374 www.epson.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
Re: [PHP] left click downloads
Yes. Just make a header appropriate for browser to understand that it should fire up the download dialog. -- Maxim Maletsky [EMAIL PROTECTED] Javier Montserat [EMAIL PROTECTED] wrote... : I want to make it easier for people to download files from my website by having the download start when the visitor clicks a link (as opposed to right click / save target as). How can I achieve this with PHP? Do I include the file in a header() call ? Thanks, javier _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- 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] Can somebody help me with making a login Script?
Also, look up on PHP Beginner, it was covered on it: www.phpbeginner.com -- Maxim Maletsky [EMAIL PROTECTED] Jon Haworth [EMAIL PROTECTED] wrote... : Hi Matt, can somebody please help me make an login script step one by one? My website is Http://tweak2x.cjb.net and I am looking for a login section for memebers. Start by reading this article: http://zend.com/zend/tut/authentication.php And then get back to us with any problems you run into. Cheers Jon -- 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] Help w/ $_SESSION
what PHP version are you running? $_SESSION variable is only available since PHP v4.1.0 and, btw, you always need to use session_start() before using it. -- Maxim Maletsky [EMAIL PROTECTED] Jason Wong [EMAIL PROTECTED] wrote... : On Tuesday 12 November 2002 15:59, conbud wrote: Hey, I do have it in a variable but I just choose to leave it out. Ive tried so many different things with this and even what you gave me for some reason didnt work. *Why* doesn't it work? The variables are being set, if I echo $_SESSION['user'] then right data is shown. However as soon as I put it in the mysql_query it stops working. Im using it for a login script that I include at the start of every page. Heres what I got: I repeat: mysql_query($qry, $db) or die('Error in $qry ' . mysql_error()); That way if your query doesn't work you'll at least know why. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Matz's Law: A conclusion is the place where you got tired of thinking. */ -- 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] Oracle 7 support
Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). Also, is there a doc containing all levels of support for 3rd party products? save me pestering the list in future. I couldn't locate it myself though. Many thanks, -- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council. Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system. Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] left click downloads
At 13:15 12.11.2002, Maxim Maletsky said: [snip] Yes. Just make a header appropriate for browser to understand that it should fire up the download dialog. [snip] To force virtually any browser into download mode, specify your content being an application/octet-stream: header('Content-Type: application/octet-stream'); Of course, if you're serving an MSWord document (phew) you might have MSWord open directly in the browser: header('Content-Type: application/msword'); -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP not working in html
PHP isn't working in my html docs - what changes do I need to make to get it to do so? Does it need to be recompiled? Can I do it without re-compiling? Give your file a .php extension, maybe? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do i make an upload script?
How do i make an upload script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what happen to comments in php documntation
I dont see any comments where is this useful comments go ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Here Document on Mac OS X
Hello, Craig Buxton [EMAIL PROTECTED] wrote: I have been trying to include an echo statement incorporating a here document on pages being served by my Mac OS X (v10.1.5) and Apache (v1.3) When I try to browse test.php, which contains... ?php echoENDOFECHO html hello...hello... /html ENDOFECHO; ? I get a parse error. When I upload it to my ISP it works as expected, but again it won't work on my server. What can I change or where can I go for an answer. I did a copy and paste and your code works fine. Perhaps, you can (1) post the exact error message (2) check whether you uploaded *the same* file :) (3) make sure that there's no spaces, etc. after the semi-colon ENDOFECHO; - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] what happen to comments in php documntation
Hello, Alawi albaity [EMAIL PROTECTED] wrote: I dont see any comments where is this useful comments go ? ...you just missed these: http://marc.theaimsgroup.com/?l=php-generalm=103705820013067w=2 http://marc.theaimsgroup.com/?l=php-generalm=103706935420920w=2 - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do i make an upload script?
(B"Tweak2x" [EMAIL PROTECTED] wrote in message (B[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... (B How do i make an upload script? (B (B http://us.php.net/manual/en/features.file-upload.php (B (B- E (B (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do i make an upload script?
Hi, How do i make an upload script? You need an HTML form with an input type=file element, and a script to handle the upload. Post your code and tell us what problems you're having. If you haven't written any code yet, go and read this section of the manual: http://www.php.net/manual/en/features.file-upload.php Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: echo w/ here document
I'm still having a problem with including a here document. Trying this code: ?php echo ENDOFECHO HTML BODY hello... hello... hello... hello... /BODY /HTML ENDOFECHO; ? I get a parse error on line 7. Please help. I have a major project that has ground to a halt. Craig Buxton Gravity Pilot Productions [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include file with parameters
hello PHP developers, I am going to convert a site that works with frames to the equivalent with includes. I have several template files whic behaves according to query string parameters. I don't want to make big changes, just make it work. ?php include(tmplt1.php?var1=val1var2=val2); ? Is that possible? I lasltly consider the solutions that states convert into functions :-) Regards, yi almalar. Fikret CAN Pergel Group letiim Hizmetleri A. Akkirman Sok. No:59 80220 Nianta - stanbul Tel: (0 212) 230 01 91 / 145 Fax: (0 212) 241 59 12
RE: [PHP] Oracle 7 support
-Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 12:18 Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? Yes. I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). No -- the OCI8 functions are actually recommended for Oracle 7 upwards. The ora_* functions are older and do not use the newer OCI methodology. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] phpweb mirror w/o rsync
Hello! I make copy of phpweb module using cvs, and now I just want to run php website on my local machine, but can't find mirrors.inc: Fatal error: Failed opening required 'mirrors.inc' (include_path='.:/bd/src/phpweb/include') in /bd/src/phpweb/include/site.inc on line 12 What wrong? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Here Document on Mac OS X
On Tuesday 12 November 2002 20:05, Craig Buxton wrote: I have been trying to include an echo statement incorporating a here document on pages being served by my Mac OS X (v10.1.5) and Apache (v1.3) When I try to browse test.php, which contains... ?php echoENDOFECHO html hello...hello... /html ENDOFECHO; ? I get a parse error. When I upload it to my ISP it works as expected, but again it won't work on my server. What can I change or where can I go for an answer. I think it's something to do with the end of line character -- you have to use a single linefeed character (0Ah). Try searching the archives, I think this issue cropped up a few weeks ago. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Man 1: Ask me the what the most important thing about telling a good joke is. Man 2: OK, what is the most impo -- Man 1: __TIMING! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include file with parameters
On Tuesday 12 November 2002 15:55, Fikret CAN wrote: hello PHP developers, I am going to convert a site that works with frames to the equivalent with includes. I have several template files whic behaves according to query string parameters. I don't want to make big changes, just make it work. ?php include(tmplt1.php?var1=val1var2=val2); ? Try this way: ?php $var1=val1; $var2=val2; include(tmplt1.php); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re: echo w/ here document
Looks ok to me. Try making sure that all white space is removed from after the echo ENDOFECHO, and both before and after the ENDOFECHO; line. Heredocs don't play nicely with white space... -- Aaron Gould [EMAIL PROTECTED] Web Developer Parts Canada - Original Message - From: Craig Buxton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 5:32 AM Subject: [PHP] re: echo w/ here document I'm still having a problem with including a here document. Trying this code: ?php echo ENDOFECHO HTML BODY hello... hello... hello... hello... /BODY /HTML ENDOFECHO; ? I get a parse error on line 7. Please help. I have a major project that has ground to a halt. Craig Buxton Gravity Pilot Productions [EMAIL PROTECTED] -- 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] include file with parameters
On Tuesday 12 November 2002 15:55, Fikret CAN wrote: hello PHP developers, I am going to convert a site that works with frames to the equivalent with includes. I have several template files whic behaves according to query string parameters. I don't want to make big changes, just make it work. ?php include(tmplt1.php?var1=val1var2=val2); ? You don't need to pass vars to an include file. Whatever variables are available to the main script at the time of the include() are available to the included file. It's the same as copying that code into your main file at that point. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re: echo w/ here document
Works fine on my system. As Aaron said, make sure there are no spaces around ENDOFECHO; Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Check us out on the web at http://www.phparch.com On Tue, 2002-11-12 at 08:21, Aaron Gould wrote: Looks ok to me. Try making sure that all white space is removed from after the echo ENDOFECHO, and both before and after the ENDOFECHO; line. Heredocs don't play nicely with white space... -- Aaron Gould [EMAIL PROTECTED] Web Developer Parts Canada - Original Message - From: Craig Buxton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 5:32 AM Subject: [PHP] re: echo w/ here document I'm still having a problem with including a here document. Trying this code: ?php echo ENDOFECHO HTML BODY hello... hello... hello... hello... /BODY /HTML ENDOFECHO; ? I get a parse error on line 7. Please help. I have a major project that has ground to a halt. Craig Buxton Gravity Pilot Productions [EMAIL PROTECTED] -- 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] PHP seg faulting
Afternoon: I'm having problems with PHP CGI crashing and I have no idea why. The script I'm running hasn't changed, nor has the server setup. It ran fine for several weeks and then started crashing. I rebooted the server (FreeBSD 4.6) and it was fine for a couple of days... now its crashing again. I was running PHP 4.2.1. I upgraded to 4.2.3 and its still doing it. Here is a backtrace, but its all greek to me. Can anyone explain what on earth all this means? Thanks Mike #0 0x28353386 in localeconv () from /usr/lib/libc.so.4 #1 0x28364ee1 in strtod () from /usr/lib/libc.so.4 #2 0x8127ac1 in is_numeric_string (str=0x81fe224 SELECT, length=6, lval=0xbbc00164, dval=0xbbc00158, allow_errors=0 '\000') at zend_operators.h:94 #3 0x81276fa in zendi_smart_strcmp (result=0xbbc00348, s1=0xbe84f24, s2=0x82bd4fc) at zend_operators.c:1653 #4 0x8126346 in compare_function (result=0xbbc00348, op1=0xbe84f24, op2=0x82bd4fc) at zend_operators.c:1128 #5 0x8126c2a in is_equal_function (result=0xbbc00348, op1=0xbe84f24, op2=0x82bd4fc) at zend_operators.c:1276 #6 0x814d64f in execute (op_array=0x82b9d24) at ./zend_execute.c:1114 #7 0x8150337 in execute (op_array=0x82ca224) at ./zend_execute.c:1638 #8 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #9 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 (another 59,052 of these) ... #59061 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59062 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59063 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59064 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59065 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59066 0x8150337 in execute (op_array=0x8206b24) at ./zend_execute.c:1638 #59067 0x81208b3 in call_user_function_ex (function_table=0x821a698, object_pp=0x81fcc30, function_name=0x81fdd24, retval_ptr_ptr=0xbfbfd810, param_count=3, params=0x826bc64, no_separation=1, symbol_table=0x0) at zend_execute_API.c:517 #59068 0x812019d in call_user_function (function_table=0x81ac040, object_pp=0x82a6b60, function_name=0x821eae4, retval_ptr=0x826bda4, param_count=3, params=0xbfbfd8a8) at zend_execute_API.c:373 #59069 0x80f1f21 in xml_call_handler (parser=0x82a6b24, handler=0x821eae4, argc=3, argv=0xbfbfd8a8) at xml.c:375 #59070 0x80f2922 in _xml_startElementHandler (userData=0x82a6b24, name=0x81f3a40 event, attributes=0x82a6c10) at xml.c:657 #59071 0x80f7b53 in doContent (parser=0x81bfc00, startTagLevel=0, enc=0x816ebc0, s=0x82e617a event date=\20021112 16:15:00\ venue=\Newmarket\outcome price=\SP\ id=\31,PAI370676\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370677\ saddlecloth=\2\ /outcome price=\NR\ id=\31,PAI370678\ ..., end=0x82e9779 , nextPtr=0x0) at xmlparse.c:1659 #59072 0x80f705a in contentProcessor (parser=0x81bfc00, start=0x82e504a bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370738\ saddlecloth=\2\..., end=0x82e9779 , endPtr=0x0) at xmlparse.c:1349 #59073 0x80f9ee2 in doProlog (parser=0x81bfc00, enc=0x816ebc0, s=0x82e504a bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370738\ saddlecloth=\2\..., end=0x82e9779 , tok=29, next=0x82e504a bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370738\ saddlecloth=\2\..., nextPtr=0x0) ---Type return to continue, or q return to quit--- at xmlparse.c:2687 #59074 0x80f9a54 in prologProcessor (parser=0x81bfc00, s=0x82e5024 ?xml version=\1.0\ encoding=\utf-8\?bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=..., end=0x82e9779 , nextPtr=0x0) at xmlparse.c:2523 #59075 0x80f99ea in prologInitProcessor (parser=0x81bfc00, s=0x82e5024 ?xml version=\1.0\ encoding=\utf-8\?bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=..., end=0x82e9779 , nextPtr=0x0) at xmlparse.c:2512 #59076 0x80f68c8 in php_XML_Parse (parser=0x81bfc00, s=0x82e5024 ?xml version=\1.0\ encoding=\utf-8\?bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=..., len=18261, isFinal=1) at xmlparse.c:1103 #59077 0x80f4864 in zif_xml_parse (ht=3, return_value=0x81fdc24, this_ptr=0x0, return_value_used=1) at xml.c:1341 #59078 0x8150156 in execute (op_array=0x82060a4) at ./zend_execute.c:1598 #59079 0x8150337 in execute
[PHP] testing
testing __ Do You Yahoo!? Great flight deals, travel info and prizes! http://sg.travel.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] re: echo w/ here document
Newbie here. Works fine for me too. -Original Message- From: Marco Tabini [mailto:marcot;tabini.ca] Sent: Tuesday, November 12, 2002 5:31 AM To: Aaron Gould Cc: Craig Buxton; Subject: Re: [PHP] re: echo w/ here document Works fine on my system. As Aaron said, make sure there are no spaces around ENDOFECHO; Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Check us out on the web at http://www.phparch.com On Tue, 2002-11-12 at 08:21, Aaron Gould wrote: Looks ok to me. Try making sure that all white space is removed from after the echo ENDOFECHO, and both before and after the ENDOFECHO; line. Heredocs don't play nicely with white space... -- Aaron Gould [EMAIL PROTECTED] Web Developer Parts Canada - Original Message - From: Craig Buxton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 5:32 AM Subject: [PHP] re: echo w/ here document I'm still having a problem with including a here document. Trying this code: ?php echo ENDOFECHO HTML BODY hello... hello... hello... hello... /BODY /HTML ENDOFECHO; ? I get a parse error on line 7. Please help. I have a major project that has ground to a halt. Craig Buxton Gravity Pilot Productions [EMAIL PROTECTED] -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle 7 support
Dan Field [EMAIL PROTECTED] wrote... : Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? Yes, it is. Oracle extension is supporting Oracle 7th version, while OCI8 is primarily for 8 and 9th versions, they might be also working for Oracle 7. I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). Generic (ora_*) are for Oracle 7 and up, OCI8 is for 8 and 9. Also, is there a doc containing all levels of support for 3rd party products? save me pestering the list in future. I couldn't locate it myself though. Official manual has a list of PHP extension - that is what one should read. -- Maxim Maletsky [EMAIL PROTECTED] Many thanks, -- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council. Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system. Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. -- 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] testing
I think it works. ;) -Original Message- From: pig pig [mailto:pigpig8080;yahoo.com.sg] Sent: Tuesday, November 12, 2002 5:44 AM To: [EMAIL PROTECTED] Subject: [PHP] testing testing __ Do You Yahoo!? Great flight deals, travel info and prizes! http://sg.travel.yahoo.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] Oracle 7 support
OCI 7 does not need any modification to support 8 and 9 but they aren't as powerful, thus should only be used for Oracle 7. OCI8 is the 8th OCI and fully supports Oracle 8 with and Oracle 9. For Oracle 9 there are a few thing that are missing, but overall can be safely used on high level production environments. We interface 3.5 Terrabytes Oracle 8 database framework for an e-government project using PHP's OCI8 extension. -- Maxim Maletsky [EMAIL PROTECTED] Ford, Mike [LSS] [EMAIL PROTECTED] wrote... : -Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 12:18 Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? Yes. I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). No -- the OCI8 functions are actually recommended for Oracle 7 upwards. The ora_* functions are older and do not use the newer OCI methodology. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- 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] Problem with header redirect with register_globals off
Hi All, I am having problem with redirecting using header function with register_globals off. It works fine on my PC but not on the site as the register_globals is off on the server. When redirecting on the server it gave an CGI error: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: I am using session to pass some variables to the target page, could this cause the problem? Is there a work around for this problem? Thanks in advance. CK Ong __ Do You Yahoo!? Great flight deals, travel info and prizes! http://sg.travel.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Oracle 7 support
On Tue, 2002-11-12 at 13:03, Ford, Mike [LSS] wrote: -Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 12:18 Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? Yes. I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). No -- the OCI8 functions are actually recommended for Oracle 7 upwards. The ora_* functions are older and do not use the newer OCI methodology. That is great news, thanks Mike. My second problem then lies with my current PHP Setup. I have been using the binary RPMs from RedHat up to now, which do not sem to have been compiled with the Oracle functionality included. If I recompile PHP, will I need the Oracle headers on the machine also? If so this could be a problem as the Oracle server I wish to use is not on the same machine as the webserver. Cheers -- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council. Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system. Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with header redirect with register_globals off
Can you post some code? Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Check us out on the web at http://www.phparch.com On Tue, 2002-11-12 at 08:52, pig pig wrote: Hi All, I am having problem with redirecting using header function with register_globals off. It works fine on my PC but not on the site as the register_globals is off on the server. When redirecting on the server it gave an CGI error: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: I am using session to pass some variables to the target page, could this cause the problem? Is there a work around for this problem? Thanks in advance. CK Ong __ Do You Yahoo!? Great flight deals, travel info and prizes! http://sg.travel.yahoo.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] PHP seg faulting
Try posting this on bugs.php.net onto the appropriate category. Add the output too. There you will have more chances to know why this happens. -- Maxim Maletsky [EMAIL PROTECTED] Mike Hall [EMAIL PROTECTED] wrote... : Afternoon: I'm having problems with PHP CGI crashing and I have no idea why. The script I'm running hasn't changed, nor has the server setup. It ran fine for several weeks and then started crashing. I rebooted the server (FreeBSD 4.6) and it was fine for a couple of days... now its crashing again. I was running PHP 4.2.1. I upgraded to 4.2.3 and its still doing it. Here is a backtrace, but its all greek to me. Can anyone explain what on earth all this means? Thanks Mike #0 0x28353386 in localeconv () from /usr/lib/libc.so.4 #1 0x28364ee1 in strtod () from /usr/lib/libc.so.4 #2 0x8127ac1 in is_numeric_string (str=0x81fe224 SELECT, length=6, lval=0xbbc00164, dval=0xbbc00158, allow_errors=0 '\000') at zend_operators.h:94 #3 0x81276fa in zendi_smart_strcmp (result=0xbbc00348, s1=0xbe84f24, s2=0x82bd4fc) at zend_operators.c:1653 #4 0x8126346 in compare_function (result=0xbbc00348, op1=0xbe84f24, op2=0x82bd4fc) at zend_operators.c:1128 #5 0x8126c2a in is_equal_function (result=0xbbc00348, op1=0xbe84f24, op2=0x82bd4fc) at zend_operators.c:1276 #6 0x814d64f in execute (op_array=0x82b9d24) at ./zend_execute.c:1114 #7 0x8150337 in execute (op_array=0x82ca224) at ./zend_execute.c:1638 #8 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #9 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 (another 59,052 of these) ... #59061 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59062 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59063 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59064 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59065 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638 #59066 0x8150337 in execute (op_array=0x8206b24) at ./zend_execute.c:1638 #59067 0x81208b3 in call_user_function_ex (function_table=0x821a698, object_pp=0x81fcc30, function_name=0x81fdd24, retval_ptr_ptr=0xbfbfd810, param_count=3, params=0x826bc64, no_separation=1, symbol_table=0x0) at zend_execute_API.c:517 #59068 0x812019d in call_user_function (function_table=0x81ac040, object_pp=0x82a6b60, function_name=0x821eae4, retval_ptr=0x826bda4, param_count=3, params=0xbfbfd8a8) at zend_execute_API.c:373 #59069 0x80f1f21 in xml_call_handler (parser=0x82a6b24, handler=0x821eae4, argc=3, argv=0xbfbfd8a8) at xml.c:375 #59070 0x80f2922 in _xml_startElementHandler (userData=0x82a6b24, name=0x81f3a40 event, attributes=0x82a6c10) at xml.c:657 #59071 0x80f7b53 in doContent (parser=0x81bfc00, startTagLevel=0, enc=0x816ebc0, s=0x82e617a event date=\20021112 16:15:00\ venue=\Newmarket\outcome price=\SP\ id=\31,PAI370676\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370677\ saddlecloth=\2\ /outcome price=\NR\ id=\31,PAI370678\ ..., end=0x82e9779 , nextPtr=0x0) at xmlparse.c:1659 #59072 0x80f705a in contentProcessor (parser=0x81bfc00, start=0x82e504a bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370738\ saddlecloth=\2\..., end=0x82e9779 , endPtr=0x0) at xmlparse.c:1349 #59073 0x80f9ee2 in doProlog (parser=0x81bfc00, enc=0x816ebc0, s=0x82e504a bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370738\ saddlecloth=\2\..., end=0x82e9779 , tok=29, next=0x82e504a bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=\SP\ id=\31,PAI370738\ saddlecloth=\2\..., nextPtr=0x0) ---Type return to continue, or q return to quit--- at xmlparse.c:2687 #59074 0x80f9a54 in prologProcessor (parser=0x81bfc00, s=0x82e5024 ?xml version=\1.0\ encoding=\utf-8\?bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=..., end=0x82e9779 , nextPtr=0x0) at xmlparse.c:2523 #59075 0x80f99ea in prologInitProcessor (parser=0x81bfc00, s=0x82e5024 ?xml version=\1.0\ encoding=\utf-8\?bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1\ /outcome price=..., end=0x82e9779 , nextPtr=0x0) at xmlparse.c:2512 #59076 0x80f68c8 in php_XML_Parse (parser=0x81bfc00, s=0x82e5024 ?xml version=\1.0\ encoding=\utf-8\?bdml memberid=\11\ password=\good9top\event date=\20021112 13:05:00\ venue=\Huntingdon\outcome price=\SP\ id=\31,PAI370737\ saddlecloth=\1
[PHP] flushing data as it's being generated
Hi.. I'm using php to pull data from a mysql table and output it to the browser. Pretty basic stuff. The problem is that the output is very slow, seen from the browser end, because the html output isn't displayed at all until all the data has been retrieved. Actually it's just the table part of the html that delays. Every table row corresponds to a row from the mysql table, and many rows are being displayed. However, I've seen php generated pages that display the data even as it's being pulled from the database. So the delay time isn't as hard to endure. I'm wondering if anyone knows what the trick is to output a large volume of html data from php in the second way. I've tried adding flush to the end of every iteration of the loop that's looping through the rows of data, but it doesn't help. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] flushing data as it's being generated
On Tuesday 12 November 2002 22:10, arch wrote: Hi.. I'm using php to pull data from a mysql table and output it to the browser. Pretty basic stuff. The problem is that the output is very slow, seen from the browser end, because the html output isn't displayed at all until all the data has been retrieved. Actually it's just the table part of the html that delays. Every table row corresponds to a row from the mysql table, and many rows are being displayed. However, I've seen php generated pages that display the data even as it's being pulled from the database. So the delay time isn't as hard to endure. I'm wondering if anyone knows what the trick is to output a large volume of html data from php in the second way. I've tried adding flush to the end of every iteration of the loop that's looping through the rows of data, but it doesn't help. Most browsers only start rendering tables when they see the /table tag. One solution is to split your single table into multiple tables each with, say 10 rows. However one drawback using this method is that if you do not specify the column widths then they can vary from table to table and it may look a bit odd. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Objects are lost only because people look where they are not rather than where they are. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Here Document on Mac OS X
Le mardi, 12 nov 2002, à 14:15 Europe/Paris, Jason Wong a écrit : On Tuesday 12 November 2002 20:05, Craig Buxton wrote: I have been trying to include an echo statement incorporating a here document on pages being served by my Mac OS X (v10.1.5) and Apache (v1.3) When I try to browse test.php, which contains... ?php echoENDOFECHO html hello...hello... /html ENDOFECHO; ? I get a parse error. When I upload it to my ISP it works as expected, but again it won't work on my server. What can I change or where can I go for an answer. I think it's something to do with the end of line character -- you have to use a single linefeed character (0Ah). Try searching the archives, I think this issue cropped up a few weeks ago. If I copy your test.php file in BBEdit and save it as Macintosh file it does'nt work , but works saved as a Unix file [...] Pierre Vaudrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] internet marketing
My php site is almost done so now I need to begin the task of getting it noticed online. Can anyone suggest some good books or sites where I can learn all the basics and tricks for marketing my site? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Oracle 7 support
-Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 13:39 On Tue, 2002-11-12 at 13:03, Ford, Mike [LSS] wrote: -Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 12:18 Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? Yes. I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). No -- the OCI8 functions are actually recommended for Oracle 7 upwards. The ora_* functions are older and do not use the newer OCI methodology. That is great news, thanks Mike. My second problem then lies with my current PHP Setup. I have been using the binary RPMs from RedHat up to now, which do not sem to have been compiled with the Oracle functionality included. If I recompile PHP, will I need the Oracle headers on the machine also? If so this could be a problem as the Oracle server I wish to use is not on the same machine as the webserver. Sorry, I can't help with this one as I'm not the administrator of our main Unix server, and my test server is Windows so I used the pre-compiled binaries. But hopefully one of the Oracle gurus on this list will spring to your aid! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] internet marketing
Here's a site that has a lot of interesting stuff. http://www.selfpromotion.com/ On Tuesday, November 12, 2002, at 09:51 AM, Edward Peloke wrote: My php site is almost done so now I need to begin the task of getting it noticed online. Can anyone suggest some good books or sites where I can learn all the basics and tricks for marketing my site? Thanks, Eddie -- 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] flushing data as it's being generated
Thanks, that did the trick! Should've read the documentation on flush( ). =] - Original Message - From: Jason Wong [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 6:18 AM Subject: Re: [PHP] flushing data as it's being generated On Tuesday 12 November 2002 22:10, arch wrote: Hi.. I'm using php to pull data from a mysql table and output it to the browser. Pretty basic stuff. The problem is that the output is very slow, seen from the browser end, because the html output isn't displayed at all until all the data has been retrieved. Actually it's just the table part of the html that delays. Every table row corresponds to a row from the mysql table, and many rows are being displayed. However, I've seen php generated pages that display the data even as it's being pulled from the database. So the delay time isn't as hard to endure. I'm wondering if anyone knows what the trick is to output a large volume of html data from php in the second way. I've tried adding flush to the end of every iteration of the loop that's looping through the rows of data, but it doesn't help. Most browsers only start rendering tables when they see the /table tag. One solution is to split your single table into multiple tables each with, say 10 rows. However one drawback using this method is that if you do not specify the column widths then they can vary from table to table and it may look a bit odd. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Objects are lost only because people look where they are not rather than where they are. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen() to ssl port gets protocol error
i'm doing a POST to an https server using fsockopen(). after doing the writes, i do fread($fp, 4096) until feof($fp) returns true. this seems to work fine, except that i get an SSL protocol error on the last read. can anybody with a better understanding of this give me an idea why that's happening? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle 7 support
Hello, First, let me just say that I'm no Oracle guru. :) But while we're waiting for them... Ford, Mike [LSS] [EMAIL PROTECTED] wrote: -Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 13:39 ...[snip]... That is great news, thanks Mike. My second problem then lies with my current PHP Setup. I have been using the binary RPMs from RedHat up to now, which do not sem to have been compiled with the Oracle functionality included. If I recompile PHP, will I need the Oracle headers on the machine also? If so this could be a problem as the Oracle server I wish to use is not on the same machine as the webserver. Sorry, I can't help with this one as I'm not the administrator of our main Unix server, and my test server is Windows so I used the pre-compiled binaries. But hopefully one of the Oracle gurus on this list will spring to your aid! *I think* you need to have Oracle installed even if you wouldn't really connect to it but instead connect to a different server. Since I installed Oracle with most of the Linux installations that I did, I haven't really tried enabling Oracle support in PHP without Oracle on the same server. In other words, I haven't really tried configuring --with-oci8 without supplying the path (e.g. --with-oci8=/path/to/oracle/ ). PHP will look for the needed file when configuring so I don't think you can really get away without installing Oracle first. (Of course, you can just try to find out what files are needed, ask a friend to give you a copy, trick php that it exists, etc.--it might not work though...) Anyway, if you need Oracle, try the OTN site. There's one that you can use for development. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle 7 support
Your machine will need the Oracle headers which are included in Oracle Client. So, in two words - your machine needs Oracle client installed. Try doing: echo $ORACLE_HOME in your command prompt -- Maxim Maletsky [EMAIL PROTECTED] Dan Field [EMAIL PROTECTED] wrote... : On Tue, 2002-11-12 at 13:03, Ford, Mike [LSS] wrote: -Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 12:18 Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? Yes. I have found functions specific to Oracle 8i and some more generic functions (are these only for Oracle 9?). No -- the OCI8 functions are actually recommended for Oracle 7 upwards. The ora_* functions are older and do not use the newer OCI methodology. That is great news, thanks Mike. My second problem then lies with my current PHP Setup. I have been using the binary RPMs from RedHat up to now, which do not sem to have been compiled with the Oracle functionality included. If I recompile PHP, will I need the Oracle headers on the machine also? If so this could be a problem as the Oracle server I wish to use is not on the same machine as the webserver. Cheers -- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council. Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system. Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. -- 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] Oracle 7 support
Well, I will spread some light - I maintain OCI8 extension :) Your machine does not need Oracle Server installed, it needs Oracle Client installed. These are two completely different things. So, try this in your command prompt: echo $ORACLE_HOME if you get a result, means the client is there and you can recompile php --with-oci8=$ORACLE_HOME That will compile the OCI8 extension with all the required headers. Cheers, -- Maxim Maletsky [EMAIL PROTECTED] @ Edwin [EMAIL PROTECTED] wrote... : Hello, First, let me just say that I'm no Oracle guru. :) But while we're waiting for them... Ford, Mike [LSS] [EMAIL PROTECTED] wrote: -Original Message- From: Dan Field [mailto:danf;ceredigion.gov.uk] Sent: 12 November 2002 13:39 ...[snip]... That is great news, thanks Mike. My second problem then lies with my current PHP Setup. I have been using the binary RPMs from RedHat up to now, which do not sem to have been compiled with the Oracle functionality included. If I recompile PHP, will I need the Oracle headers on the machine also? If so this could be a problem as the Oracle server I wish to use is not on the same machine as the webserver. Sorry, I can't help with this one as I'm not the administrator of our main Unix server, and my test server is Windows so I used the pre-compiled binaries. But hopefully one of the Oracle gurus on this list will spring to your aid! *I think* you need to have Oracle installed even if you wouldn't really connect to it but instead connect to a different server. Since I installed Oracle with most of the Linux installations that I did, I haven't really tried enabling Oracle support in PHP without Oracle on the same server. In other words, I haven't really tried configuring --with-oci8 without supplying the path (e.g. --with-oci8=/path/to/oracle/ ). PHP will look for the needed file when configuring so I don't think you can really get away without installing Oracle first. (Of course, you can just try to find out what files are needed, ask a friend to give you a copy, trick php that it exists, etc.--it might not work though...) Anyway, if you need Oracle, try the OTN site. There's one that you can use for development. - E -- 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] newbie: help with date arithmetic
I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how. I'd like to do something like this: (2002-11-15)-(2002-11-10)=5 or (2002-12-10)-(2002-11-10)=20 Obviously taking into account number of days in a given month. Does somebody have some code handy that does this? Any help would be greatly appreciated! Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle 7 support
Dan Field wrote: functionality included. If I recompile PHP, will I need the Oracle headers on the machine also? If so this could be a problem as the Oracle server I wish to use is not on the same machine as the webserver. Seems lots of us have not actually tried doing it without Oracle installed! To connect to a database you will need the networking code and specifically the tnsnames.ora file. Check for this. I think it unlikely to come with php since it is proprietry code. Its only the Oracle client installation you would need (not server) and only the networking code. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _POST _GET
Ernest E Vogelsinger wrote... Sorry for the long post, but I believe it is important to have a look at the relevant standards from time to time. Very informative, thanks! -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting Time() to date
I have an array of months (monthList) that I use for a drop-down. I would like to initialize the month to ThisMonth using time(). What is the best way to get November? from time()? Todd -- Ariste Software, Petaluma, CA 94952
Re: [PHP] newbie: help with date arithmetic
At 16:30 12.11.2002, ROBERT MCPEAK spoke out and said: [snip] I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how. I'd like to do something like this: (2002-11-15)-(2002-11-10)=5 or (2002-12-10)-(2002-11-10)=20 Obviously taking into account number of days in a given month. [snip] :)) rtfm, again :)) 1) http://www.php.net/manual/en/function.strtotime.php 2) http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html 3) your second equation would return 30, not 20 ;- 4) try this: /* untested */ function days($str_from, $str_to) { $from = strtotime(isset($str_from) ? $str_from : 'now'); $to = strtotime(isset($str_to) ? $str_to : 'now'); if ($from $to) { $x = $from; $from = $to; $to = $x; } $rslt = $to - $from; // number in seconds return (int)($rslt / 86400); // return days (1d = 86400 secs) } Hope this helps, -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
RE: [PHP] internet marketing
Thanks for the info David, that site looks great! -Original Message- From: David Rice [mailto:davidrice;rogers.com] Sent: Tuesday, November 12, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] internet marketing Here's a site that has a lot of interesting stuff. http://www.selfpromotion.com/ On Tuesday, November 12, 2002, at 09:51 AM, Edward Peloke wrote: My php site is almost done so now I need to begin the task of getting it noticed online. Can anyone suggest some good books or sites where I can learn all the basics and tricks for marketing my site? Thanks, Eddie -- 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] newbie: help with date arithmetic[Scanned]
Robert, I've been looking at this myself over the past couple of days. I gather the best approach is to convert your dates into UNIX timestamps. For example: $first_unix_time = mktime($hour1, $minutes1, $seconds1, $month1, $day1, $year1); $second_unix_time = mktime($hour2, $minutes2, $seconds2, $month2, $day2, $year2); Subtract the one from the other to give the difference: $difference = $first_unix_time - $second_unix_time; The result will be in seconds so you'll need to convert this depending on the format you require. For example, to convert the difference to years you might do: $years = floor($difference / (365 * 24 * 60 * 60)); Hope this helps, Michael Egan -Original Message- From: ROBERT MCPEAK [mailto:RMCPEAK;jhuccp.org] Sent: 12 November 2002 15:31 To: [EMAIL PROTECTED] Subject: [PHP] newbie: help with date arithmetic[Scanned] I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how. I'd like to do something like this: (2002-11-15)-(2002-11-10)=5 or (2002-12-10)-(2002-11-10)=20 Obviously taking into account number of days in a given month. Does somebody have some code handy that does this? Any help would be greatly appreciated! Thanks. -- 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] Converting Time() to date
At 16:46 12.11.2002, Todd Cary spoke out and said: [snip] I have an array of months (monthList) that I use for a drop-down. I would like to initialize the month to ThisMonth using time(). What is the best way to get November? from time()? [snip] :)) rtfm, again and again :)) 1) http://www.php.net/manual/en/function.date.php 2) try this: date('F', time()); -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] Oracle 7 support
Maxim Maletsky [EMAIL PROTECTED] wrote: Well, I will spread some light - I maintain OCI8 extension :) Your machine does not need Oracle Server installed, it needs Oracle Client installed. These are two completely different things. So, try this in your command prompt: echo $ORACLE_HOME if you get a result, means the client is there and you can recompile php --with-oci8=$ORACLE_HOME That will compile the OCI8 extension with all the required headers. Now, that make sense :) Thanks! - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] redirecting a user to a page after a password popup
Hi, I'm generating a 401 header for a few pages, and if they click cancel, I want to send them to a 401 page. How do I do this? I've tried a header after those headers, but that just redirects them automatically. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie: help with date arithmetic[Scanned]
This is a great help. Thanks ya'll. And I will continue to, and do regulary RTFM 8-) I find that it generally sucks for a newbie. Michael Egan [EMAIL PROTECTED] 11/12/02 10:42AM Robert, I've been looking at this myself over the past couple of days. I gather the best approach is to convert your dates into UNIX timestamps. For example: $first_unix_time = mktime($hour1, $minutes1, $seconds1, $month1, $day1, $year1); $second_unix_time = mktime($hour2, $minutes2, $seconds2, $month2, $day2, $year2); Subtract the one from the other to give the difference: $difference = $first_unix_time - $second_unix_time; The result will be in seconds so you'll need to convert this depending on the format you require. For example, to convert the difference to years you might do: $years = floor($difference / (365 * 24 * 60 * 60)); Hope this helps, Michael Egan -Original Message- From: ROBERT MCPEAK [mailto:RMCPEAK;jhuccp.org] Sent: 12 November 2002 15:31 To: [EMAIL PROTECTED] Subject: [PHP] newbie: help with date arithmetic[Scanned] I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how. I'd like to do something like this: (2002-11-15)-(2002-11-10)=5 or (2002-12-10)-(2002-11-10)=20 Obviously taking into account number of days in a given month. Does somebody have some code handy that does this? Any help would be greatly appreciated! Thanks. -- 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] Would appreciate thoughts on session management
Justin, Many thanks for the reply. I didn't provide enough detail in some spots, and I'll attempt to clarify. Seems to me like this would generate a lot of extra server traffic, and a little confusion... The only benefit I can see is that you're getting rid of ugly page URLs. User experience is very important to me. I'm creating a tool for other people, and as far as I'm concerned my users own the URL that the user sees and bookmarks. So, your URLs will actually look like http://www.site.com/article.php?PHPSESSID=12413523245546453 No problem, since the user will never see this and other session properties using this Invisible Get method even with cookies disabled. (Even it it turns out that I still need to pass the session ID to the user URL for people with locked cookie jars, that's okay.) Nothing I can see in your code/idea changes the fact that EACH INSTANCE OF A SCRIPT NEEDS TO MAINTAIN STATE (carry the session around). That's fine. You and Ernest convinced me that it was silly to try and reinvest the wheel. Now I'm only concerned with the wheel experience. 2. bookmarking/linking/etc... essentially what you're saying is that one URL, page.php, will do many different things (like present many different articles), based on session information... this doesn't sound to good to me... Yuck, yeah...what I have in mind is not that evil. :^P The page will be basically the same, but the objects on it need to retain their state during a session. For example, let's say I have 50 spinner objects on a page. All spinners have a value that must be persistent, plus buttons/links that increment and decrement. Those buttons/links call submit.php to pass changes to persistent variables back to itself. You *may* want to consider the apache mod_rewrite stuff. The article was very interesting and I may use it for some other stuff, but I need to call submit.php to put the objects properties into my session globals. Just one last note... PHP sessions, by default, store the session variables in files transparently (ie, you don't have to do much), NOT a database. So, writing a script that requires sessions will NOT require MySQL. Thanks for the clarification. Yesterday was my first experience with PHP sessions, and I didn't quite get it. Just look at amazon, yahoo, msn, or any other big site... they just pass the sid around in URLs, and people deal with it. Learn from the best. The best is not good enough! :O) They shouldn't keep transient session information in the URL. If the only drawback to Invisible Get is the (unnoticeable) serving of the tiny interim page, I think this could be a really good solution. -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] progress bar for use with PHP uploads
Greetings Can anyone point me in the direction of a Javascript code snippet that would display a progress bar for a PHP upload? I'm sure it can be done that way, but honestly, I lack the Javascript skills to make it happen Any and all help would be appreciated. Thanks. Kenn
Re: [PHP] progress bar for use with PHP uploads
At 17:27 12.11.2002, Kenn Murrah spoke out and said: [snip] Can anyone point me in the direction of a Javascript code snippet that would display a progress bar for a PHP upload? I'm sure it can be done that way, but honestly, I lack the Javascript skills to make it happen [snip] If I understood you correctly you want to accomplish something like a) you have a file upload form b) user clicks upload, and a progress meter is displayed c) when the upload is done, the progress meter will be at 100% and vanish or tell finished or something like that I'm afraid this cannot be done very easily. What you'd need to know at the moment the user clicks on upload would be the actual filesize, and the average transmission speed so you can estimate the pace to go from 0 to 100. And, you need both values at the client's, a server side script is not yet active at this time. I'd suggest to take the easy road (seen on a couple of other sites)... Create an animated gif with a progress bar constantly scrolling. In your form's onSubmit() method (at the client's side!), do a window.open() with the appropriate parameters to generate a small window without any controls, sized sufficiently to just contain this gif. The URL of this popup would be a PHP script (with the same session ID of the uploader) which would basically do this: if (!$_SESSION['popup_opened']) { $_SESSION['popup_opened'] = true; send_popup_html(); } elseif (!$_SESSION['xmit_done']) header('HTTP/1.0 204 No Content'); else send_close_html(); send_popup_html would add a header to refresh the popup: header('Refresh: 1; URL=http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']?SID); send_close_html would simply send html like body onload='window.close();' I hope you get the idea... Basically the crucial stuff is the refresh header for the popup url that causes the client to _try_ to refresh every second. As long as the transfer is not finished, the popup script simply replies with 204 No Content, so the browser would change nothing with the popup. When the upload is eventually finished, the refresh request succeeds, but the only stuff the client receives is a javascript closing the popup... -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] progress bar for use with PHP uploads
There's no way to know the percentage of the file that's uploaded, so you can't have a true progress indicator. You could just use a little popup that shows a 'wait, we're doing something' graphic that the following page closes when it loads. ---John Holmes... - Original Message - From: Kenn Murrah [EMAIL PROTECTED] To: php list [EMAIL PROTECTED] Sent: Tuesday, November 12, 2002 11:27 AM Subject: [PHP] progress bar for use with PHP uploads Greetings Can anyone point me in the direction of a Javascript code snippet that would display a progress bar for a PHP upload? I'm sure it can be done that way, but honestly, I lack the Javascript skills to make it happen Any and all help would be appreciated. Thanks. Kenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQLyog 2.51 - the definitve FREE Windows front-end to MySQL
Greetings SQLyog v2.51. The definitive Windows Front End for MySQL. SQLyog is FREE! Some of the new features added in SQLyog 2.51 are - -- Alter Table structure in an easy to use Grid mode. -- Optimized for speed and network resources. -- Insert / Update data in a table. -- Insert / Update BLOB data. All popular formats supported (BMP/PNG/GIF/JPG). -- Save your BLOB data in a file. -- Very fast client side sorting / filtering. -- Create / Edit Users. -- Manage permissions for Database / Table / Column. -- View information for Database / Table. -- Export database schema in HTML. -- Execute very large ( size limited by OS ) SQL batch files. -- Export data in Fixed Width format. -- View all queries executed in history log. -- Various operations on tables. -- Backup / Restore databases and tables. -- Improved Export functionality. -- Improved Import functionality. -- Improved SQL Editor. -- Show / Hide Result Pane. -- Lot of bug fixes. -- And many more... You can download the new SQLyog at http://www.webyog.com/sqlyog/download.html Thanks for your attention. Rgds Karam __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle 7 support
First, let me just say that I'm no Oracle guru. :) But while we're waiting for them... Thanks, all help appreciated :) *I think* you need to have Oracle installed even if you wouldn't really connect to it but instead connect to a different server. Since I installed Oracle with most of the Linux installations that I did, I haven't really tried enabling Oracle support in PHP without Oracle on the same server. In other words, I haven't really tried configuring --with-oci8 without supplying the path (e.g. --with-oci8=/path/to/oracle/ ). It certainly looks that way. PHP will look for the needed file when configuring so I don't think you can really get away without installing Oracle first. (Of course, you can just try to find out what files are needed, ask a friend to give you a copy, trick php that it exists, etc.--it might not work though...) Yes this is right too. I greabed the SRC RPM for PHP 4.2.2 and edited the spec file to include --with-oci8 but it now throws the following errors: checking for Oracle-OCI8 support... yes, shared checking Oracle Install-Dir... checking Oracle version... configure: error: Oracle-OCI8 needed libraries not found error: Bad exit status from /var/tmp/rpm-tmp.47391 (%build) Anyway, if you need Oracle, try the OTN site. There's one that you can use for development. Luckally I had downloaded the Oracle-Linux (Version 8i) installer a few weeks ago incase this problem arised. but the installer is currently taking 98% of my CPU with the Java Runtime and it doesn't seem to be doing a lot else (not even a GUI window yet . 20 minutes later). I fear this is too OT for the list though. If anyone does know if I can trick PHP by just copying some files from the Oracle-Linux.tar then this would be a great help though. Thanks all for your support. -- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council. Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system. Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Would appreciate thoughts on session management
On 11/12/02 10:15 AM, Charles Wiltgen ([EMAIL PROTECTED]) wrote: So, your URLs will actually look like http://www.site.com/article.php?PHPSESSID=12413523245546453 No problem, since the user will never see this and other session properties using this Invisible Get method even with cookies disabled. Your method assumes something about your users: that they click on links. This may be unlikely, but what if a user uses the 'copy URL to clipboard' (or equivalent) feature of their browser? It could be pasted into an e-mail, posted to a newsgroup, etc. While 'Invisible Gets' may handle the general case, they do not entirely solve the problem. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Drop down list with date
Hello guys, I have a question: How can I create a drop down menu where the choices are the days of the month, displaying always the next 7 days? What I mean is, create a drop down menu and show the today's date, next day, and next... Example: Today is 12th, then the menu shows the following option to be choosen 12/11/02 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02 Tomorrow 13th will display 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02 19/11/02 and so on... Thx Regards Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ereg_replace();
Hi, i'm trying to replace every instance of br within the pre../pre tags. i want all other breakrows to remain the same. i've tried numerous regular expressions, but i can't find a way to just replace the breakrows.. it replaces _everything_ bewteen pre and /pre. example $string: testbr testbr testbr pre testingbr testingbr /pre testbr testbr i want that to look like: testbr testbr testbr pre testing testing /pre testbr testbr -- Gustaf Sjoberg [EMAIL PROTECTED] ( ) ( ) ( ) ( ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Drop down list with date
On Wednesday 13 November 2002 01:15, Miguel Brás wrote: Hello guys, I have a question: How can I create a drop down menu where the choices are the days of the month, displaying always the next 7 days? What I mean is, create a drop down menu and show the today's date, next day, and next... Example: Today is 12th, then the menu shows the following option to be choosen 12/11/02 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02 You'll need to use some combination of time() strftime(), and whilst not strictly necessary but highly recommended strtotime(). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I bought some used paint. It was in the shape of a house. -- Steven Wright */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] get the output from a program
Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running df produced and put it in a web page? Thanks!! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get the output from a program
look up exec() Adam On Tue, 12 Nov 2002, Greg wrote: Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running df produced and put it in a web page? Thanks!! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg_replace();
At 17:49 12.11.2002, Gustaf Sjoberg spoke out and said: [snip] Hi, i'm trying to replace every instance of br within the pre../pre tags. i want all other breakrows to remain the same. i've tried numerous regular expressions, but i can't find a way to just replace the breakrows.. it replaces _everything_ bewteen pre and /pre. [snip] You need a two-phase operation on this: 1) isolate all pre/pre elements preg_match('/(.*?)pre(.*?)\/pre(.*)/is', $string, $armatch); $armatch now contains: [0] all, ignore this [1] everything before pre [2] everything within pre/pre [3] the rest after /pre 2) go on and replace all br's here: preg_replace('/br\n?/is', \n, $armatch[2]); The whole stuff would look something like /* UNTESTED */ function kill_br_within_pre($string) { $re1 = '/(.*?)pre(.*?)\/pre(.*)/is'; $re2 = '/br\n?/is'; $result = null; while ($string) { $armatch = preg_match($re1, $string, $arMatch); if (is_array($arMatch)) { $result .= $arMatch[1]; $result .= preg_replace($re2, \n, $arMatch[2]); $string = $arMatch[3]; } else break; } $result .= $string; return $result; } This assumes that all pre are properly closed with /pre. As said, I didn't test, but it should work this or a similar way. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
[PHP] Re: get the output from a program
this is just a shot in the dark, beware. but i think you could make use of the system() function and pass the output to a file. ex. system('df ~/public_html/output.tmp'); but i've never tried the function, try to search php.net functions for system On Tue, 12 Nov 2002 12:33:09 -0500 [EMAIL PROTECTED] (Greg) wrote: Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running df produced and put it in a web page? Thanks!! -Greg -- Gustaf Sjoberg [EMAIL PROTECTED] ( ) ( ) ( ) ( ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get the output from a program
actually, look up system() I think it would be better in your case. Adam On Tue, 12 Nov 2002, Greg wrote: Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running df produced and put it in a web page? Thanks!! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FileSize and file_exist failing a file that I am sure is there
Hello, When try to get a file_exist response I get the following error: Warning: stat failed for /home/admin/2002-11-12-Part1.mp3 (errno=2 - No such file or directory) in b/home/admin/hsReleaser.php/b on line b20/bbr But I am rather sure that the file does exist. If I open /home/admin/2002-11-12-Part1.mp3 it does exist. Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com http://www.webintellects.com/
Re: [PHP] FileSize and file_exist failing a file that I am sure is there
At 17:27 12.11.2002, Brandon Orther spoke out and said: [snip] When try to get a file_exist response I get the following error: Warning: stat failed for /home/admin/2002-11-12-Part1.mp3 (errno=2 - No such file or directory) in b/home/admin/hsReleaser.php/b on line b20/bbr But I am rather sure that the file does exist. If I open /home/admin/2002-11-12-Part1.mp3 it does exist. [snip] Maybe the open_basedir limitation is in effect, and /home/admin is outside the allowed base directory? -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] get the output from a program
exec() worked jsut fine. Is there any drawback to using this? -Greg Adam Williams [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.33L2.0211121138370.5968-10;roark.mdah.state.ms.us... actually, look up system() I think it would be better in your case. Adam On Tue, 12 Nov 2002, Greg wrote: Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running df produced and put it in a web page? Thanks!! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg_replace();
many thanks, and kudos for the quick reply. i will try that right away! as a sub-question, do you mind telling me where you learned regexp? i've been searching google all day with no luck, i've just find more or less basic regexp guides. did you learn through practice or do you have a secret source? ;-) On Tue, 12 Nov 2002 18:35:55 +0100 [EMAIL PROTECTED] (Ernest E Vogelsinger) wrote: At 17:49 12.11.2002, Gustaf Sjoberg spoke out and said: [snip] Hi, i'm trying to replace every instance of br within the pre../pre tags. i want all other breakrows to remain the same. i've tried numerous regular expressions, but i can't find a way to just replace the breakrows.. it replaces _everything_ bewteen pre and /pre. [snip] You need a two-phase operation on this: 1) isolate all pre/pre elements preg_match('/(.*?)pre(.*?)\/pre(.*)/is', $string, $armatch); $armatch now contains: [0] all, ignore this [1] everything before pre [2] everything within pre/pre [3] the rest after /pre 2) go on and replace all br's here: preg_replace('/br\n?/is', \n, $armatch[2]); The whole stuff would look something like /* UNTESTED */ function kill_br_within_pre($string) { $re1 = '/(.*?)pre(.*?)\/pre(.*)/is'; $re2 = '/br\n?/is'; $result = null; while ($string) { $armatch = preg_match($re1, $string, $arMatch); if (is_array($arMatch)) { $result .= $arMatch[1]; $result .= preg_replace($re2, \n, $arMatch[2]); $string = $arMatch[3]; } else break; } $result .= $string; return $result; } This assumes that all pre are properly closed with /pre. As said, I didn't test, but it should work this or a similar way. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- Gustaf Sjoberg [EMAIL PROTECTED] ( ) ( ) ( ) ( ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Send Attachment using Php
Hi All I have tried to use phpmailer() to send mail with attachments but it did not werk for me. Can anyone suggest some utility to send mail with attachment. Thanks --Pushpinder Pushpinder Singh Garcha _ Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Send Attachment using Php
Hello, On 11/12/2002 03:50 PM, Pushpinder Sngh Garcha wrote: Hi All I have tried to use phpmailer() to send mail with attachments but it did not werk for me. Can anyone suggest some utility to send mail with attachment. You may want to try this class instead. If you still have trouble, just mail me back: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FileSize and file_exist failing a file that I am sure is there
Hello, Open_basedir is not set in the php.ini and I can rename the files without an issue using the rename function. Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com http://www.webintellects.com/ -Original Message- From: Ernest E Vogelsinger [mailto:ernest;vogelsinger.at] Sent: Tuesday, November 12, 2002 9:42 AM To: Brandon Orther Cc: PHP User Group Subject: Re: [PHP] FileSize and file_exist failing a file that I am sure is there At 17:27 12.11.2002, Brandon Orther spoke out and said: [snip] When try to get a file_exist response I get the following error: Warning: stat failed for /home/admin/2002-11-12-Part1.mp3 (errno=2 - No such file or directory) in b/home/admin/hsReleaser.php/b on line b20/bbr But I am rather sure that the file does exist. If I open /home/admin/2002-11-12-Part1.mp3 it does exist. [snip] Maybe the open_basedir limitation is in effect, and /home/admin is outside the allowed base directory? -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] ereg_replace();
At 18:44 12.11.2002, Gustaf Sjoberg spoke out and said: [snip] many thanks, and kudos for the quick reply. i will try that right away! as a sub-question, do you mind telling me where you learned regexp? i've been searching google all day with no luck, i've just find more or less basic regexp guides. did you learn through practice or do you have a secret source? ;-) [snip] This stems from my old Perl days - I recommend reading the Camel Book :) Refer to http://www.perldoc.com/perl5.6/pod/perlre.html and eat this page - you'll be a RegEx whiz in seconds (naahh - it takes a bit longer ;-) -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] get the output from a program
No if it works use it, but if you choose to go with system() you will need to pass the command through escapeshellcmd() as a security precaution. Adam On Tue, 12 Nov 2002, Greg wrote: exec() worked jsut fine. Is there any drawback to using this? -Greg Adam Williams [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.33L2.0211121138370.5968-10;roark.mdah.state.ms.us... actually, look up system() I think it would be better in your case. Adam On Tue, 12 Nov 2002, Greg wrote: Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running df produced and put it in a web page? Thanks!! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form question ???
HI Mike et al,,, That was it! Thanks. Don't know how I missed that G So next question! How can I tell my program that I want only postive numbers inputed? ie no letters or neg numbers. Thanks JIM On Monday 11 November 2002 19:57, Ford, Mike [LSS] wrote: -Original Message- From: Jim Hatridge [mailto:hatridge;fecundswamp.net] Sent: 11 November 2002 16:27 looking at the code below. It works and I get what I want on the screen. BUT it leaves a gap between the top lines and where the table starts equal to the size of the table, ie if the table is 5 lines long the gap is 5 lines etc. Any ideas what I'm doing wrong? [snip] printf( td%s/tdtd%s/tdBR/tr, Yes -- that BR between the /td and the /tr is most likely the culprit. Most browsers of my experience tend to render *any* content that is not correctly positioned within container tags above the table. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- Vielfeind -- Viel Ehr' Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts http:/www.fecundswamp.net/~hatridge/stamps/index.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] small php engine
Hi list, has anyone ever experimented to melt down the php engine to a few hundred KBs ? By leaving out not needed libraries/functions ? What i am searching for is a very small webserver (exists) and a very small php-engine through which the webserver can process php-scripts. We want to use it for demos. We are developing dynamic files, but to create demos and send them to the client as as zipped HTML we always have to rewrite things in html-hardcode or a type of javascript-mimikry if we had a php-engine of about 500 kB, a webserver of 200 kB and 100 kB scripts images, we could pack a whole, self-executing dynamic webpage demo into an e-Mail-attachement of 800 kB. We don't want to send a full Apache and MySQL and PHP engine binaries of about 25 megs via e-Mail. Or Oracle .. Has anyone ever done something like this ? Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Send Attachment using Php
I have tried to use phpmailer() to send mail with attachments but it did not werk for me. Can anyone suggest some utility to send mail with attachment. I've been using Richard Heyes' mail class for quite some time with great success. You can find it here: http://www.phpclasses.org/browse.html/package/32.html Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php