Welcome to Geeklog, Anonymous Sunday, November 24 2024 @ 12:47 pm EST
Geeklog Forums
How can I break PHP staticpages?
Status: offline
LWC
Forum User
Full Member
Registered: 02/19/04
Posts: 818
How can I make PHP staticpages only work in certain situations?
If I try:
exit();
then it also blanks out the entire page (if it's a centerblock).
If I try:
break;
or
continue;
tnen the staticpage causes this error:
Finally,
return "";
does work, but is this the correct way? It's not a function after all, but direct code.
If I try:
Text Formatted Code
if (...)exit();
then it also blanks out the entire page (if it's a centerblock).
If I try:
Text Formatted Code
if (...)break;
or
Text Formatted Code
if (...)continue;
tnen the staticpage causes this error:
Fatal error: Cannot break/continue 1 level: eval()'d code
Finally,
Text Formatted Code
if (...)return "";
does work, but is this the correct way? It's not a function after all, but direct code.
3
7
Quote
Status: offline
jmucchiello
Forum User
Full Member
Registered: 08/29/05
Posts: 985
If the static page is of the return a string type, you just return an empty string.
If it's an output captured page, return should work. You get the result of the eval'd code by checking the return from eval:
$result = eval("return 4;"
If you don't have anything to return, use return;
If it's an output captured page, return should work. You get the result of the eval'd code by checking the return from eval:
$result = eval("return 4;"
If you don't have anything to return, use return;
8
6
Quote
All times are EST. The time is now 12:47 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content