What is the url where you get 404 error ?
What is the url where you get 404 error ?
w00t I figured it out...it was the call to the sql query for the page that was screwing it up.
This is what worked:
Code:require './include/config.php'; if ($page_info['page_members_only'] == 1) { User::is_logged_in(); } function show_page_not_found() { header("HTTP/1.0 404 Not Found"); echo "<html><head><title>Page Not Found</title></head><body>Page Not Found</body></html>"; exit(0); } $smarty->assign('err', $err); $smarty->display('header.tpl'); $smarty->display('mypage.tpl'); $smarty->display('footer.tpl'); db_close();
If it's not fun, stop doing it!
There must be another way of doing this...I need some pages to be members only and some open to the public. Anytime I have the sql call in the beginning, I get "page not found"
If I have this, then the page is viewable by everyone. Another problem is that my php code on those special pages require information from the database and that information is not displaying.
Code:require './include/config.php'; if ($page_info['page_members_only'] == 1) { User::is_logged_in(); } function show_page_not_found() { header("HTTP/1.0 404 Not Found"); echo "<html><head><title>Page Not Found</title></head><body>Page Not Found</body></html>"; exit(0); }
If it's not fun, stop doing it!
in vshare2.6, we used to do somethin glike this and it would work, but doesn't with 2.7---the information from the database is not displayed in 2.7 and I'm using the same database script as I did with 2.6, other than changing the name of the database tables for 2.7 and using the new "include" codes posted earlier.
Code:<?php session_start(); require("include/config.php"); require("include/function.php"); if (!isset($_SESSION['USERNAME'])) { Header("Location: {$config['baseurl']}/login.php"); exit(0); } STemplate::assign('err',$err); STemplate::assign('msg',$msg); STemplate::display('../templates/header.tpl'); STemplate::display('../templates/error.tpl'); ==MY WHOLE BUNCH OF PHP CODE INCLUDING DATABASE QUERIES BLAH BLAH BLAH=== STemplate::display('../templates/footer.tpl'); db_close(); ?>
If it's not fun, stop doing it!
This is what I have in my mypage.php and it's not displaying the database information and I'm using the identical script that I was using in 2.6 (only change is the names of the tables). The page displays, the header and footer is all there..but the content is blank...no information is being shown from the database. The header for the <table> and the <td> cells show up, so I know all that's working but the information that's supposed to be in it is not there and I'm not getting a database error...I just can't figure out why the information won't display and how to get it for member only.
Code:<?php session_start(); require("include/config.php"); if (!isset($_SESSION['USERNAME'])) { Header("Location: {$config['baseurl']}/login.php"); exit(0); } $smarty->assign('err',$err); $smarty->assign('msg',$msg); $smarty->display('header.tpl'); $smarty->display('error.tpl'); ===============MY PHP SCRIPT HERE WHERE IT SHOULD DISPLAY DATABASE INFORMATION================ $smarty->display('footer.tpl'); db_close();
If it's not fun, stop doing it!
Here's what I got so far....the code I just posted above DOES work to make it member only...it's just not displaying the information from the database.
If it's not fun, stop doing it!
I got my problem sorted out. I used an example from another page to accomplish what I needed to accomplish, however, I'm going to miss the old way of doing it.
If it's not fun, stop doing it!
Bookmarks