hisham
IS-IT--Management
- Nov 6, 2000
- 194
I have the following code, when I click on the url entry i.e. somewhere.com, this lead me to my server:
What must I do to open the real url somewhere.com in a new window?
Thanks in advance
-----------------------------------
<?php
include ("./common.php"
$sFileName = "EntryView.php";
$sEntryViewErr = "";
$sAction = get_param("FormAction"
$sForm = get_param("FormName"
//-- handling actions
switch ($sForm)
{
case "EntryView":
EntryView_action($sAction);
break;
}
<?
function EntryView_action($sAction)
{
global $db;
global $sForm;
global $sEntryViewErr;
$sParams = "";
$sActionFileName = "Entries.php";
$sParams = "?";
$sParams .= "address=" . tourl(get_param("Trn_address") . "&";
$sParams .= "name=" . tourl(get_param("Trn_name") . "&";
$sParams .= "category_id=" . tourl(get_param("Trn_category_id");
$sWhere = "";
$bErr = false;
if($sAction == "cancel"
header("Location: " . $sActionFileName . $sParams);
//-- Create SQL statement
$sSQL = "";
if(strlen($sEntryViewErr)) return;
//-- Execute SQL query
$db->query($sSQL);
header("Location: " . $sActionFileName . $sParams);
}
function EntryView_Show()
{
global $sFileName;
global $sAction;
global $db;
global $sForm;
global $sEntryViewErr;
global $styles;
$sWhere = "";
$bPK = true; //-- primary key indication
//-- begin block of initialization variables
$flditem_id = "";
$fldname = "";
$fldcategory_id = "";
$fldemail = "";
$fldurl = "";
//-- end block
?>
<table >
<form method="POST" action="<?= $sFileName ?>" name="EntryView">
<tr><td ><font >Entry</font></td></tr>
<? if ($sEntryViewErr) { ?> <tr><td ><font><?= $sEntryViewErr ?></font></td></tr><? } ?>
<?
if($sEntryViewErr == ""
{
//-- Get primary key and form parameters
$fldname = get_param("name"
$fldcategory_id = get_param("category_id"
$Trn_category_id = get_param("category_id"
$pitem_id = get_param("item_id"
}
else
{
//-- Get primary key, form parameters and form's fields
$flditem_id = strip(get_param("item_id");
$fldname = get_param("Trn_name"
$Trn_name = get_param("Trn_name"
$Trn_category_id = get_param("Trn_category_id"
$pitem_id = get_param("PK_item_id"
}
if( !strlen($pitem_id)) $bPK = false;
$sWhere .= "item_id=" . tosql($pitem_id, "Number"
$PK_item_id = $pitem_id;
$sSQL = "select * from items where " . $sWhere;
if($bPK && !($sAction == "insert" && $sForm == "EntryView")
{
$db->query($sSQL);
$db->next_record();
$flditem_id = $db->f("item_id"
$fldname = $db->f("name"
$fldcategory_id = $db->f("category_id"
$fldemail = $db->f("email"
$fldurl = $db->f("url"
}
else
{
if($sEntryViewErr == ""
{
$fldname = tohtml(get_param("name");
$fldcategory_id = tohtml(get_param("category_id");
}
}//-- Set lookup fields
$fldcategory_id = dlookup("categories", "name", "category_id=" . tosql($fldcategory_id, "Number");
if($sEntryViewErr == ""
{
$fldemail="<a href=mailto:" . $fldemail . ">" . $fldemail . "</a>";
}
//-- show fields
?>
<tr>
<td >
<font >Name</font>
</td>
<td >
<font><?=tohtml($fldname)?> </font>
</td>
</tr>
<tr>
<td >
<font >Category</font>
</td>
<td >
<font ><?=tohtml($fldcategory_id)?> </font>
</td>
</tr>
<tr>
<td >
<font >E-mail</font>
</td>
<td >
<font ><?=$fldemail?> </font>
</td>
</tr>
<tr>
<td >
<font >URL</font>
</td>
<td >
<font ><a href="<?=$db->f("url" ?>"><font ><?= $fldurl ?></font></a> </font>
</td>
</tr>
What must I do to open the real url somewhere.com in a new window?
Thanks in advance
-----------------------------------
<?php
include ("./common.php"
$sFileName = "EntryView.php";
$sEntryViewErr = "";
$sAction = get_param("FormAction"
$sForm = get_param("FormName"
//-- handling actions
switch ($sForm)
{
case "EntryView":
EntryView_action($sAction);
break;
}
<?
function EntryView_action($sAction)
{
global $db;
global $sForm;
global $sEntryViewErr;
$sParams = "";
$sActionFileName = "Entries.php";
$sParams = "?";
$sParams .= "address=" . tourl(get_param("Trn_address") . "&";
$sParams .= "name=" . tourl(get_param("Trn_name") . "&";
$sParams .= "category_id=" . tourl(get_param("Trn_category_id");
$sWhere = "";
$bErr = false;
if($sAction == "cancel"
header("Location: " . $sActionFileName . $sParams);
//-- Create SQL statement
$sSQL = "";
if(strlen($sEntryViewErr)) return;
//-- Execute SQL query
$db->query($sSQL);
header("Location: " . $sActionFileName . $sParams);
}
function EntryView_Show()
{
global $sFileName;
global $sAction;
global $db;
global $sForm;
global $sEntryViewErr;
global $styles;
$sWhere = "";
$bPK = true; //-- primary key indication
//-- begin block of initialization variables
$flditem_id = "";
$fldname = "";
$fldcategory_id = "";
$fldemail = "";
$fldurl = "";
//-- end block
?>
<table >
<form method="POST" action="<?= $sFileName ?>" name="EntryView">
<tr><td ><font >Entry</font></td></tr>
<? if ($sEntryViewErr) { ?> <tr><td ><font><?= $sEntryViewErr ?></font></td></tr><? } ?>
<?
if($sEntryViewErr == ""
{
//-- Get primary key and form parameters
$fldname = get_param("name"
$fldcategory_id = get_param("category_id"
$Trn_category_id = get_param("category_id"
$pitem_id = get_param("item_id"
}
else
{
//-- Get primary key, form parameters and form's fields
$flditem_id = strip(get_param("item_id");
$fldname = get_param("Trn_name"
$Trn_name = get_param("Trn_name"
$Trn_category_id = get_param("Trn_category_id"
$pitem_id = get_param("PK_item_id"
}
if( !strlen($pitem_id)) $bPK = false;
$sWhere .= "item_id=" . tosql($pitem_id, "Number"
$PK_item_id = $pitem_id;
$sSQL = "select * from items where " . $sWhere;
if($bPK && !($sAction == "insert" && $sForm == "EntryView")
{
$db->query($sSQL);
$db->next_record();
$flditem_id = $db->f("item_id"
$fldname = $db->f("name"
$fldcategory_id = $db->f("category_id"
$fldemail = $db->f("email"
$fldurl = $db->f("url"
}
else
{
if($sEntryViewErr == ""
{
$fldname = tohtml(get_param("name");
$fldcategory_id = tohtml(get_param("category_id");
}
}//-- Set lookup fields
$fldcategory_id = dlookup("categories", "name", "category_id=" . tosql($fldcategory_id, "Number");
if($sEntryViewErr == ""
{
$fldemail="<a href=mailto:" . $fldemail . ">" . $fldemail . "</a>";
}
//-- show fields
?>
<tr>
<td >
<font >Name</font>
</td>
<td >
<font><?=tohtml($fldname)?> </font>
</td>
</tr>
<tr>
<td >
<font >Category</font>
</td>
<td >
<font ><?=tohtml($fldcategory_id)?> </font>
</td>
</tr>
<tr>
<td >
<font >E-mail</font>
</td>
<td >
<font ><?=$fldemail?> </font>
</td>
</tr>
<tr>
<td >
<font >URL</font>
</td>
<td >
<font ><a href="<?=$db->f("url" ?>"><font ><?= $fldurl ?></font></a> </font>
</td>
</tr>