Redirect link in the popup window

Home Forums Quform WordPress Redirect link in the popup window

This topic is: not resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3277
    baus
    Participant

    Ciao,
    thanks for the plugin…it works beautifully…!
    I’m wondering if it’s possible to get redirected to a URL after a submission but not leaving the popup window…having the page loaded directly in the quform popup…
    As alternative I’m trying to pass the data to another script (still in my website but outside wordpress), it’s a login redirect…
    I’ve followed these instructions, made a couple of tries but won’t work

    Send form data to another script


    thanks in advance
    Filippo

    #3281
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #3292
    baus
    Participant

    Ciao,
    I did it but no log file showing
    how can we proceed…?
    I post the redirect script so maybe you get a better idea

    //prevents caching
    header(“Expires: Sat, 01 Jan 2000 00:00:00 GMT”);
    header(“Last-Modified: “.gmdate(“D, d M Y H:i:s”).” GMT”);
    header(“Cache-Control: post-check=0, pre-check=0”,false);
    session_cache_limiter();

    session_start();

    //clear session variables
    session_unset();

    //require the functions file
    require (“config.php”);
    require (“functions.php”);

    //check to see if cookies are already set, remember me
    if ((!$lr_user) || (!$lr_pass))
    {

    $username = $_POST[username];
    $password = $_POST[password];

    }else{

    $username = $lr_user;
    $password = $lr_pass;

    }

    //if username or password is blank, send to errorlogin.html
    if ((!$username) || (!$password))
    {

    header(“Location:$base_dir/errorlogin.html”);
    exit;
    }

    //sets cookies to remember this computer if the user asks to
    if ($_POST[remember] == “Yes”)
    {
    setcookie(“lr_user”, $username, $duration, “/”, $domain);
    setcookie(“lr_pass”, $password, $duration, “/”, $domain);
    }

    if ($_POST[activate] == “Yes”)
    {
    //make the connection to the database
    $connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
    $db = @mysql_select_db($db_name,$connection)or die(mysql_error());

    //build and issue the query
    $sql =”UPDATE $table_name SET verified = ‘1’ WHERE username = ‘$_POST[username]'”;
    $result = @mysql_query($sql,$connection) or die(mysql_error());
    }

    //sets session variables
    sess_vars($base_dir, $server, $dbusername, $dbpassword, $db_name, $table_name, $username, $password);

    //check to see if the user has to change their password
    if ($_SESSION[pchange] == “1”)
    {
    $_SESSION[redirect] = “$base_dir/pass_change.html”;
    }

    //check to see if the user has activated the account
    if ($_SESSION[verified] == “0”)
    {
    $_SESSION[redirect] = “$base_dir/not_activated.html”;
    }

    //make the connection to the database
    $connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
    $db = @mysql_select_db($db_name,$connection)or die(mysql_error());

    //build and issue the query
    $sql =”SELECT * FROM banned”;
    $result = @mysql_query($sql,$connection) or die(mysql_error());

    while ($sql = mysql_fetch_object($result))
    {
    $banned = $sql -> no_access;
    if ($username == $banned || $REMOTE_ADDR == $banned)
    {
    include (‘banned.html’);
    exit;
    }
    }

    $last_log = last_login();

    //updates table with last log as now
    $sql = “UPDATE $table_name SET last_login = ‘$last_log’ WHERE username = ‘$_SESSION[user_name]'”;
    $result = @mysql_query($sql,$connection) or die(mysql_error());

    if (($_SESSION[redirect] != “$base_dir/errorlogin.html”) && ($log_login == “1”))
    {
    include(‘loglogin.php’);
    }

    if ($username == “Baus”)
    {
    header(“Location:$_SESSION[redirect]”);
    }
    else
    {
    header(“Location:prebooking.php?uname=$username&psw=$password”);
    }
    ?>

    Redirect

    And this is what I add to my function:

    function mytheme_post_to_another_script($form)
    {
    // Rewrite the post variables
    $post = array(
    ‘username’ => $_POST[‘iphorm_5_1’], // Change iphorm_X_X to name field unique ID
    ‘password’ => $_POST[‘iphorm_5_3’], // Change iphorm_X_X to email field unique ID

    );

    // Create a new cURL resource
    $ch = curl_init();

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, ‘http://www.cinqueterreriviera.com/LoginMe/redirect.php’);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));

    // Grab URL and pass it to the browser
    curl_exec($ch);

    // Close cURL resource, and free up system resources
    curl_close($ch);
    }
    add_action(‘iphorm_post_process_5’, ‘mytheme_post_to_another_script’, 10, 1);

    Let me know
    thanks again
    Filippo

    #3301
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy