Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Undefined Index Errors

Asked Modified Viewed 714 times
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
asked
Senior Member

I am getting headaches trying to figure out why I keep getting these errors on multiple pages of my blog infusion in 9.03.110.
I am using the coding that the previous errors suggested I use and it still gives these errors.

if (null !== 'post_id') {
    $post_id = $_GET['post_id'];
}

if (null !== 'topic_id') {
    $topic_id = $_GET['topic_id'];
}
Edited by Grimloch on 03-09-2021 14:32,
0 replies

1 post

R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

Uhm this is not PHP Fusion related thing.. Just simple PHP basics. Normally I don't provide support for that because Google is full of solutions, but well. Did you tried !empty() or isset() ?

This is standard that works everywhere
if (!empty($_GET['post_id'])) {
$post_id = $_GET['post_id'];
}

Or in newer v9 versions
if (check_get('post_id')) {
$post_id = get('post_id');
}


Btw. this if (null !== 'post_id') is nonsense. Here you checking string and not $_GET variable.
1 reply

Category Forum

General Discussion

Labels

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet