[PHP-DEV] how to call a website from within a php script
Can anybody tell me how to call a website from within a php script. Meaning: how to forward to a website, or if something happens then goto that website. hope it is clear now not just new to php but news groups also... christian -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: call website from php script
please delete Christian Tischler [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can anybody tell me how to call a website from within aphp script. not just new to php but news groups also... christian -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: call a website from within a php script
please delete Christian Tischler [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... From: christian tischler [EMAIL PROTECTED] Subject: call website from php script Date: 14 February 2003 21:59 Can anybody tell me how to call a website from within a php script. not just new to php but news groups also... christian -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: how to call a website from within a php script
please delete Christian Tischler [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can anybody tell me how to call a website from within a php script. Meaning: how to forward to a website, or if something happens then goto that website. hope it is clear now not just new to php but news groups also... christian -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: iopy,
please delete Christian Tischler [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... yu,pu -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] database select
Hello, Im trying to select only one row in a mysql database (in this case a poll with the smallest pollID)... Each row has a field called pollID which is the primary key and is auto incremented when a new row is inserted. I could possible do the following but I think its a bit extensive: $query = SELECT * FROM polls ORDER BY pollID ASC; $result = mysql_query($query); for ($count = 0; $count 1 $count++) { $data = mysql_fetch_array($result); $pollID = $data['pollID']; } $query = SELECT * FROM polls WHERE pollID = $pollID; Does anyone now a solution for this that requires less code? Thx -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] how to call a website from within a php script
christian tischler wrote: Can anybody tell me how to call a website from within a php script. Please ask user questions on the [EMAIL PROTECTED] list. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] database select
Hans Prins wrote: [...] Please ask user questions on the [EMAIL PROTECTED] list. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / run-tests.php /ext/curlinterface.c streams.c /ext/fbsql php_fbsql.c /ext/ftp ftp.c /ext/hyperwavehg_comm.c hw.c /ext/imap php_imap.c /ext/ldap ldap.c /ext/
Should be fixed now. If any more of these occur, the problem is that winsock2.h needs to be included before windows.h (which itself includes winsock.h). I noticed that some source files include the winsock headers twice, so there is probably some spring cleaning that can be done. I have included winsock2.h as one of the first things in php.h, so the large majority of all other .c files probably don't even need to include it explicitly anymore. --Wez. On Sun, 16 Feb 2003, Sebastian Bergmann wrote: Wez Furlong wrote: Log: A add much more useful select(2) implementation than is provided by windows sockets. This broke the build for me. I get 1500+ errors that look like this one: c:\programme\microsoft sdk\include\winsock2.h(2478): error C2375: 'WSAAsyncGetHostByName': Redefinition; different binding; c:\programme\microsoft sdk\include\winsock.h(925): See declaration of 'WSAAsyncGetHostByName' -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] new Date extenstion
Hello, I made a new extension to work with dates, you may find infossources here: Docs: http://www.pearfr.org/php_date/docs/ Sources: http://www.pearfr.org/php_date/sources/ This is a alpha release, a first shot. I still have to create a full set of tests script. The idea is to provide a fullfeatured date/time standart extension with php5. A non documented function is get_isoweek() which returns the ISO week number. But the weeknumber is a thing we have to discuss, because there are tons of way to represent it. Actually the week #1 is the week where fit 4th of january. For all date_new_xxx functions, an optionnal arg can be set to define the 1st day week, default is monday. Todo: - strftime() - add/clean warnings (overflow, invalid dates,...) - add times functions This part is real pain if we want to DST times, localtime and so on. - add time_span datatype, which represents a time interval in days, hours, seconds, and related functions - add a true crossplatform localisations, which does not depend of the target platform. That will make our life easier to provide date localisations in any cases. Usefull but not really needed: - add additionnals functions for specials days and official hollydays any comments, ideas, feedback ? pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [patch] solaris getcwd() brokeness
When getcwd() fails in certain places, we end up passing a zero length cwd_state to virtual_file_ex(). This causes virtual_file_ex() to assume the path to be /, thus: include(foo.php); ends up trying to open, /foo.php, which is wrong. If you want to play with this problem, its very easy to simulate on a non-broken environment, just do: #define VCWD_GETCWD(buff, size) (EACCES) (or to a func that returns EACCES in case VCWD_GETCWD() is ever used). -James On Sat, 15 Feb 2003, Andi Gutmans wrote: Hey, The fchdir() part of the patch looks fine but I didn't quite understand the rest. PHP only uses realpath() if it doesn't fail, so what is the exact problem? What does that other code do? Andi At 03:29 PM 2/12/2003 -0500, James E. Flemer wrote: Well all the fancy new streams code in 4.3.0 seems to tickle a Solaris issue with getcwd(). It seems that under certain cases solaris' getcwd() fails when other os' work. Consequently 4.3.0 causes a huge ammount of breakage for some sites running solaris. Below is a patch that seems to work around the problem. This may not be the best approach, but it was an attempt at a quick-fix so that 4.3.0 would be usable for now. This problem has bug number: #21310 [1]. Comments welcome. I'd like to commit this (or similar) before any more releases are made. -James [EMAIL PROTECTED] [1] http://bugs.php.net/21310 ]] Patch sponsored by: The University of Vermont [[ Index: TSRM/tsrm_virtual_cwd.c === RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.41 diff -u -b -u -r1.41 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 6 Nov 2002 18:07:22 - 1.41 +++ TSRM/tsrm_virtual_cwd.c 12 Feb 2003 04:39:11 - @@ -303,7 +303,7 @@ return (0); #if !defined(TSRM_WIN32) !defined(NETWARE) - if (IS_ABSOLUTE_PATH(path, path_length)) { + if (IS_ABSOLUTE_PATH(path, path_length) || (state-cwd_length 1)) { if (use_realpath realpath(path, resolved_path)) { path = resolved_path; path_length = strlen(path); @@ -363,6 +363,7 @@ } + if (state-cwd_length 0 || IS_ABSOLUTE_PATH(path, path_length)) { ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, tok); while (ptr) { ptr_length = strlen(ptr); @@ -416,6 +417,11 @@ state-cwd[state-cwd_length+1] = '\0'; state-cwd_length++; } + } else { + state-cwd = (char *) realloc(state-cwd, path_length+1); + memcpy(state-cwd, path, path_length+1); + state-cwd_length = path_length; + } if (verify_path verify_path(state)) { CWD_STATE_FREE(state); Index: main/main.c === RCS file: /repository/php4/main/main.c,v retrieving revision 1.512.2.5 diff -u -b -u -r1.512.2.5 main.c --- main/main.c 16 Dec 2002 15:44:06 - 1.512.2.5 +++ main/main.c 12 Feb 2003 04:39:12 - @@ -1507,7 +1507,11 @@ { zend_file_handle *prepend_file_p, *append_file_p; zend_file_handle prepend_file, append_file; +#ifdef VIRTUAL_DIR char *old_cwd; +#else + int old_cwd_fd; +#endif char *old_primary_file_path = NULL; int retval = 0; @@ -1515,9 +1519,11 @@ if (php_handle_special_queries(TSRMLS_C)) { return 0; } +#ifdef VIRTUAL_DIR #define OLD_CWD_SIZE 4096 old_cwd = do_alloca(OLD_CWD_SIZE); old_cwd[0] = '\0'; +#endif zend_try { #ifdef PHP_WIN32 @@ -1528,7 +1534,11 @@ if (primary_file-type == ZEND_HANDLE_FILENAME primary_file-filename) { +#ifdef VIRTUAL_DIR VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1); +#else + old_cwd_fd = open(., 0); +#endif VCWD_CHDIR_FILE(primary_file-filename); } @@ -1578,10 +1588,14 @@ } zend_end_try(); +#ifdef VIRTUAL_DIR if (old_cwd[0] != '\0') { VCWD_CHDIR(old_cwd); } free_alloca(old_cwd); +#else + fchdir(old_cwd_fd); +#endif return retval; } /* }}} */ Index: main/safe_mode.c === RCS file: /repository/php4/main/safe_mode.c,v retrieving revision 1.51 diff -u -b -u -r1.51 safe_mode.c --- main/safe_mode.c6 Nov 2002 18:07:23 - 1.51 +++ main/safe_mode.c12 Feb 2003 04:39:12 - @@ -121,6 +121,8 @@ VCWD_REALPATH(filename, path); *s = DEFAULT_SLASH; } else { + path[0] = '.'; + path[1] = '\0'; VCWD_GETCWD(path,
Re: [PHP-DEV] new Date extenstion
hello, As a side note, the date range starts on 1/1/1 and ends on 31/12/65535. pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] new Date extenstion
Looks interesting. A lot of functions though. Would it make sense to at least remove all date_sub_* () functions in favor of using the date_add_* () counterparts with negative values? E.g. date_add_days(-10) does the same as date_sub_days(10) ? One of the easy ways to reduce usability of an extension is to include a lot of functions that do basic (and often overlapping) functions. Pierre-Alain Joye wrote: hello, As a side note, the date range starts on 1/1/1 and ends on 31/12/65535. Y65K bug, anyone? :) Vlad -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] new Date extenstion
On Sun, 2003-02-16 at 16:17, Pierre-Alain Joye wrote: hello, As a side note, the date range starts on 1/1/1 and ends on 31/12/65535. pierre What about BCE dates? Wouldn't it be more sensible to allow between 31/12/-32767 to 31/12/32767 Theo Spears -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [patch] solaris getcwd() brokeness
At 03:41 PM 2/13/2003 -0500, James E. Flemer wrote: RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.41 diff -u -b -r1.41 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 6 Nov 2002 18:07:22 - 1.41 +++ TSRM/tsrm_virtual_cwd.c 13 Feb 2003 20:40:07 - @@ -303,7 +303,7 @@ return (0); #if !defined(TSRM_WIN32) !defined(NETWARE) - if (IS_ABSOLUTE_PATH(path, path_length)) { + if (IS_ABSOLUTE_PATH(path, path_length) || (state-cwd_length 1)) { if (use_realpath realpath(path, resolved_path)) { path = resolved_path; path_length = strlen(path); Will realpath() work in cases where getcwd() didn't work? (btw it's nicer to check state-cwd_length == 0 than 1 IMO). @@ -363,6 +363,7 @@ } + if (state-cwd_length 0 || IS_ABSOLUTE_PATH(path, path_length)) { ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, tok); while (ptr) { ptr_length = strlen(ptr); @@ -416,6 +417,11 @@ state-cwd[state-cwd_length+1] = '\0'; state-cwd_length++; } + } else { + state-cwd = (char *) realloc(state-cwd, path_length+1); + memcpy(state-cwd, path, path_length+1); + state-cwd_length = path_length; + } I'm trying to think if there's some other way of doing this. What is the main problem in this loop? Does it add / or c:\ in the beginning of the string? Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [patch] solaris getcwd() brokeness
On Sun, 16 Feb 2003, Andi Gutmans wrote: At 03:41 PM 2/13/2003 -0500, James E. Flemer wrote: RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.41 diff -u -b -r1.41 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 6 Nov 2002 18:07:22 - 1.41 +++ TSRM/tsrm_virtual_cwd.c 13 Feb 2003 20:40:07 - @@ -303,7 +303,7 @@ return (0); #if !defined(TSRM_WIN32) !defined(NETWARE) - if (IS_ABSOLUTE_PATH(path, path_length)) { + if (IS_ABSOLUTE_PATH(path, path_length) || (state-cwd_length 1)) { if (use_realpath realpath(path, resolved_path)) { path = resolved_path; path_length = strlen(path); Will realpath() work in cases where getcwd() didn't work? (btw it's nicer to check state-cwd_length == 0 than 1 IMO). Most realpath() implementations call getcwd(); realpath() on Solaris seems to, so it fails too. @@ -363,6 +363,7 @@ } + if (state-cwd_length 0 || IS_ABSOLUTE_PATH(path, path_length)) { ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, tok); while (ptr) { ptr_length = strlen(ptr); @@ -416,6 +417,11 @@ state-cwd[state-cwd_length+1] = '\0'; state-cwd_length++; } + } else { + state-cwd = (char *) realloc(state-cwd, path_length+1); + memcpy(state-cwd, path, path_length+1); + state-cwd_length = path_length; + } I'm trying to think if there's some other way of doing this. What is the main problem in this loop? Does it add / or c:\ in the beginning of the string? Yes, that loop adds prefix of /. Like I said, this probably is not the cleanest solution, but it was quick and got 4.3 running for now. I am open to suggestions on improvement. One thought of mine was to wrap getcwd() so that when it fails, it would return ., and then make sure that nothing *needed* absolute paths. (I believe the _once() functions will not like this, or may end up allowing the same file included multiple times w/o the help of realpath().) I sort of wonder why PHP does uses getcwd()/realpath() so much. It is commonly recomended to use open(.) and fchdir() for a directory stack. Resolving every single opened file with realpath() seems a waste. I saw some discussion on this last month (Subj: Reducing the number of system calls ...). If the main issue was _once(), would it be possible to use inodes to prevent multiple inclusion? (You'd still need a fstat() to get inodes but no realpath() or getcwd().) -James -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] new Date extenstion
On Sun, 16 Feb 2003 11:58:52 -0800 Vlad Krupin [EMAIL PROTECTED] wrote: Looks interesting. A lot of functions though. Would it make sense to at least remove all date_sub_* () functions in favor of using the date_add_* () counterparts with negative values? E.g. date_add_days(-10) does the same as date_sub_days(10) ? One of the easy ways to reduce usability of an extension is to include a lot of functions that do basic (and often overlapping) functions. This is better for the readability of the source, especially while working with dates or ranges. Internally two different functions are used. That sounds more logical to my mind to substract 10 days instead to add a negative span ;-). Note I have received request for a normalize add/sub method which accepts 1month 2days or -1year 4months, which can be added soon, as well as an OO interface. For the interface itself, I have made a merge of what we can find in others langages, like python or perl, I did not implement everything I found, but everything I currently need. One of the goals, except to enlarge the dates limit, was to provide usefulleasy to use functions. thank's for the feedback, pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: new Date extenstion
Pierre, u catching me a moment before i'm commiting date_sunrise(), date_sunset() functions, as agreed on the list. do we have a naming conflict here? moshe. -- Pierre-Alain Joye [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I made a new extension to work with dates, you may find infossources here: Docs: http://www.pearfr.org/php_date/docs/ Sources: http://www.pearfr.org/php_date/sources/ This is a alpha release, a first shot. I still have to create a full set of tests script. The idea is to provide a fullfeatured date/time standart extension with php5. A non documented function is get_isoweek() which returns the ISO week number. But the weeknumber is a thing we have to discuss, because there are tons of way to represent it. Actually the week #1 is the week where fit 4th of january. For all date_new_xxx functions, an optionnal arg can be set to define the 1st day week, default is monday. Todo: - strftime() - add/clean warnings (overflow, invalid dates,...) - add times functions This part is real pain if we want to DST times, localtime and so on. - add time_span datatype, which represents a time interval in days, hours, seconds, and related functions - add a true crossplatform localisations, which does not depend of the target platform. That will make our life easier to provide date localisations in any cases. Usefull but not really needed: - add additionnals functions for specials days and official hollydays any comments, ideas, feedback ? pierre
Re: [PHP-DEV] new Date extenstion
On 16 Feb 2003 20:17:13 + Theo Spears [EMAIL PROTECTED] wrote: On Sun, 2003-02-16 at 16:17, Pierre-Alain Joye wrote: hello, As a side note, the date range starts on 1/1/1 and ends on 31/12/65535. pierre What about BCE dates? Wouldn't it be more sensible to allow between 31/12/-32767 to 31/12/32767 Playing with months days is completly hazardous with BC dates, even with dates lower then certain centuries, check the calendar FAQ :). This choice makes the algorithm easier to implement and faster, the structure of date/time structire too. It seems this is the way others men people choosed too for their respective langage or APIs. As far as I remember, archaeological applications do not use this structure to store dating datas in an atomic manner. Note this is an internal limit, logic tells us to do not believe the 1st january of 340 was a monday for the people who lived during this old times ;-)), regardless to the algorithm you use. The goals here were more to work a date after 2038 and before 1970. thank's for the feedbacks hth pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: new Date extenstion
On Mon, 17 Feb 2003 00:04:50 +0200 moshe doron [EMAIL PROTECTED] wrote: Pierre, u catching me a moment before i'm commiting date_sunrise(), date_sunset() functions, as agreed on the list. do we have a naming conflict here? No, I answered for 2 reasons, the 1st was to respect the new naming convention, the 2nd was to integrate them easily in this new extension :-). Currently the namespace will be time_foo for the time functions. I took care about your new functions while preparing (still on the fire) the next steps (time functions). Indeed, you are welcome to help me :-). pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] make the win32 project working again after date_sun*()'s
http://212.199.221.100/moshe/win32project-sunfuncs.patch.txt --
Re: [PHP-DEV] [PATCH] make the win32 project working again afterdate_sun*()'s
I'll do this now. On Mon, 17 Feb 2003, moshe doron wrote: http://212.199.221.100/moshe/win32project-sunfuncs.patch.txt -- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: php4 /ext/standard/tests/general_functions sunfuncts.phpt
looks to me unnecessary, since the sixts parameter is the offset. -- Jani Taskinen [EMAIL PROTECTED] wrote in message news:cvssniper1045461063@cvsserver... sniper Mon Feb 17 00:51:03 2003 EDT Modified files: /php4/ext/standard/tests/general_functions sunfuncts.phpt Log: Assuming the results were created in system with Asia/Jerusalem as TZ Index: php4/ext/standard/tests/general_functions/sunfuncts.phpt diff -u php4/ext/standard/tests/general_functions/sunfuncts.phpt:1.2 php4/ext/standard/tests/general_functions/sunfuncts.phpt:1.3 --- php4/ext/standard/tests/general_functions/sunfuncts.phpt:1.2 Mon Feb 17 00:02:05 2003 +++ php4/ext/standard/tests/general_functions/sunfuncts.phpt Mon Feb 17 00:51:03 2003 @@ -4,6 +4,9 @@ precision = 14 --FILE-- ? + +putenv (TZ=Asia/Jerusalem); + for($a=1;$a=12;$a++){ echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2). ; echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2). ;
Re: [PHP-DEV] Re: php4 /ext/standard/tests/general_functionssunfuncts.phpt
On Mon, 17 Feb 2003, moshe doron wrote: looks to me unnecessary, since the sixts parameter is the offset. It affects mktime() and as that timestamp is used to generate the SUNFUNCS_RET_TIMESTAMP part of the test, if it differs, the test fails. --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php