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 8748251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:29:34+00:00 2026-06-13T12:29:34+00:00

i had some issues with understanding how to get javascript (client) variables transferred so

  • 0

i had some issues with understanding how to get javascript (client) variables transferred so they were acessible from php (serverside) as session : get an iframe's "src" value in PHP?

Now im in a situation where i use firebug to try to debug whats going on, but it just doesnt make sense :

i have this function to update an iframe and i want to pass on the page that that iframe is displaying :

function frameclick(pageurl)
 {
        $.post("session_write.php?",
    {
            frameurl : pageurl             
    }

    $("#iFrame1").attr('src', pageurl);
    console.log  ('<?php echo "logout:".$langpath.$_SESSION['frameurl'];?>');
 }

pageurl is ex. “/lang/en/new.htm” – and if i inspect it with firebug i also can see it says that it passes it correctly ( also with conversion of /).

my script serverside that its posted to is like this :

#session_write.php
<?php
session_start();
print_r($_GET['frameurl']);
if (isset($_GET['frameurl'])) 
{
$_SESSION['frameurl'] = $_GET['frameurl'];
print_r($_SESSION);
}
?>

Posting to that php script on the server will fail via the javascropt – $_SESSION[‘frameurl’] will be ”, but if i ex. do it manually like this :
(http):

//localhost/phpmenu/session_write.php?frameurl=lang%2Fen%2Fnew.htm

then it will be correctly set in the $_SESSION[“frameurl”] variable.

I simply cannot understand whats different between doing the javascript post and doing it manually in the browser and why its causing me this problem ?

anyone with an idea ? thanks

  • 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-06-13T12:29:35+00:00Added an answer on June 13, 2026 at 12:29 pm

    You are using .post, which executes a POST request, but when you type in the URL in the address bar, that is a GET request.

    $_GET retrieves any params passed through GET, while $_POST retrieves any params passed through POST. So if you use .post with Javascript but try to retrieve with $_GET in PHP, it wouldn’t work.

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

Sidebar

Related Questions

So, I've had some issues while trying to come over from Latin1 encoded databases,
I'm using Fedora and I have had some issues to get javac to work
I had some issues with XPTemplate vim plugin. Sometimes it yields with errors, and
I had some issues with Lucene as it always had a constant score and
So basically this code was working fine before. I had some computer issues and
I had some issues with a different ODM yesterday so I decided to take
I have had some issues with a site (basically MySQL is killing the proccessor)
Trying to install roundcube webmail - had some issues related to driver configuration -
I have had some issues with downtime as a result of hitting the max_user_connections
I had some issues along with others, loading Tomcat 7.0.22.0 with NetBeans on packaged

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.