Have you tried ...?Re: your first post, short tags are really not recommended.?php
zen_redirect("my_product_home");
?>
Have you tried ...?Re: your first post, short tags are really not recommended.?php
zen_redirect("my_product_home");
?>
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Thanks for your reply.
Unfortunately, no luck with the change you recommended. Per your second recommendation, once I can get the redirect functionality working, I will make the change to get rid of my short tags.
I have attached a small snapshot of what my screen looks like when I load index.php?main_page=my_test_page. As you can see, the header title "my_test_page" shows up but is blank underneath.
FAQ on troubleshooting blank pages (or blank "parts of pages"): https://www.zen-cart.com/tutorials/index.php?article=82
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks DrByte. I'll download the error debugging utility and give it a try. In the meantime, could you (or anybody else) give me the proper way to redirect from within a define page?
Right now, all I have on my define redirect page is:
Code:<?php zen_redirect("index.php?main_page=my_product_home"); ?>
I've eliminated anything extraneous to get the redirect functionality working.
Other than the usage of short tags, I am pretty sure this function call is written correctly. When I place the same function call in /modules/pages/my_test_page/header_php.php the redirect works fine. It seems to me that I simply don't know the correct way to redirect from within the define page, rather than the header. I've successfully written php scripts and redirected on other projects using header(location: $url) but something is different in this case.
Thanks again for all your help.
Dustin
Last edited by dgsignal; 26 Jun 2008 at 02:24 AM. Reason: spelling error
I doubt you'll have any success doing a header-redirect from inside the define_xxxxxx.php file of a define page ... because the HTML headers have already been sent to the page. Thus, PHP will not let you send redirect or any other header commands, since they must happen before any HTML content is sent to the browser.
If you must do a redirect from that position, you'll probably have to do it with javascript.
Or better yet, do it from within header_php.php, since that's the correct place to do form processing and redirects ... certainly much more appropriate there than in a template-output file as you're doing now.
The real question is ... "why" are you trying to do a redirect from within a define page? What you've described seems like you're going about it the wrong way.
If it's email processing of collected information, the following is a packaged approach: http://www.zen-cart.com/forum/showth...482#post386482
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
DrByte, thanks for the information. It's been obvious from the get go that I must be taking the wrong approach for my forms. What I'm hoping now is that you'll be able to give me some insight as to where and how my form integration should take place.
My goal is to have a couple of forms that take in some information from the user, validate, then store it in a table in the database. Apparently, I have incorrectly assumed that I could put the html form tags and validation code into the define pages. Instead, should I place this code into the header_php.php file?
Thanks again for your help. Your last email definitely got me headed in the right direction.
Dustin
It's not really that what you're doing is wrong. More that you're trying to do it from the wrong place.
Each define page has a includes/modules/pages/page_name/header_php.php file and sometimes a main_vars.php file too. These normally process the data that will be used on the page and if a reason for a re-direct emerges, will execute it from there. This is probably where you should be executing yours.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)