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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:52:50+00:00 2026-06-03T09:52:50+00:00

I am completely new to all of this coding.. so I apologies for my

  • 0

I am completely new to all of this coding.. so I apologies for my ignorance in advance.

I have this jquery function (button) which changes the size of the table of where my Post.php is loaded, (to alternate between portrait and landscape). the function itself works great in changing the size however i am stuck in reloading the post.php page.

 $("#cSize").toggle(
 function () {
 $('#p_CWidth').animate({width:720});
 $('#p_SWidth').animate({width:110});
 }, function() {
     $('#p_CWidth').animate({width:520});
 $('#p_SWidth').animate({width:310});
 });

what i need to add to this code is away of changing the variable p_Type to true or false and reloading the post.php or the div p_Post

 <div id="p_Post">
 <? $p_type = true;
 include 'profile/post.php'; ?>
 </div>

post.php with the above code is loaded fine and i tested it by manually changing p_type to false/true and it loaded ok. But how can i get this automated with the jquery functoin above?

I have tried .load(‘profile/post.php’) however this brings me an error for db access!!

any help is really appreciated
AB

UPDATE

I have changed my php file to just a simple php without any link to mysql for testing, and i have tried the suggested code:

var p_type = false;
$("#cSize").toggle(function () {
   $("#p_post").load('profile/post.php',{ 'p_type' : p_type }, function { 
       p_type = !p_type; //toggle the value for automation
});

   $('#p_CWidth').animate({width:720});
   $('#p_SWidth').animate({width:110});

});

and sadly that doesnt seem to work?!!

but with some trial and error i have manged to get change in size working again, and the php reloaded for the first time with the new right variable (p_type), however for some reason the php file only loads once! so it doesnt go back to the normal size with (p_type as true after being set as false)??? here is the code:

   $("#cSize").toggle(
    function () {
  $('#p_CWidth').animate({width:720});
  $('#p_SWidth').animate({width:110});
  $("#p_Post").load('profile/p_post.php',{ p_type : false });
}, function() {
      $('#p_CWidth').animate({width:520});
  $('#p_SWidth').animate({width:310});
  $("#p_Post").load('profile/p_post.php',{ p_type : true });
   });

Thank you again in advance

ps. here is the toggle example i followed http://jsfiddle.net/6FMZY/

  • 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-03T09:52:51+00:00Added an answer on June 3, 2026 at 9:52 am

    Soooorted!

    I have edited the p_post.php to make it easier by adding get function:

    <?
    if(isset($_GET['p_type'])){
    $p_type=$_GET['p_type'];
    }
    
    if($p_type == "normal"){
     // what happen here
    } if($p_type == "wide"){
     // what happen here
    }
    ?> 
    

    for the jquery i used:

    $("#cSize").toggle(
    function () {
       $('#p_CWidth').stop(true).animate({width:720});
       $('#p_SWidth').stop(true).animate({width:110});
       $("#p_Post").load('profile/p_post.php?p_type=wide');
    }, function() {
       $('#p_CWidth').stop(true).animate({width:520});
       $('#p_SWidth').stop(true).animate({width:310});
       $("#p_Post").load('profile/p_post.php?p_type=normal');
    });
    

    Now its working perfect and just need to sort the denied access issue for php!!
    Thank you again for the help

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

Sidebar

Related Questions

New to all coding worlds and new to RoR. I have been doing a
I'm working on a customizations website completely on jQuery (I'm completely new to coding
I am completely new to Jena/TDB. All I want to do is to load
I'm completely new to regular expressions, and I need to filter all the words
Completely new to most of this stuff, but basically Im playing around with the
Completely new to java and I have been playing around with regex in a
I am completely new to HTML5 and have been reading about it for the
I'm currently planning (and part coding) a new app. I have an array of
How can I create a completely separate and new event object that contains all
Well, I was completely re-coding my advanced IRC bot to allow all methods and

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.