31 users online (0 members and 31 guests)  


  Results 1 to 4 of 4

Related

  1. Syntax for Select Statement    Forum: Databases
    Replies: 2
  2. sql syntax error    Forum: PHP Forum
    Replies: 1
  3. Update syntax    Forum: PHP Forum
    Replies: 2
  4. XML syntax question~    Forum: Website Scripts Forum
    Replies: 4
  1. #1
    annmartinson's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Location
    Spokane, WA USA
    Posts
    15

    need syntax for redirect to target

    One field called cat_url, one field called cat_target
    if target is empty, no target added to redirect, but if it has a value, I want to add this to the redirect ...

    all the searches I did through your forum discuss only simple redirect. is this possible?

    PHP Code:
    If (strlen($row["cat_file"])>""){
    If (
    strlen($row["cat_target"])>0){
    header("Location: ".$row["cat_file"]." target = ".$row["cat_target"]."");
    }else{
    header("Location: ".$row["cat_file"].""); 
    exit;
    }} 

    $cat_file === http://www.citysource.us
    $cat_target === _blank

    2nd one works, first one returns this:
    http://www.citysource.us%20target%20=_blank%20=_blank/

    obviously, I'm putting the target INSIDE the link ... but how to do it right?

    help much appreciated.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi Ann.

    As php is server-side, it not able to launch a new browser window or any of the things JavaScript can do quite easily. The Location: header will send the current window and nothing else.

    Might be worth exploring mixing up a little mixing of JavaScript and php here.

    Might be worth using your normal header command if there is no cat_target , but if there is a cat_target then echoing out some JS popup-code.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    annmartinson's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Location
    Spokane, WA USA
    Posts
    15
    I'm decent in php, clueless in java

    do you know this code or should I repost in the java section?

    thx

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    I'm too lazy

    try the popup creator tool -

    http://www.ahfb2000.com/popupmakertool.php
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread