php4

set-cookie expiration in seconds

*爱你&永不变心* 提交于 2021-01-28 01:50:51
问题 Does the html header Set-Cookie function accept expiration in seconds? header( "Set-Cookie:". $cookieName."=".$sessId."; expires=".$expireSeconds."; sessionID=".$sessId.";path=".$path."; domain=".$domain."; httponly; secure); $expireSeconds = time()+$expireSeconds; NOTE: I dont want to use set cookie because i am running php4 version. Also php4 does not support httponly in the setcookie() function 回答1: The proper date format for expires is something like this: Mon, 19 Nov 2012 15:40:59 GMT

PHP4: Send XML over HTTPS/POST via cURL?

£可爱£侵袭症+ 提交于 2020-01-11 08:33:19
问题 I wrote a class/function to send xml over https via PHP4/cURL, just wondering if this is the correct approach, or if there's a better one. Note that PHP5 is not an option at present. /** * Send XML via http(s) post * * curl --header "Content-Type: text/xml" --data "<?xml version="1.0"?>...." http://www.foo.com/ * */ function sendXmlOverPost($url, $xml) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // For xml, change the content-type. curl_setopt ($ch, CURLOPT_HTTPHEADER, Array(

Calling extension function in zend_eval_string

三世轮回 提交于 2020-01-07 05:45:12
问题 When i try use zend_eval_string (i make mini php extension), there are no extensions functions avaliable. There are also no errors reporting (if php code have fatal error program exit). What i must do to enable extension and show errors when it executes? I also found interesting value EG(no_extensions)=1; in zend_execute_API.c, but when i change this value to 0 problem not solving. I am newer of c++ and please, tell me how to solve this problem with example. Sorry for my bad English. 回答1:

PHP object class variable

自作多情 提交于 2019-12-31 01:59:07
问题 I have built a class in PHP and I must declare a class variable as an object. Everytime I want to declare an empty object I use: $var=new stdClass; But if I use it to declare a class variable as class foo { var $bar=new stdClass; } a parse error occurs. Is there a way to do this or must I declare the class variable as an object in the constructor function? PS: I'm using PHP 4. 回答1: You can only declare static values this way for class members, i.e. ints , strings , bools , arrays and so on.

Replaced $HTTP_GET_VARS with $_GET, but not working

為{幸葍}努か 提交于 2019-12-25 12:42:27
问题 I have the following code, which is not working for me. I used to have $HTTP_GET_VARS instead of $_GET, but then updated to PHP 5, and now things are broken. Any thoughts on what I'm doing wrong here? <?php $_GET['SubCat']; $_GET['Location']; $db = mysql_connect("localhost", "xxxx", "xxxx"); mysql_select_db("outdoors",$db); if ($Location) { $result = mysql_query("SELECT ID, Longitude, URL, SiteName, Description FROM hunting WHERE SubCategory = '$SubCat' AND Location = '$Location' AND Status <

PHP4 HTTP Post without cURL

泪湿孤枕 提交于 2019-12-24 01:09:23
问题 I have the following code that works on PHP5 to send a HTTP POST without using cURL. I would like this to work on PHP 4.3.0 and above: $opts = array('http' => array( 'method' => 'POST', 'header' => "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Type: application/json\r\n", 'content' => $query ) ); $context = stream_context_create($opts); $result = file_get_contents($url, false, $context); HTTP context is only supported on PHP5. Is there anyway to make this work with PHP 4.3

Migrating php4/mysql4 to php5/mysql5: expected php issues?

霸气de小男生 提交于 2019-12-24 00:36:00
问题 I have a legacy web application php4/mysql4 (MyISAM, db contains some cms, some user data, some calendar application). Now I am going to migrate to a new server with php5/mysql5. What are the typical php issues in such a migration scenary (php, sql queries, anything)? I've heard that the function parameter passing changed, call-by-reference / call-by-value. Can you give an example or explain? Anything else I should be aware of? (The mysql issues are covered in a different question: Migrating

PHP: Problem merging arrays

回眸只為那壹抹淺笑 提交于 2019-12-24 00:12:21
问题 OK I have this function (I got as the answer to this question) that merges an array like so: Functions function readArray( $arr, $k, $default = 0 ) { return isset( $arr[$k] ) ? $arr[$k] : $default ; } function merge( $arr1, $arr2 ) { $result = array() ; foreach( $arr1 as $k => $v ) { if( is_numeric( $v ) ) { $result[$k] = (int)$v + (int) readArray( $arr2, $k ) ; } else { $result[$k] = merge( $v, readArray($arr2, $k, array()) ) ; } } return $result ; } Usage $basketA = array( "fruit" => array(

Codeigniter Call to a member function set_userdata() on a non-object

偶尔善良 提交于 2019-12-22 17:35:19
问题 I am getting a fatal error in a CI app that I just moved from a php4 shared host to a php5 shared host. Fatal error: Call to a member function set_userdata() on a non-object in /home/chuck_ravenna/bob.ravennainteractive.com/system/application/helpers/authenticate_helper.php on line 13 Code in full located in the link below https://gist.github.com/1474173 I am trying to figure out if the php version could be the issue. The site runs fine on the old server, and the new server doesn't have php4

Codeigniter Call to a member function set_userdata() on a non-object

杀马特。学长 韩版系。学妹 提交于 2019-12-22 17:34:23
问题 I am getting a fatal error in a CI app that I just moved from a php4 shared host to a php5 shared host. Fatal error: Call to a member function set_userdata() on a non-object in /home/chuck_ravenna/bob.ravennainteractive.com/system/application/helpers/authenticate_helper.php on line 13 Code in full located in the link below https://gist.github.com/1474173 I am trying to figure out if the php version could be the issue. The site runs fine on the old server, and the new server doesn't have php4