Forum Moderators: coopster

Message Too Old, No Replies

Fatal error: Can't use function return value in write context

I've never seen this before, what is it?

         

jake66

3:01 am on Mar 18, 2008 (gmt 0)

10+ Year Member



Fatal error: Can't use function return value in write context in /home/***/public_html/includes/classes/split_page_results.php on line 83

Line 83:

if ($this->current_page_number > 2) str_replace('=', '/',$display_links_string) .= '[ <a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageclass" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><i>Previous</i></a> ] &nbsp;&nbsp;';

I've bolded what I added to the script that broke it.

What I am trying to do:
This code generates a dynamic link. I'm trying to replace the ? = & characters with / to replace them with static URLs.

Am I approaching this incorrectly? (The URLs are already in place for htaccess, I just need to get my script to output them)

Habtom

4:47 am on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Remove the str_replace you just added, and do the task of replacing above the line.

$display_links_string = str_replace('=', '/',$display_links_string);

jake66

5:14 am on Mar 18, 2008 (gmt 0)

10+ Year Member



Hi Habtom,

I added this to my script and got no errors.. but my links still appeared as ?page=20

I am wondering if I am using the wrong variable. I tried several different $vars like you posted, and none worked. No errors, but no replace either.

Habtom

5:28 am on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see your link is coming from the $PHP_SELF, and the parameters following, if you need to do the replacement you need to do it, right after you construct the link. I hope you see what I mean.