|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 2 Mar 2006 12:07:35 -0000 Issue 3993
php-general-digest-help
lists.php.net
Date: Thu Mar 02 2006 - 06:07:35 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 2 Mar 2006 12:07:35 -0000 Issue 3993
Topics (messages 231287 through 231325):
Re: move_uploaded_file and CPU wait state (IO)
231287 by: Aleksandar Skodric
231294 by: Chris
Re: The argument should be an array
231288 by: Remember14a.aol.com
231295 by: Chris
231299 by: Remember14a.aol.com
231301 by: Chris
231303 by: Remember14a.aol.com
231304 by: Chris
231305 by: Remember14a.aol.com
231306 by: Chris
231312 by: Remember14a.aol.com
231313 by: Robert Cummings
231314 by: Chris
231320 by: Jochem Maas
231322 by: Robin Vickery
231323 by: Remember14a.aol.com
231324 by: Robin Vickery
Re: internal error when mailing...
231289 by: Chris
image in memory to mySQL
231290 by: tedd
231297 by: tedd
231300 by: Chris
Re: leading slash in SCRIPT_NAME variable
231291 by: Chris
231321 by: Roman Rumisek
Re: preg_replace problem
231292 by: Chris
231310 by: Rafael
Re: binding adodb
231293 by: Chris
Re: subtract dates
231296 by: tedd
Re: How can I stop PHP from resolving symlinks?
231298 by: Chris
Re: Dynamic Form List - how to change values
231302 by: Pat
231308 by: tedd
231315 by: Pat
Re: Linux distributions and tools for Linux/Apache/PHP/MySQL dev
231307 by: Chris Lott
231309 by: John Meyer
231311 by: Chris
Php Setup Question
231316 by: Christopher Taylor
231317 by: Chris
url of code pasted
231318 by: Remember14a.aol.com
PHP Calendar script
231319 by: Robin Hastings
Sendmail issue
231325 by: Dave Goodchild
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I have changed the directory to the same disk. Results are _much_ better!
So nothing to blame on PHP, only my lack of knowledge about *nix-like
system *blush*
Thank all for the advice and help!
Cheers,
Aleks
PS. defining of php_value in virtual host of apache did not work, so I
changed php.ini value.
Chris wrote:
> Aleksandar Skodric wrote:
>> Hi,
>>
>> Yes, /tmp is on another disk then the final directory. I shall move
>> it to the same disk (tmp_upload_dir) right now.
>>
>> Question: can I define tmp_upload_dir to be otherwise just for one
>> host in apache conf, like:
>>
>> php_ini upload_tmp_dir /some/dir
>
> <snip>
>
> I'm guessing not, but the php docs will tell you for sure -
> http://www.php.net
>
attached mail follows:
Aleksandar Skodric wrote:
> Hi,
>
> I have changed the directory to the same disk. Results are _much_ better!
> So nothing to blame on PHP, only my lack of knowledge about *nix-like
> system *blush*
>
> Thank all for the advice and help!
It's not *nix systems - it's all operating systems.
When you move a file between partitions it has to copy the whole file
then remove it from the original place when it has verified it has
copied ok.
> PS. defining of php_value in virtual host of apache did not work, so I
> changed php.ini value.
Figured as much :)
> Chris wrote:
>
>> Aleksandar Skodric wrote:
>>
>>> Hi,
>>>
>>> Yes, /tmp is on another disk then the final directory. I shall move
>>> it to the same disk (tmp_upload_dir) right now.
>>>
>>> Question: can I define tmp_upload_dir to be otherwise just for one
>>> host in apache conf, like:
>>>
>>> php_ini upload_tmp_dir /some/dir
>>
>>
>> <snip>
>>
>> I'm guessing not, but the php docs will tell you for sure -
>> http://www.php.net
>>
>
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
You have written,
Now do a var_dump($res) and see what *is* in $res
or do print_r().
Can you precisely mention where you want me to put this piece of code.
attached mail follows:
Remember14a
aol.com wrote:
>
> You have written,
> Now do a var_dump($res) and see what *is* in $res
> or do print_r().
>
>
> Can you precisely mention where you want me to put this piece of code.
>
Please include your original post so we can all see it so we don't have
to search to find what you're talking about - and highlighting doesn't
work because most people will get text-only emails.
...........
$row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
var_dump($res); <---------
usort($res, "cmp");
Then send us the output.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
let me give you more details to understand problem with the said code.
go to this link, please.
http://www.abcdefg.us/search/search.php
in search enter,
Justice, you get response without an error.
Now enter law,
you get error, pasted below,
Warning: usort(): The argument should be an array in
/home2/wwwabcde/public_html/search/searchfuncs.php on line 300
------------------------------------------------------------------
below is part of the code and few lines of code above and below the error
point, as the code is more tha 300 lies I had to paste tail end of code at the
point of error.
----------------------------------------------------------------------
$row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
echo mysql_error();
$res['maxweight'] = $maxweight;
$res['results'] = $results;
return $res;
/**/
}
?>
attached mail follows:
Remember14a
aol.com wrote:
>
> You have written,
> Now do a var_dump($res) and see what *is* in $res
> or do print_r().
>
>
> Can you precisely mention where you want me to put this piece of code.
>
Please include your original post so we can all see it so we don't have
to search to find what you're talking about - and highlighting doesn't
work because most people will get text-only emails.
...........
$row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
var_dump($res); <---------
usort($res, "cmp");
Then send us the output.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Remember14a
aol.com wrote:
> let me give you more details to understand problem with the said code.
>
> go to this link, please.
>
> http://www.abcdefg.us/search/search.php
>
> in search enter,
> Justice, you get response without an error.
>
> Now enter law,
>
> you get error, pasted below,
>
> *Warning*: usort(): The argument should be an array in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *300*
> *------------------------------------------------------------------*
> below is part of the code and few lines of code above and below the
> error point, as the code is more tha 300 lies I had to paste tail end
> of code at the point of error.
> ----------------------------------------------------------------------
>
> $row[4];
>
> $res[$i]['size'] = $row[5];
>
> $res[$i]['weight'] = $result_array[$row[0]];
>
> $i++;
>
> }
> usort($res, "cmp");
>
> echo mysql_error();
>
> $res['maxweight'] = $maxweight;
>
> $res['results'] = $results;
>
> return $res;
>
> /**/
>
> }
>
> ?>
>
I found the code and put it in my reply before.
As everyone has already said, we need to know what "res" is.
Put
var_dump($res);
BEFORE
usort($res, "cmp");
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
I have done as per your instructions, and put
var_dump($res);
BEFORE
usort($res, "cmp");
Please, go again to
http://www.abcdefg.us/search/search.php
Enter law we get this output.
NULL
Warning: usort(): The argument should be an array in
/home2/wwwabcde/public_html/search/searchfuncs.php on line 301
attached mail follows:
Remember14a
aol.com wrote:
> let me give you more details to understand problem with the said code.
>
> go to this link, please.
>
> http://www.abcdefg.us/search/search.php
>
> in search enter,
> Justice, you get response without an error.
>
> Now enter law,
>
> you get error, pasted below,
>
> *Warning*: usort(): The argument should be an array in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *300*
> *------------------------------------------------------------------*
> below is part of the code and few lines of code above and below the
> error point, as the code is more tha 300 lies I had to paste tail end
> of code at the point of error.
> ----------------------------------------------------------------------
>
> $row[4];
>
> $res[$i]['size'] = $row[5];
>
> $res[$i]['weight'] = $result_array[$row[0]];
>
> $i++;
>
> }
> usort($res, "cmp");
>
> echo mysql_error();
>
> $res['maxweight'] = $maxweight;
>
> $res['results'] = $results;
>
> return $res;
>
> /**/
>
> }
>
> ?>
>
I found the code and put it in my reply before.
As everyone has already said, we need to know what "res" is.
Put
var_dump($res);
BEFORE
usort($res, "cmp");
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Remember14a
aol.com wrote:
> I have done as per your instructions, and put
>
> var_dump($res);
>
> BEFORE
>
> usort($res, "cmp");
>
> Please, go again to
> http://www.abcdefg.us/search/search.php
>
> Enter law we get this output.
>
> NULL
> *Warning*: usort(): The argument should be an array in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *301*
>
So you're not setting $res at all.
You should be doing:
# INITIALIZE RESULTS ARRAY HERE.
$res = array();
while($row = mysql_fetch_assoc($query_result)) {
..........................
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
that will fix your problem (I know someone suggested this before too).
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
If I put this code
$res = array();
while($row = mysql_fetch_assoc($query_result)) {
before
usort($res, "cmp"); give this error
Parse error: parse error, unexpected $ in
/home2/wwwabcde/public_html/search/searchfuncs.php on line 316
even putting this code before
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
gives same error.
attached mail follows:
Remember14a
aol.com wrote:
> I have done as per your instructions, and put
>
> var_dump($res);
>
> BEFORE
>
> usort($res, "cmp");
>
> Please, go again to
> http://www.abcdefg.us/search/search.php
>
> Enter law we get this output.
>
> NULL
> *Warning*: usort(): The argument should be an array in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *301*
>
So you're not setting $res at all.
You should be doing:
# INITIALIZE RESULTS ARRAY HERE.
$res = array();
while($row = mysql_fetch_assoc($query_result)) {
..........................
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
that will fix your problem (I know someone suggested this before too).
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Remember14a
aol.com wrote:
> *If I put this *code
>
> $res = array();
>
> while($row = mysql_fetch_assoc($query_result)) {
>
> before
>
> usort($res, "cmp"); give this error
> **
> **
> *Parse error*: parse error, unexpected $ in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *316*
> **
> *even * putting this code before
>
>
> $res[$i]['size'] = $row[5];
>
> $res[$i]['weight'] = $result_array[$row[0]];
>
> $i++;
> }
>
> usort($res, "cmp");
>
> gives same error.
>
You need to put
$res = array();
before you start looping over your mysql query results.
We didn't see all your code so we can't give you an *exact* line number
or place to put it.
You need to adjust what you were told to fit into your code.
If you need more help, post your entire code block in
http://www.pastebin.com and send us a url to look at.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Below is the detailed code
and error this is giving,
Warning: usort(): The argument should be an array in
/home2/wwwabcde/public_html/search/searchfuncs.php on line 311
---------------------------------------------------------------
Once I enter for example,law at
http://www.abcdefg.us/search/search.php
-----------------------------------------------------------------
Let me know precisely where to enter, $res = array();
-----------------------------------------------------------------
error_reporting(E_ALL ^ E_NOTICE);
$include_dir = "include";
include "$include_dir/commonfuncs.php";
function cmp($a, $b) {
if ($a['weight'] == $b['weight'])
return 0;
return ($a['weight'] > $b['weight']) ? -1 : 1;
}
function addmarks($a) {
$a = eregi_replace("[ ]+", " ", $a);
$a = str_replace(" +", "+", $a);
$a = str_replace(" ", "+", $a);
return $a;
}
function makeboollist($a) {
global $entities;
while ($char = each($entities)) {
$a = eregi_replace($char[0], $char[1], $a);
}
$a = trim($a);
$a = eregi_replace(""", "\"", $a);
$returnWords = array();
//get all phrases
$regs = Array();
while (eregi("([-]?)\"([^\"]+)\"", $a, $regs)) {
if ($regs[1] == '') {
$returnWords['+s'][] = $regs[2];
$returnWords['hilight'][] = $regs[2];
} else {
$returnWords['-s'][] = $regs[2];
}
$a = str_replace($regs[0], "", $a);
}
$a = strtolower(eregi_replace("[ ]+", " ", $a));
// $a = remove_accents($a);
$a = trim($a);
$words = explode(' ', $a);
if ($a=="") {
$limit = 0;
} else {
$limit = count($words);
}
$k = 0;
//get all words (both include and exlude)
$includeWords = array();
while ($k < $limit) {
if (substr($words[$k], 0, 1) == '+') {
$includeWords[] = substr($words[$k], 1);
} else if (substr($words[$k], 0, 1) == '-') {
$returnWords['-'][] = substr($words[$k], 1);
} else {
$includeWords[] = $words[$k];
$returnWords['hilight'][] = $words[$k];
}
$k++;
}
//add words from phrases to includes
if (isset($returnWords['+s'])) {
foreach ($returnWords['+s'] as $phrase) {
$phrase = strtolower(eregi_replace("[ ]+", " ", $phrase));
$phrase = trim($phrase);
$temparr = explode(' ', $phrase);
foreach ($temparr as $w)
$includeWords[] = $w;
}
}
foreach ($includeWords as $word) {
if (!($word =='')) {
if (ignoreWord($word)) {
$returnWords['ignore'][] = $word;
} else {
$returnWords['+'][] = $word;
}
}
}
return $returnWords;
}
function ignoreword($word) {
global $common;
global $min_word_length;
global $index_numbers;
if ($index_numbers == 1) {
$pattern = "[a-z0-9]+";
} else {
$pattern = "[a-z]+";
}
if (strlen($word) < $min_word_length || (!eregi($pattern,
remove_accents($word))) || ($common[$word] == 1)) {
return 1;
} else {
return 0;
}
}
function search($searchstr, $category, $start, $per_page, $type) {
global $length_of_link_desc,$mysql_table_prefix, $show_meta_description;
//find all sites that should not be included in the result
if (count($searchstr['+']) == 0) {
return null;
}
$wordarray = $searchstr['-'];
$notlist = array();
$not_words = 0;
while ($not_words < count($wordarray)) {
$searchword = addslashes($wordarray[$not_words]);
$query1 = "SELECT link_id from ".$mysql_table_prefix."link_keyword,
".$mysql_table_prefix."keywords where
".$mysql_table_prefix."link_keyword.keyword_id= ".$mysql_table_prefix."keywords.keyword_id and keyword='$searchword'";
echo mysql_error();
$result = mysql_query($query1);
while ($row = mysql_fetch_row($result)) {
$notlist[$not_words]['id'][$row[0]] = 1;
}
$not_words++;
}
//find all sites containing the search phrase
$wordarray = $searchstr['+s'];
$phrase_words = 0;
while ($phrase_words < count($wordarray)) {
$searchword = addslashes($wordarray[$phrase_words]);
$query1 = "SELECT link_id from ".$mysql_table_prefix."links where fulltxt
like '% $searchword%'";
echo mysql_error();
$result = mysql_query($query1);
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return null;
}
while ($row = mysql_fetch_row($result)) {
$phraselist[$phrase_words]['id'][$row[0]] = 1;
}
$phrase_words++;
}
if ($category> 0) {
$allcats = get_cats($category);
$catlist = implode(",", $allcats);
$query1 = "select link_id from ".$mysql_table_prefix."links,
".$mysql_table_prefix."sites, ".$mysql_table_prefix."categories,
".$mysql_table_prefix."site_category where ".$mysql_table_prefix."links.site_id =
".$mysql_table_prefix."sites.site_id and ".$mysql_table_prefix."sites.site_id =
".$mysql_table_prefix."site_category.site_id and ".$mysql_table_prefix."site_category.category_id
in ($catlist)";
$result = mysql_query($query1);
echo mysql_error();
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return null;
}
while ($row = mysql_fetch_row($result)) {
$category_list[$row[0]] = 1;
}
}
//find all sites that include the search word
$wordarray = $searchstr['+'];
$words = 0;
$starttime = getmicrotime();
while ($words < count($wordarray)) {
$searchword = addslashes($wordarray[$words]);
$query1 = "SELECT distinct link_id, weight from
".$mysql_table_prefix."link_keyword, ".$mysql_table_prefix."keywords where
".$mysql_table_prefix."link_keyword.keyword_id= ".$mysql_table_prefix."keywords.keyword_id and
keyword='$searchword' order by weight desc";
$result = mysql_query($query1);
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return null;
}
if ($type == "or") {
$indx = 0;
} else {
$indx = $words;
}
while ($row = mysql_fetch_row($result)) {
$linklist[$indx]['id'][] = $row[0];
$linklist[$indx]['weight'][$row[0]] = $row[1]; }
$words++;
}
if ($type == "or") {
$words = 1;
}
$result_array = Array();
if ($words == 1 && $not_words == 0 && $category < 1) { //if there is only
one search word, we already have the result
$result_array = $linklist[0]['weight'];
} else { //otherwise build an intersection of all the results
$j= 1;
$min = 0;
while ($j < $words) {
if (count($linklist[$min]['id']) > count($linklist[$j]['id'])) {
$min = $j;
}
$j++;
}
$j = 0;
$temp_array = $linklist[$min]['id'];
$count = 0;
while ($j < count($temp_array)) {
$k = 0; //and word counter
$n = 0; //not word counter
$o = 0; //phrase word counter
$weight = 1;
$break = 0;
while ($k < $words && $break== 0) {
if ($linklist[$k]['weight'][$temp_array[$j]] > 0) {
$weight = $weight + $linklist[$k]['weight'][$temp_array[$j]];
} else {
$break = 1;
}
$k++;
}
while ($n < $not_words && $break== 0) {
if ($notlist[$n]['id'][$temp_array[$j]] > 0) {
$break = 1;
}
$n++;
}
while ($o < $phrase_words && $break== 0) {
if ($phraselist[$n]['id'][$temp_array[$j]] != 1) {
$break = 1;
}
$o++;
}
if ($break== 0 && $category > 0 && $category_list[$temp_array[$j]] != 1) {
$break = 1;
}
if ($break == 0) {
$result_array[$temp_array[$j]] = $weight;
$count ++;
}
$j++;
}
}//word == 1
$end = getmicrotime()- $starttime;
$results = count($result_array);
if ($results == 0) {
return null;
}
arsort ($result_array);
$keys = array_keys($result_array);
$maxweight = $result_array[$keys[0]];
for ($i = ($start -1)*$per_page; $i <min($results, ($start -1)*$per_page +
$per_page) ; $i++) {
$in[] = $keys[$i];
}
if (!is_array($in)) {
$res['results'] = $results;
return $res;
}
$inlist = implode(",", $in);
if ($length_of_link_desc == 0) {
$fulltxt = "fulltxt";
} else {
$fulltxt = "substring(fulltxt, 1, $length_of_link_desc)";
}
$query1 = "SELECT distinct link_id, url, title, description, $fulltxt,
size FROM ".$mysql_table_prefix."links WHERE link_id in ($inlist)";
$result = mysql_query($query1);
echo mysql_error();
$i = 0;
while ($row = mysql_fetch_row($result)) {
$res[$i]['title'] = $row[2];
$res[$i]['url'] = $row[1];
if ($row[3] != null && $show_meta_description == 1)
$res[$i]['fulltxt'] = $row[3];
else
$res[$i]['fulltxt'] = $row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
echo mysql_error();
$res['maxweight'] = $maxweight;
$res['results'] = $results;
return $res;
/**/
}
?>
attached mail follows:
let me give you more details to understand problem with the said code.
go to this link, please.
http://www.abcdefg.us/search/search.php
in search enter,
Justice, you get response without an error.
Now enter law,
you get error, pasted below,
Warning: usort(): The argument should be an array in
/home2/wwwabcde/public_html/search/searchfuncs.php on line 300
------------------------------------------------------------------
below is part of the code and few lines of code above and below the error
point, as the code is more tha 300 lies I had to paste tail end of code at the
point of error.
----------------------------------------------------------------------
$row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
echo mysql_error();
$res['maxweight'] = $maxweight;
$res['results'] = $results;
return $res;
/**/
}
?>
attached mail follows:
Remember14a
aol.com wrote:
>
> You have written,
> Now do a var_dump($res) and see what *is* in $res
> or do print_r().
>
>
> Can you precisely mention where you want me to put this piece of code.
>
Please include your original post so we can all see it so we don't have
to search to find what you're talking about - and highlighting doesn't
work because most people will get text-only emails.
...........
$row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
var_dump($res); <---------
usort($res, "cmp");
Then send us the output.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On Wed, 2006-03-01 at 22:26, Remember14a
aol.com wrote:
>
Is there a good reason for why you're clogging the mailing list with
your fancy shmancy HTML emails?
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Remember14a
aol.com wrote:
>
>
> Below is the detailed code
> and error this is giving,
>
> *Warning*: usort(): The argument should be an array in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *311*
> *---------------------------------------------------------------*
> *Once I enter for example,law at*
> **
> * http://www.abcdefg.us/search/search.php*
> -----------------------------------------------------------------
>
> Let me know precisely where to enter, $res = array();
> **
> **
<snip>
I guess you missed the part where I said post to pastebin and send us a
url?!
$i = 0;
$res = array(); <<<<<<====================
while ($row = mysql_fetch_row($result)) {
$res[$i]['title'] = $row[2];
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Robert Cummings wrote:
> On Wed, 2006-03-01 at 22:26, Remember14a
aol.com wrote:
>
>>
>
>
> Is there a good reason for why you're clogging the mailing list with
> your fancy shmancy HTML emails?
he's trying to cut down on the ammount of reading I do ;-)
>
> Cheers,
> Rob.
attached mail follows:
Remember14a wrote:
>
> $i = 0;
> while ($row = mysql_fetch_row($result)) {
> $res[$i]['title'] = $row[2];
> $res[$i]['url'] = $row[1];
> if ($row[3] != null && $show_meta_description == 1)
> $res[$i]['fulltxt'] = $row[3];
> else
> $res[$i]['fulltxt'] = $row[4];
>
>
> $res[$i]['size'] = $row[5];
> $res[$i]['weight'] = $result_array[$row[0]];
> $i++;
> }
>
> usort($res, "cmp");
The var_dump($res) we asked you to insert output "NULL". That means
that $res was undefined.
$res is only defined within your loop and your loop is only executed
if the search comes back with at least one result.
So what you need to do is make sure that $res is an array, even if
there are no results from your query. You do this by initialising $res
to an array before the loop, just like you've done to $i.
All you need to do is add one line, just before the start of the loop that says:
$res = array();
-robin
(trying hard to remain patient)
attached mail follows:
I agree, $res = array();
needs to be declared. I tried this at various level in the code of 300 lines,
what happenes if error is suppresses, the search output is displayed in
different manner.I have posted full code at this link.Can you inform where
precisely I must include, so that neither error is displayed or search output is
displayed differetly.
$res = array(); in code posted at below link.
http://pastebin.com/579621
attached mail follows:
Remember14a wrote:
>
> $i = 0;
> while ($row = mysql_fetch_row($result)) {
> $res[$i]['title'] = $row[2];
> $res[$i]['url'] = $row[1];
> if ($row[3] != null && $show_meta_description == 1)
> $res[$i]['fulltxt'] = $row[3];
> else
> $res[$i]['fulltxt'] = $row[4];
>
>
> $res[$i]['size'] = $row[5];
> $res[$i]['weight'] = $result_array[$row[0]];
> $i++;
> }
>
> usort($res, "cmp");
The var_dump($res) we asked you to insert output "NULL". That means
that $res was undefined.
$res is only defined within your loop and your loop is only executed
if the search comes back with at least one result.
So what you need to do is make sure that $res is an array, even if
there are no results from your query. You do this by initialising $res
to an array before the loop, just like you've done to $i.
All you need to do is add one line, just before the start of the loop that says:
$res = array();
-robin
(trying hard to remain patient)
attached mail follows:
On 02/03/06, Remember14a
aol.com <Remember14a
aol.com> wrote:
> Can you inform where precisely I must include, so that neither error is
> displayed or search output is displayed differetly.
Oh, I give up. Where's my Little Book of Calm?...
-robin
attached mail follows:
Gustav Wiberg wrote:
> ----- Original Message ----- From: "John Nichel" <john
kegworks.com>
> To: "Gustav Wiberg" <gustav
varupiraten.se>
> Sent: Wednesday, March 01, 2006 9:57 PM
> Subject: Re: [PHP] internal error when mailing...
>
>
>> Gustav Wiberg wrote:
>>
>>> Here's my code
>>>
>>>
>>> <?php
>>> //Thanx to jcwebb at dicoe dot com
>>> //base of the code at php.net is used here
>>> // Is the OS Windows or Mac or Linux
>>> //
>>> if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol="\r\n"; elseif
>>> (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol="\r"; else: $eol="\n";
>>> endif;
>>>
>>> //Message Subject
>>> $emailsubject="Stammis Internet nyhetsbrev " . date("Y/m/d H:i:s");
>>>
>>> //Message Body
>>> ob_start();
>>> require("emailbody.php"); // page for showing in the email (no
>>> html and body-tags here)
>>> $body=ob_get_contents(); ob_end_clean();
>>>
>>> // Common Headers
>>> //
>>>
>>> $headers .= 'From: Stammis Internet <jon
genius.com>'.$eol;
>>> $headers .= 'Reply-To: Stammis Internet <info
stammis.com>'.$eol;
>>> $headers .= 'Return-Path: Stammis Internet <info
stammis.com>'.$eol;
>>> // these two to set reply address
>>> $headers .= "Message-ID: <".$now."
>>> TheSystem
".$_SERVER['SERVER_NAME'].">".$eol;
>>> $headers .= "X-Mailer: PHP v".phpversion().$eol; // These
>>> two to help avoid spam-filters
>>> $headers .= 'MIME-Version: 1.0'.$eol;
>>> $headers .= "Content-type: text/html; charset=iso-8859-1\n";
>>>
>>> // HTML Version
>>> //
>>> $msg = $body.$eol.$eol;
>>>
>>> // SEND THE EMAIL(s)
>>> // FROM MYSQL-db
>>> //
>>>
>>> require("../phpfunctions/opendb.php");
>>>
>>> $sql = "SELECT mail FROM tbusers ORDER BY mail";
>>> $querys = mysql_query($sql);
>>>
>>> while ($dbArray = mysql_fetch_array($querys)) {
>>> $dbMail = $dbArray["mail"];
>>>
>>> $emailaddress=$dbMail;
>>>
>>> ini_set(sendmail_from,'info
stammis.com'); // the INI lines are to
>>> force the From Address to be used !
>>> mail($emailaddress, $emailsubject, $msg, $headers);
>>> ini_restore(sendmail_from);
>>>
>>> echo "SENT EMAIL TO $dbMail right now....<br>";
>>> }
>>>
>>> mysql_close();
>>> ?>
>>>
>>> When I tested this script all mails I think was sent, BUT this error
>>> showed when the loop hade gone through all posts...
>>>
>>>
>>> HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache
>>> X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked
>>> Content-Type: text/html; charset=iso-8859-1
>>> OK
>>> The server encountered an internal error or misconfiguration and was
>>> unable to complete your request.
>>> Please contact the server administrator, support
b-one.net and inform
>>> them of the time the error occurred, and anything you might have done
>>> that may have caused the error.
>>>
>>> More information about this error may be available in the server
>>> error log.
>>>
>>>
>>>
>>> What could have caused this?
>>
>>
>> Gremlins? ;)
>>
>> Misconfigured mail server.
>>
>> --
>> John C. Nichel IV
>> Programmer/System Admin (ÜberGeek)
>> Dot Com Holdings of Buffalo
>> 716.856.9675
>> jnichel
dotcomholdingsofbuffalo.com
>
>
> Ok, but the code is okay right?
>
> /G
>
It looks ok.
Do you have another server you could test it with?
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Hi:
I know how to upload an image from a file into a BLOB in mySQL, but
how do you place an image that's in memory into mySQL?
For example, if I create an image via resampling another image or
create a new image, how do I get that image into mySQL? I know I can
save it as a file and load it back in again, but that's clumsy. I
thought that I had the answer, but I can't find my code any longer --
arrgggh.
In any event, thanks for any suggestions.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
attached mail follows:
Hi:
I know how to upload an image from a file into a BLOB in mySQL, but
how do you place an image that's in memory into mySQL?
For example, if I create an image via resampling another image or
create a new image, how do I get that image into mySQL? I know I can
save it as a file and load it back in again, but that's clumsy. I
thought that I had the answer, but I can't find my code any longer --
arrgggh.
In any event, thanks for any suggestions.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
attached mail follows:
tedd wrote:
> Hi:
>
> I know how to upload an image from a file into a BLOB in mySQL, but how
> do you place an image that's in memory into mySQL?
>
> For example, if I create an image via resampling another image or create
> a new image, how do I get that image into mySQL? I know I can save it
> as a file and load it back in again, but that's clumsy. I thought that I
> had the answer, but I can't find my code any longer -- arrgggh.
>
> In any event, thanks for any suggestions.
>
> tedd
Something like this?
<?php
$im = imagecreatefrompng("test.png");
ob_start();
imagepng($im);
$binary_image = ob_get_contents();
ob_end_clean();
insert into table(imagefield) values($binary_image);
?>
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Roman Rumisek wrote:
> Hi,
>
> i have configured apache 2.0.50 with mod_php 4.4.2 and
> $_SERVER['SCRIPT_NAME'] beginning with /// (three slash).
>
> Where have i a error ? (probably configuration)
>
> Application apache configuration:
>
> Alias /trsklad/ /.../projects/akce/src/html/
> <Directory /.../projects/akce/src/html/>
> AllowOverride All
> Order deny,allow
> Deny from all
> Allow from 127.0.0.1
> </Directory>
>
> Thanks
>
> Rumisek
>
I don't think it's apache.
Are you seeing this in a phpinfo page or in your code somewhere?
If you're not using a phpinfo page then create one and see if it's in
there first.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
In phpinfo page SCRIPT_NAME variable is set correctly.
What have effect this variable ? May be include_path setting ?
Rumisek
Chris wrote:
> Roman Rumisek wrote:
>> Hi,
>>
>> i have configured apache 2.0.50 with mod_php 4.4.2 and
>> $_SERVER['SCRIPT_NAME'] beginning with /// (three slash).
>>
>> Where have i a error ? (probably configuration)
>>
>> Application apache configuration:
>>
>> Alias /trsklad/ /.../projects/akce/src/html/
>> <Directory /.../projects/akce/src/html/>
>> AllowOverride All
>> Order deny,allow
>> Deny from all
>> Allow from 127.0.0.1
>> </Directory>
>>
>> Thanks
>>
>> Rumisek
>>
>
> I don't think it's apache.
>
> Are you seeing this in a phpinfo page or in your code somewhere?
>
> If you're not using a phpinfo page then create one and see if it's in
> there first.
>
attached mail follows:
Benjamin Adams wrote:
> $file = dog.txt;
> $today = date("Ymd");
>
> function incDate($new, $date){
> //$date = settype('int');
> return $new.($date++);
> }
>
> $getOldValue = parse_ini_file($file, 1);
> $newValue = $getOldValue[$today] + 1;
> $oldDate = $today . " = ". $newValue;
> $newDate = preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate("$1","$2")',
> $oldDate);
> file_put_contents($file, $newDate . "\n");
>
> This works with one file but with multi lines I'm having trouble:
> if the file has:
> 20060301 = 34
> 20060302 = 3
> the file after script will be:
> 20060302 = 4
>
> I want it to preserve the previous lines
> so output should be:
> 20060301 = 34
> 20060302 = 4
>
> Help would be great, thanks
> Ben
The easiest way would be to get incDate to add the newline back on the end.
You could also try:
preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate("$1","$2")' . "\n", $oldDate);
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Is there any special reason why you want to solve this with regular
expressions? As far as I see, there's a couple of problems with your code,
a) $file = dog.txt should be $file = 'dog.txt',
b) $getOldValue has the _array_ resulting of parsing the INI file,
hence you should write $getOldValue, since it's the complete file
(I won't say anything about performance),
c) you're using a regular expresion to increment the value in a
specific key/index, and you don't need regexp for that, and
d) you're not saving the whole file, only the "setting" (entry) for
"today", hence you overwrite the file and leave only "today = n"
What do you think of something like this (a bit changed):
$file = 'dog.txt';
$today = date("Ymd");
// we read the file,
$getOldValue = parse_ini_file($file);
// set or increment the value in "$today" key,
$getOldValue[$today] ++;
// and write back the whole INI file
// note: what we have is an array, not a string
$str_ini = '';
foreach ( $getOldValue as $date => $value ) {
$str_ini .= "$date = $value\n";
}
file_put_contents($file, $str_ini);
Benjamin Adams wrote:
> $file = dog.txt;
> $today = date("Ymd");
>
> function incDate($new, $date){
> //$date = settype('int');
> return $new.($date++);
> }
>
> $getOldValue = parse_ini_file($file, 1);
> $newValue = $getOldValue[$today] + 1;
> $oldDate = $today . " = ". $newValue;
> $newDate = preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate("$1","$2")',
> $oldDate);
> file_put_contents($file, $newDate . "\n");
>
> This works with one file but with multi lines I'm having trouble:
> if the file has:
> 20060301 = 34
> 20060302 = 3
> the file after script will be:
> 20060302 = 4
>
> I want it to preserve the previous lines
> so output should be:
> 20060301 = 34
> 20060302 = 4
>
> Help would be great, thanks
> Ben
--
Atentamente,
J. Rafael Salazar Magaña
Innox - Innovación Inteligente
Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE
http://www.innox.com.mx
attached mail follows:
Raúl Castro Marín wrote:
> I got a little question, I just start to use binding adodb but I got a problem: my primary query on Oracle is:
>
> $query = "SELECT munici_mun, UPPER(nombre_mun)
> FROM MUNI
> WHERE departa_dpt = ? AND
> munici_mun <= 994";
>
> It is execute with any problem, but when I add another clause with keyword:
>
> AND UPPER(nombre_mun) LIKE '%?%' then next sentence is execute but no record is returned
> $query = "SELECT munici_mun, UPPER(nombre_mun)
> FROM MUNI
> WHERE departa_dpt = ?
> AND munici_mun <= 994
> AND UPPER(nombre_mun) LIKE '%?%'
>
> I think that adodbd doesn't parse "?" like a variable on clause LIKE '%?%'. What can I do to write this sentence correctly?
>
> thanks for your help!
Hi,
You might get a quicker response on their mailing list:
http://adodb.sourceforge.net/#mail
It might not pick it up because it's in quotes but they will be able to
tell you for sure.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Benjamin:
>I'm trying subtract to dates the user enters in and get the days between.
>Dates are stored as
>date('mdY')
>is there a built in function to subtract to dates is this format?
Try this for starters:
<?php
$century = mktime(12, 0, 0, 1, 1, 2001);
$today = time();
$difference = $today - $century;
echo 'This century started ';
echo floor($difference / 84600);
$difference -= 84600 * floor($difference / 84600);
echo ' days, ';
echo floor($difference / 3600);
$difference -= 3600 * floor($difference / 3600);
echo ' hours, ';
echo floor($difference / 60);
$difference -= 60 * floor($difference / 60);
echo " minutes, and $difference seconds ago.";
?>
There are other examples at:
http://www.weberdev.com/get_example-3646.html
http://www.weberdev.com/get_example-3240.html
http://www.weberdev.com/get_example-95.html
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
attached mail follows:
Roy Souther wrote:
> It is and the key word here is "Follow" as in resolve the real file
> location before parsing.
>
> This is clearly an Apache problem. I have asked this question on a few
> Apache forums and lists now and have not had any response.
>
> Is there any way to make Apache parse the files where it finds them and
> not go looking for the real file?
No, because it has to verify the file exists in the original place etc
first.
Just like in shell, if you have a symlink from /symlink to /realfile -
the o/s has to verify that the /realfile exists before you can use /symlink.
> On Thu, 2006-02-23 at 15:59 -0700, Joel Leibow wrote:
>
>>You need to check your httpd.conf and make sure the "Options FollowSymLinks"
>>is set for the server. Check the apache documentation for further
>>information.
>>
>>Joel Leibow
>>
>>"Roy Souther" <roy
silicontao.com <mailto:roy
silicontao.com>> wrote in message
>>news:1140654329.11677.44.camel
UtopiaPlanetia...
>>I am trying to stop PHP from resolving symlinks. I have a PHP CMS that I use
>>to host dozens of sites using Apache virtual hosting features. I need all
>>the sites to run the exact same PHP CMS code but use their unique
>>directories to host the different config files. The problem is that the PHP
>>scripts are running from the directory that the links point to and not the
>>directory where the site is. The big problem with that is the CMS tries to
>>read a configuration file that is in a relative location to the PHP script
>>like ../config.php.
>>
>>root
ttyq0[~]# ls -l /usr/local/cms
>>-rw-r--r-- 1 user users 20 Jan 16 02:17 index.php
>>drwxr-xr-x 9 user users 4096 Feb 22 16:40 admin
>>root
ttyq0[~]# ls -l /vhost/test01.com/var/www/html/
>>-rw-r--r-- 1 user users 20 Jan 16 02:17 config.php
>>lrwxrwxrwx 1 root root 31 Feb 22 14:05 index.php ->
>>/usr/local/cms/index.php
>>lrwxrwxrwx 1 root root 31 Feb 22 14:05 admin ->
>>/usr/local/cms/admin
>>root
ttyq0[~]# cd /vhost/test01.com/var/www/html/admin/
>>root
ttyq0[admin]# pwd
>>/vhost/test01.com/var/www/html/admin
>>root
ttyq0[admin]#
>>
>>Bash is doing what I need. It sees the current directory as the full path of
>>the symlink.
>>
>>The admin.php at this point only has system("pwd"); in it and it prints out
>>/usr/local/cms/admin as the directory it is in, not what I want. It will
>>never see the ../config.php file.
>>
>>I tried doing this
>>chdir ($_SERVER[DOCUMENT_ROOT]."/".$_SERVER[REQUEST_URI]);
>>but it still resolves the link and does not accept the path that I
>>constructed.
>>
>>How can I make PHP use the symlink and stop trying to resolve the original
>>files?
>>
>>
>>Royce Souther
>>www.SiliconTao.com <http://www.SiliconTao.com>
>>Let Open Source help your business move beyond.
>>
>>For security this message is digitally authenticated by GnuPG.
>>
>
> _Royce Souther <mailto:roy
SiliconTao.com>_
> _www.SiliconTao.com <http://www.SiliconTao.com>_
> Let Open Source help your business move beyond.
>
> For security this message is digitally authenticated by _GnuPG
> <http://www.gnupg.org>_.
>
>
>
>
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
tedd wrote:
>> I have a list from a MYSQL database that I am dumping to a screen. I'd
>> like the user to be able to change the quantity on the form for any
>> record on the screen, then post that information back so the user can
>> review it, and I can then update the database.
>>
>> Simple checkout routine. Or so I thought.
>>
>> I have these fields displayed on the screen before the user changes
>> the quantity:
>>
>> $imageqty = $row["cialbum"]."-".$row["ciset"]."-".$row["ciimage"];
>> $qty = $row["ciqty"];
>> print "<td align='center' valign='top'><input type='text'
>> name='$imageqty' size='5' value='$qty'></td>";
>>
>> I've set the $imageqty variable to hold the initial value from the
>> database. The initial screen works fine.
>>
>> However, when I reprocess the file, how can I retrieve the original
>> value of the field that is named the same as $imageqty?
>>
>> The form outputs something like this:
>> http://.../chkout.php?NATURE-1.jpg=6&continue=Continue+Checkout, which
>> does show the $imageqty of "NATURE-1.jpg" value with the new qty of "6".
>>
>> How can I get the script to pull the value?
>>
>> $imageqty = $row["cialbum"]."-".$row["ciset"]."-".$row["ciimage"];
>> $newqty = $_GET["$imageqty"];
>>
>> Retrieves nothing.
>>
>> Thanks for your help.
>>
>> Pat
>
> Pat:
>
> I would suggest changing to:
>
> http://.../chkout.php?imagename=NATURE-1.jpg&count=6&continue=Continue+Checkout,
>
>
> $newqty = $_GET['count'];
> $imagename = $_GET['imagename'];
>
> Also, to see what you are actually "getting" try:
>
> echo ("<br/>");
> echo ("<pre>");
> echo ("GET info:\n");
> print_r($_GET);
> echo("</pre>");
>
> You might also want to consider taking care of undefined variables --
> here's a reference:
>
> http://www.weberdev.com/get_example-3823.html
>
> HTH's
>
> tedd
>
Ok, this works for one item, but my shopping cart may have (hopefully)
dozens of items in it. How do I refer to each new quantity changes for
each new row in the table? I was hoping that by making the qty field a
name of the image, I would be able to match the new qty up with the
right image quickly, but that won't work, obviously.
How can I change multiple items in a list (or all) when the list is
dynamically created? My approach may be wrong -- suggestions?
Pat
attached mail follows:
>>Pat:
>>
>>I would suggest changing to:
>>
>>http://.../chkout.php?imagename=NATURE-1.jpg&count=6&continue=Continue+Checkout,
>>
>>$newqty = $_GET['count'];
>>$imagename = $_GET['imagename'];
>>
>>Also, to see what you are actually "getting" try:
>>
>>echo ("<br/>");
>>echo ("<pre>");
>>echo ("GET info:\n");
>>print_r($_GET);
>>echo("</pre>");
>>
>>You might also want to consider taking care of undefined variables
>>-- here's a reference:
>>
>>http://www.weberdev.com/get_example-3823.html
>>
>>HTH's
>>
>>tedd
>>
>
>Ok, this works for one item, but my shopping cart may have
>(hopefully) dozens of items in it. How do I refer to each new
>quantity changes for each new row in the table? I was hoping that by
>making the qty field a name of the image, I would be able to match
>the new qty up with the right image quickly, but that won't work,
>obviously.
>
>How can I change multiple items in a list (or all) when the list is
>dynamically created? My approach may be wrong -- suggestions?
>
Pat:
You can add numerous items to the url. I don't remember the total
number of characters that's allowed, but it's considerable.
If you reach the limit, but might consider reducing the number of
characters in your variables, such as: "NATURE-1.jpg" could be n1
where you had a look-up table or you knew what the cryptic code was
to make the transformation.
Or you could continue on a course like you were with n1=6 where you
know that n1 stands for "NATURE-1.jpg" and the value contained
therein is the value for that image.
There's lot's of ways to do this.
As for it being dynamically created, that shouldn't present a problem
either -- just treat the url as a string and add ampersands (&)
between "variables and their value" pairs.
HTH's
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
attached mail follows:
Thanks to all who helped.
The answer...drumroll.... arrays for each entry:
load routine (partial):
print "<td align='center' valign='top'><input type='text'
name='imageqty[]' size='5' value='$qty'></td>";
print "<input type='hidden' name='hiddenalbum[]'
value='".$row[cialbum]."'>";
print "<input type='hidden' name='hiddenset[]' value='".$row[ciset]."'>";
print "<input type='hidden' name='hiddenimage[]'
value='".$row[ciimage]."'>";
print "<input type='hidden' name='hiddensize[]'
value='".$row[cisize]."'>";
retrieval routine (partial):
$cartid = $_COOKIE['PHPSESSID'];
$imageqty = $_POST['imageqty'];
$qty = $_POST["imageqty"];
$album = $_POST["hiddenalbum"];
$set = $_POST["hiddenset"];
$image = $_POST["hiddenimage"];
$size = $_POST["hiddensize"];
$n = count($qty);
$index = 0;
while($index < $n)
{
$newqty = $qty[$index];
$queryupdate = "update CartItems set ciqty = '$newqty' where ciid =
'$cartid' and cialbum = '$album[$index]' and ciset = '$set[$index]' and
ciimage = '$image[$index]' and cisize = '$size[$index]'";
querythedatabase($queryupdate); // my routine
$index++;
}
attached mail follows:
Thanks for the advice-- I've run Linux without a GUI for a long time,
so I'm quite familiar with hand compilations-- but I always wondered
if I was just missing something with packaging systems that it seemed
to REQUIRE hand-compilation to get a workable development LAMP system.
Anytime I tried using packages some need seemed to force me back to
doing it by hand.
So I guess my more specific question would have been: Are there any
distributions that actually TARGET developers and I Was curious about
desktop tools. I own Zend but tend to use Homesite and Emacs in
regular doses. Guess I will probably stick with Emacs and use Zend
more. I know enough Vim to survive, but it just isn't "me" :)
c
attached mail follows:
Chris Lott wrote:
> Thanks for the advice-- I've run Linux without a GUI for a long time,
> so I'm quite familiar with hand compilations-- but I always wondered
> if I was just missing something with packaging systems that it seemed
> to REQUIRE hand-compilation to get a workable development LAMP system.
> Anytime I tried using packages some need seemed to force me back to
> doing it by hand.
>
> So I guess my more specific question would have been: Are there any
> distributions that actually TARGET developers and I Was curious about
> desktop tools. I own Zend but tend to use Homesite and Emacs in
> regular doses. Guess I will probably stick with Emacs and use Zend
> more. I know enough Vim to survive, but it just isn't "me" :)
>
> c
I've found that Quanta is pretty good for my taste.
attached mail follows:
Chris Lott wrote:
> Thanks for the advice-- I've run Linux without a GUI for a long time,
> so I'm quite familiar with hand compilations-- but I always wondered
> if I was just missing something with packaging systems that it seemed
> to REQUIRE hand-compilation to get a workable development LAMP system.
> Anytime I tried using packages some need seemed to force me back to
> doing it by hand.
I guess it depends on what you are developing.. Most package systems
have the extensions available but not installed by default (eg
php-mysql, php-pgsql, php-imap etc).
> So I guess my more specific question would have been: Are there any
> distributions that actually TARGET developers and I Was curious about
> desktop tools. I own Zend but tend to use Homesite and Emacs in
> regular doses. Guess I will probably stick with Emacs and use Zend
> more. I know enough Vim to survive, but it just isn't "me" :)
I don't think any actually target developers.
You could always run either *bsd or gentoo, they are ports based and
compile most stuff from scratch so should be quite easy to get it
exactly how you want it.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
I am trying to setup a webserver for testing at home. I can execute php
scripts fine, but I cannot include local files like include (test.php). The
page comes up with a permission denied. The url is
http://mojo.hst-percussion.com/index.php. The phpinfo is
http://mojo.hst-percussion.com/test.php. Can someone point me a direction
to look? Thanks.
Chris Taylor
attached mail follows:
Christopher Taylor wrote:
> I am trying to setup a webserver for testing at home. I can execute php
> scripts fine, but I cannot include local files like include (test.php). The
> page comes up with a permission denied. The url is
> http://mojo.hst-percussion.com/index.php. The phpinfo is
> http://mojo.hst-percussion.com/test.php. Can someone point me a direction
> to look? Thanks.
>
> Chris Taylor
>
Hi Chris,
What permissions are on the other files ? Are they set to '644' or
something else?
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Here is the url
http://pastebin.com/579621
attached mail follows:
I have been trolling through hotscripts.com and google all night and
have tried out a couple of promising-looking PHP-based calendar
scripts with no luck, so I'm turning to the collective wisdom of the
list to help me out. I'm looking for a calendar script that I can plug
into a web site that can support color-coded categories and multiple
calendars per installation. Single user is fine, I just need something
that a web novice can use to enter in dates that properties are either
available or not available with color codes indicating tentative
reservations and confirmed reservations. I'm about ready to start
rolling my own, but before I do that, I'm hoping that one of you knows
of a script that is out there (preferably for free, but at least less
than $50) that I could use. Thanks, in advance, for your help!!
--
Robin Hastings
robin.hastings
gmail.com
http://www.rhastings.net
attached mail follows:
Hi all, I am trying to trigger a php script by sending an email to it. The
script commences with
#!/usr/local/bin/php
to run as a general cgi, and then proceeds to access the email by opening
php://stdin. I get all that.
However, I am editing the /etc/aliases file to create an email alias for the
script by inserting the following line:
agecon "/|/home/agecon/dm/ac_incomingphp"
...as per the usual process, the user where my files are is called agecon,
so I expect that when I send an email to agecon
***.co.uk it will be passed
the the script. I ran sendmail -bi to update the alias after editing but
when I send the email nothing happens. Am I missing something.
I understand that this is a php/Linux question rather than a pure php
inquiry but wonder if anyone has tried to do the same thing.
Thanks in advance, dave goodchild (web-buddha.co.uk)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]