Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6903947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:59:19+00:00 2026-05-27T07:59:19+00:00

Okay, Ive searched around and found how this is supposed to be done. For

  • 0

Okay, Ive searched around and found how this is supposed to be done. For example, finding this question. However it is not working for me, so I must be doing something wrong, but darned if I know what.

Okay… here is my little code block:

<?php
    session_start();

    if(!isset($_SESSION['didit'])) {
        $url = "http://www.mysite.com/clients/vatera.asmx/DoSomething";
        file_get_contents($url);
        $_SESSION['didit'] = true; 
    }
?>

The url file_get_contents is all working perfectly. The only thing not working is the “run once” check. It is running the url code EVERY time through the page. It should only run it the first time you hit the page in a session. This block is located immediately following the <html> tag in my page.

Some other things I have tried:

if(empty($_SESSION['didit']))
if($_SESSION['didit'] != true)
if($_SESSION['didit'] <> true)

I also tried moving the line setting the variable to precede the $url assignment.

None of these have worked. It continues to run the code EVERY time the page is loaded.
Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:59:20+00:00Added an answer on May 27, 2026 at 7:59 am

    When you say “following the <html> tag”, you mean before, right?
    session_start() must come before any output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I've been working on this for days now and I can't find any
Okay I do not even know where to begin when it comes to this
Okay I just typed this whole question out and then managed to delete it.
Okay, I am having a hard time with this. I've searched for the past
I've searched SO and this question seems to have been asked multiple times, but
Okay so ive been reading up on and working with SQLite recently (someone on
Okay, so I've seen this question about this problem being caused by multiple linkings
Okay, I've searched around the other questions with similar names here, but no dice.
Okay i am working on someone elses code. They do alot of this: char
Okay, I've managed to get .on working on a different site, but for some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.