#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    7
    Rep Power
    0

    How to redirect to a javascript function after $insertGoto


    Hi, I am a new on php and sql statements. I'm working with a java script like javascript:cargarExterno('medaceptacondiciones.php', 'contenido')

    I need, when update a table, in the sentence $insertGoTo = " " to load a php file using that javascript sentence.

    This is the actual code
    Code:
      $insertGoTo = "medingresacaso.php?recordID=".$_POST['num_caso'];
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
    The reason is that i am using DIVs in order to keep loading files in one index.php (
    Code:
    <a href="javascript:cargarExterno('medlistadocasos.php', 'recargado');">
    ), but in this case, when Insert into table loads the next page in another window.

    I need to load $Insertgoto in the same div

    Thanks
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,905
    Rep Power
    6351
    Then you need to be fetching this page via ajax and populating the proper div. PHP can't "load itself" inside a specific DIV, it's an all-or-nothing thing.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo