Hi David,
A Couple of issues related to the reviews that I am experiencing on RewardsDB.com.
1) When you submit a review you just get a broken screen.
2) When you approve a review in admin you get a broken screen as well.
Both 1&2 actually work to submit and approve the review so its the confirmation page part of the process that's broken.
3) I'd like to include the reviews in the product page (at the bottom after the related links) rather than as an independent page. How would I go about this.
Thanks,
Andrew
Thanks,
I incorporated the code changes to products.php - seems to work great.
Still have the problem with submitting and approving reviews - From memory it has never worked, it's just never been a big deal until now. Try it out and you can see what I mean. On RewardsDB.com it loads the header and then seems to freeze up instead of giving a confirmation.
Thanks again for the help - you offer the best support I have ever encountered!
Andrew
Hi Andrew,
I think I can see what the problem is.
It seems that content is being generated before the review has been processed, and therefore PHP cannot redirect to the confirmation page. If error reporting was turned up higher on your server, I think you would be seeing the following message.
"Cannot send headers output already started at [file] on line [line]..."
To resolve this, you need to have a look at how you are generating your custom header / footer etc. Ideally, you should not begin any HTML output until the file html/header.php, which in the distribution is where the HTML begins. Prior to this, scripts such as the review script have the chance to do processing and then set the 302 redirection header...
If you study review.php and look at what is going on BEFORE the following code:
if ($config_useRewrite)
{
header("Location: ".$_SERVER["REQUEST_URI"]."?pending=1");
}
else
{
header("Location: ".$_SERVER["REQUEST_URI"]."&pending=1");
}
exit();
Above this, there should not be any HTML generation, and the only include file should be includes/common.php...
Hope this helps!
Cheers,
David.
Hmm,
Could it be something to do with my hosting company? I wonder since I get the same issue with my admin site which is a vanilla install of pricetapestry on a different domain (for security but writing to the same database).
Hi Andrew,
Do you mean that there is no modifications at all to the output above the redirection code in review.php? I would be surprised if 302 redirection is disabled, however you could test it out easily with the following code:
<?php
header("Location: /search.php");
exit();
?>
If you run that code in a test file in your Price Tapestry directory it should redirect to the search page...
Cheers,
David.
Hi Andrew,
What is actually displayed after submitting (or moderating) a review? Has it been working fine before and has only recently stopped working? These scripts simply use a 302 redirect to send the browser to the confirmation page, so it might be worth trying a different browser just incase something strange is happening on that front...!
Regarding displaying reviews and the review form on the product page, that's doable - i've posted a link to the code for that in the following thread. If you've heavily modified your product page you may just want to study the files in the .zip file and incorporate the changes into your own code...
http://www.pricetapestry.com/node/1244
Cheers,
David.