Results 1 to 9 of 9

Thread: quick php help - should be an easy fix

  1. #1
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default quick php help - should be an easy fix

    how would i make this open in a new window?

    <?php
    if (is_array($payment_modules->modules)) {
    echo $payment_modules->process_button();
    }

    echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";
    ?>


    Thanks much!
    Jon

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You can use the Location: header..

    PHP Code:
    header("Location: http://yoursite.com/newpage.php"); 
    But I am not sure if you want this as part of the if/else or when the button is pressed...
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    Actually, whats happening is that this is a peice of Oscommerce's cart, and for what ever reason since it is being run out of an iframe the paypal payments wont function properly, so i figured if when they clicked "Confirm Order" it would bring a popup to the paypal site, which should work... rather than just loading it in the iframe, which isnt working...

    Basically im just trying to do something like <target="_blank"> except in php

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Oh, well.. you CAN do it in php, but I find JS to handle "pop-ups" a lot better..

    Code:
    <script language="JavaScript">
    <!-- //
    function wo(url, name, bits) {
    newWin=window.open(url, name, bits);
    newWin.focus();
    }
    // -->
    </script>
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    Oh, so where exactly should i place it in the code?

    It's kind of confusing because its not calling a specific page, rather a "payment module"

    Or at least that's what i think is happening.


    Also, this is just a segment of code... the page is rather long.
    Last edited by Jon101; 12-19-2007 at 05:44 PM.

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You can use the above code, changed to your attributes, in the <head>
    then in the <body> you call it like so:

    Code:
    <a href="popup.html" onclick="return wo('popup.html')"
    	>Link to popup</a>
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. #7
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    ALright cool, but the code above will work in php?

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Yup. It is just basic JS for a pop up.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  9. #9
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    alrightie, thanks for the help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •