$updateGoTo with URL variables

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

15-Jan-12 03:13
Hi
Hopefully I can get an answer to my challenge in this forum as I have tried others without any luck

I am new to html5 and jQuery mobile, and I'm trying to build my first app.

Now... there is an issue that almost drives me over the edge... "$updateGoTo" with a variable in the URL does not work as I want it to do.

I have tried to write it in many many ways but with no luck.
For the time being it looks like this:


[b] $updateGoTo = "http://butikkliste.com/liste/mobile/index.php?idh=".$idh.'#handle rel="external"' ;
header(sprintf("Location: %s", $updateGoTo));[/b]



This results in an URL looking like this:
http://butikkliste.com/liste/mobile/index.php?idh=44#/liste/mobile/index.php
NB! Note that <#handle> turns into <#/liste/mobile/index.php>. The word "handle" just vanished.

I tried other ways to write it but nothing seems to work and now I am kind of confused.
Nearly whatever I do only ends up with a result where the anchor-reference is replaced with <#/liste/mobile/index.php>.

And the strangest thing appears if I redirect to a new file....
I made a file called index3.php and changed the updateGoTo into:


$updateGoTo = "http://butikkliste.com/liste/mobile/index3.php?idh=".$idh.'#handle rel="external"' ;



Then the index3-site appears BUT the URL still shows:
http://butikkliste.com/liste/mobile/index.php?idh=44#/liste/mobile/index.php
In other words the reload function (rel="external") is not working either... I also have tried data-ajax="false" and target=_blank" with the same result.

I have Goggled for several days now… without finding any working solution.

--
OleO.Wiik
16-Jan-12 04:07
@oleowiik: Sorry, I really don't understand what you want to do, and what the problem is. Are you saying your PHP code isn't working correctly, or that you are having problems with jQuery Mobile?

Can you post a demo on http://jsfiddle.net/ that shows the problem in action?

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/
16-Jan-12 04:42
@matt, I will try to explane

When posting a result into a dB-table I want to return to the same site after update-query has finished.

THis is the update:

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update_handle"])) && ($_POST["MM_update_handle"] == "form_handle")) {

$insertSQL = sprintf("insert into oow_handleliste_varer (user, liste_id, vare) values(%s,%s,%s)",
GetSQLValueString($_POST['user'], "text"),
GetSQLValueString($_POST['liste_id'], "int"),
GetSQLValueString($_POST['vare'], "text"));


mysql_select_db($database_dbcon, $dbcon);
$Result1 = mysql_query($insertSQL, $dbcon) or die(mysql_error());


$idh=GetSQLValueString($_POST['liste_id'], "int");


$updateGoTo = "http://butikkliste.com/liste/mobile/handle_redirect.php?idh=".$idh.'#handle" rel="external"' ;
header(sprintf("Location: %s", $updateGoTo));
}


The thing is that it seems like I am not able to get the rel="external" to reload the site.


This is the Complete site:
The URL is http://butikkliste.com/liste/mobile
And you can login use: Login = Test and pw= test

<?php require_once('../Connections/dbcon.php'); ?>
<?php


// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
session_unregister('MM_Username');
session_unregister('MM_UserGroup');

$logoutGoTo = "index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php // SITE "NY LISTE" --->

$minUserLevel = 3;
$cfgProgDir = '../handle_secure/';
include($cfgProgDir . "secure.php");
//initialize the session
session_start();

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_id = "1";
if (isset($_GET['id'])) {
$colname_id = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}

mysql_select_db($database_dbcon, $dbcon);
$query_nyvarer = "SELECT * FROM oow_handleliste_varer where user='$login' and liste_id=$colname_id order by id_v desc";
$nyvarer = mysql_query($query_nyvarer, $dbcon) or die(mysql_error());
$row_nyvarer = mysql_fetch_assoc($nyvarer);
$totalRows_nyvarer = mysql_num_rows($nyvarer);

mysql_select_db($database_dbcon, $dbcon);
$query_vare_users = "SELECT * FROM oow_handleliste_users";
$vare_users = mysql_query($query_vare_users, $dbcon) or die(mysql_error());
$row_vare_users = mysql_fetch_assoc($vare_users);
$totalRows_vare_users = mysql_num_rows($vare_users);


//---> SITE "NY LISTE" START
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update2"])) && ($_POST["MM_update2"] == "form2")) {

$insertSQL = sprintf("insert into oow_handleliste_liste (user, listenavn, date) values(%s,%s,NOW())",
GetSQLValueString($_POST['user'], "text"),
GetSQLValueString($_POST['listenavn'], "text"),
GetSQLValueString($_POST['date'], "date"));


mysql_select_db($database_dbcon, $dbcon);
$Result1 = mysql_query($insertSQL, $dbcon) or die(mysql_error());

mysql_select_db($database_dbcon, $dbcon);
$query_vare_liste = "SELECT * FROM oow_handleliste_liste where user='$login' order by id_hl desc";
$vare_liste = mysql_query($query_vare_liste, $dbcon) or die(mysql_error());
$row_vare_liste = mysql_fetch_assoc($vare_liste);
$totalRows_vare_liste = mysql_num_rows($vare_liste);

$hid=$row_vare_liste['id_hl'];

$updateGoTo = "#handle?id=".$hid;

header(sprintf("Location: %s", $updateGoTo));
}

//<--- SITE "NY LISTE" END

//SITE "EDIT LISTE" --->
mysql_select_db($database_dbcon, $dbcon);
$query_vare_liste2 = "SELECT * FROM oow_handleliste_liste where user='$login' and status='A' order by date desc";
$vare_liste2 = mysql_query($query_vare_liste2, $dbcon) or die(mysql_error());
$row_vare_liste2 = mysql_fetch_assoc($vare_liste2);
$totalRows_vare_liste2 = mysql_num_rows($vare_liste2);
//<--- SITE "EDIT LISTE"
?>
<?php
//*************************************************************************

//SITE "HANDLE" --->
$colname_idh = "1";
if (isset($_GET['idh'])) {
$colname_idh = (get_magic_quotes_gpc()) ? $_GET['idh'] : addslashes($_GET['idh']);
}
mysql_select_db($database_dbcon, $dbcon);
if(isset($_GET['alfa'])) {$sorter='alfa';};
if(isset($_GET['unreg'])) {$sorter='unreg';};
$query_nyvarer_handle = "SELECT * FROM oow_handleliste_varer where user='$login' and liste_id=$colname_idh order by id_v desc";
if(isset($_GET['alfa'])){$query_nyvarer_handle = "SELECT * FROM oow_handleliste_varer where user='$login' and liste_id=$colname_idh order by vare asc";}
if(isset($_GET['unreg'])){$query_nyvarer_handle = "SELECT * FROM oow_handleliste_varer where user='$login' and liste_id=$colname_idh order by h_status asc";}
$nyvarer_handle = mysql_query($query_nyvarer_handle, $dbcon) or die(mysql_error());
$row_nyvarer_handle = mysql_fetch_assoc($nyvarer_handle);
$totalRows_nyvarer_handle = mysql_num_rows($nyvarer_handle);





//POSTERINGEN --->
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update_handle"])) && ($_POST["MM_update_handle"] == "form_handle")) {

$insertSQL = sprintf("insert into oow_handleliste_varer (user, liste_id, vare) values(%s,%s,%s)",
GetSQLValueString($_POST['user'], "text"),
GetSQLValueString($_POST['liste_id'], "int"),
GetSQLValueString($_POST['vare'], "text"));


mysql_select_db($database_dbcon, $dbcon);
$Result1 = mysql_query($insertSQL, $dbcon) or die(mysql_error());


$idh=GetSQLValueString($_POST['liste_id'], "int");


$updateGoTo = "http://butikkliste.com/liste/mobile/handle_redirect.php?idh=".$idh.'#handle" rel="external"' ;
header(sprintf("Location: %s", $updateGoTo));
}
//<--- SITE "HANDLE"

//******************************************************************************************************

// SITE "RAPP" -->

if ((isset($_POST["MM_update_date"])) && ($_POST["MM_update_date"] == "form_date")) {

$updateGoTo = "http://butikkliste.com/liste/mobile/rapp.php?f=".$_POST['fra'].'&t='.$_POST['til'];

header(sprintf("Location: %s", $updateGoTo));
}
if ((isset($_POST["MM_update_txt"])) && ($_POST["MM_update_txt"] == "form_txt")) {

$updateGoTo = "rapport1.php?vtext=".$_POST['vtext'];

header(sprintf("Location: %s", $updateGoTo));
}
$colname_id = "1";
if (isset($_GET['id'])) {
$colname_id = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
$colname_f = "1";
if (isset($_GET['f'])) {
$colname_f = (get_magic_quotes_gpc()) ? $_GET['f'] : addslashes($_GET['f']);
}
$colname_t = "1";
if (isset($_GET['t'])) {
$colname_t = (get_magic_quotes_gpc()) ? $_GET['t'] : addslashes($_GET['t']);
}
$colname_text = "1";
if (isset($_GET['vtext'])) {
$colname_t = (get_magic_quotes_gpc()) ? $_GET['vtext'] : addslashes($_GET['vtext']);
}
$fra=$_GET['f'];
$til=$_GET['t'];
$text=$_GET['vtext'];


mysql_select_db($database_dbcon, $dbcon);
$query_vare_liste_rapp = "SELECT id_hl, user, date, status, listenavn,sum FROM oow_handleliste_liste where user='$login' and sum >1 order by date desc";
if(isset($_GET['t'])) {$query_vare_liste_rapp = "SELECT id_hl, user, date, status, listenavn,sum FROM oow_handleliste_liste where user='$login' and sum >1 and timestamp(date) between '$colname_f' and '$colname_t' order by date desc";}
if(isset($_GET['vtext'])) {$query_vare_liste_rapp = "SELECT id_hl, a.user, date, status, listenavn,sum FROM oow_handleliste_liste a left join oow_handleliste_varer b on a.id_hl=b.liste_id where a.user='$login' and vare like '%$text%' group by id_hl order by date desc";}
$vare_liste_rapp = mysql_query($query_vare_liste_rapp, $dbcon) or die(mysql_error());
$row_vare_liste_rapp = mysql_fetch_assoc($vare_liste_rapp);
$totalRows_vare_liste_rapp = mysql_num_rows($vare_liste_rapp);

mysql_select_db($database_dbcon, $dbcon);
$query_vare_liste_tot = "SELECT sum(sum) as total FROM oow_handleliste_liste where user='$login' and sum >1 order by date desc";
if(isset($_GET['t'])) {$query_vare_liste_tot = "SELECT sum(sum) as total FROM oow_handleliste_liste where user='$login' and sum >1 and timestamp(date) between '$colname_f' and '$colname_t' order by date desc";
}
if(isset($_GET['vtext'])) {$query_vare_liste_tot = "SELECT sum(sum) as total FROM oow_handleliste_liste a left join oow_handleliste_varer b on a.id_hl=b.liste_id where a.user='$login' and sum >1 and vare like '%$text%' order by date desc";
}
$vare_liste_tot = mysql_query($query_vare_liste_tot, $dbcon) or die(mysql_error());
$row_vare_liste_tot = mysql_fetch_assoc($vare_liste_tot);
$totalRows_vare_liste_tot = mysql_num_rows($vare_liste_tot);

$tot=$row_vare_liste_tot['total'];

//<--- SITE "RAPP"
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Butikkliste</title>
<link href="jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
<!-- This reference to phonegap.js will allow for code hints as long as the current site has been configured as a mobile application.
To configure the site as a mobile application, go to Site -> Mobile Applications -> Configure Application Framework... -->
<script src="/phonegap.js" type="text/javascript"></script>
</head>
<body>
<div data-role="page" id="page">
<div data-role="header">
<h1>Index</h1>
</div>

<div data-role="content">
<ul data-role="listview">
<li><a href="#page3">Ny Liste</a></li>
<li><a href="#page4">Handleliste</a></li>
<li><a href="#rapp">Rapport</a></li>
</ul>
</div>
<div data-role="footer">
<h4>&nbsp;</h4>
</div>
</div>
<div data-role="page" id="page3">
<div data-role="header">
<h1>Ny liste</h1>
</div>
<div data-role="content">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFCC66"><form id="form2" name="form2" method="post" enctype="multipart/form-data" action="<?= $_SERVER['PHP_SELF'] ?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td><label>
Sett navn p&aring; ny handleliste<br />
<input name="listenavn" type="text" class="style2" id="listenavn" size="17" />
<input name="submit" type="submit" value="Registrer" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_update2" value="form2" />
<input name="user" type="hidden" id="user" value="<?php echo $login; ?>" />
<input name="liste_id" type="hidden" id="liste_id" value="1" />
<a href="logout.php"></a>
</form></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</div>
<div data-role="footer">
<h4>&nbsp;</h4>
</div>
</div>
<div data-role="page" id="page4">
<div data-role="header">
<h1>Handleliste</h1>
</div>
<div data-role="content">

<ul data-role="listview">
<?php $i = 0 ; do { $i++ ; ?>
<tr <?php $bgfarge ="#F9F0BF"; if ( ($i % 2) == 0) {$bgfarge ="#FFFFFF" ;} echo 'bgcolor='.$bgfarge ; ?> >
<script>
function confirmDelete(delUrl) {
if (confirm("Are you sure you want to delete <?php echo $row_nyvarer['vare'];?>")) {
document.location = delUrl;
}
}
</script>

<?php

if($row_vare_liste2['h_status']=='K'){
$stil='kjopt';} else {$stil='style1' ;}
if($row_vare_liste2['h_status']=='K') {
$link='<a href="http://butikkliste.com/liste/mobile/index.php?idh='.$row_vare_liste2['id_hl'].'#handle"rel="external"> ';}
else {
$link='<a href="http://butikkliste.com/liste/mobile/index.php?idh='.$row_vare_liste2['id_hl'].'#handle"rel="external" > ' ;}
;?>

<li><?php echo $link ;?><?php echo $row_vare_liste2['listenavn']; ?> (<?php echo $row_vare_liste2['date'];?>)</a></li>
<?php } while ($row_vare_liste2 = mysql_fetch_assoc($vare_liste2)); ?></ul>

</div>
<div data-role="footer">
<h4>&nbsp;</h4>
</div>
</div>

<div data-role="page" id="handle">
<div data-role="header">
<h1>Handle</h1>
</div>

<div data-role="content">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td bgcolor="#FFCC66"><form id="form_handle" name="form_handle" method="post" enctype="multipart/form-data" action="<?= $_SERVER['PHP_SELF'] ?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td colspan="2"><label>
<input name="vare" type="text" class="style2" id="vare" size="17" />
<input name="submit" type="submit" value="Legg til ny vare" />
</label></td>

<script>
function confirmReg(regUrl) {
if (confirm("Aktuell handleliste registreres nå som 100% innkjøpt og vil bli synlig under Rapporter!")) {
document.location = regUrl;
}
}
</script>

<td width="21%" align="center" valign="top"><a href="liste_pris.php?id=<?php echo $row_nyvarer_handle['liste_id'] ;?>"><img src="../../images/handleliste/reg.png" width="40" height="40" border="0" /></a><br />
Kostnad </td>
<td width="20%" valign="top" align="center"><a href="javascript:confirmReg('ferdig_handlet.php?id_v=<?php echo $row_nyvarer_handle['liste_id'];?>')"><img src="../../images/handleliste/cash.png" width="40" height="40" border="0" /></a><br />
Arkiver</td>
</tr>

<tr>
<td width="59%"> | <a href="liste.php?id=<?php echo $row_nyvarer_handle['liste_id'];?>&alfa">A-Å</a> | <a href="liste.php?id=<?php echo $row_nyvarer_handle['liste_id'];?>">1-9</a> | <a href="liste.php?id=<?php echo $row_nyvarer_handle['liste_id'];?>&unreg">Status</a> |</td>
<td colspan="3" align="right"><a href="index.php" rel="external">| MENY</a>| <a href="pdf/handleliste_oversikt_liste.php?id=<?php echo $row_nyvarer_handle['liste_id'];?>"> PRINT </a> |</td>
</tr>
</table>
<input type="hidden" name="MM_update_handle" value="form_handle" />
<input name="user" type="hidden" id="user" value="<?php echo $login; ?>" />
<input name="liste_id" type="hidden" id="liste_id" value="<?php echo $colname_idh;?>" />
<a href="logout.php"></a>
</form></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php $i = 0 ; do { $i++ ; ?>
<tr <?php $bgfarge ="#F9F0BF"; if ( ($i % 2) == 0) {$bgfarge ="#FFFFFF" ;} echo 'bgcolor='.$bgfarge ; ?> >

<script>
function confirmUnreg(delUrl) {
if (confirm("Vil du fjerne markert som kjøpt?")) {
document.location = delUrl;
}
}
</script>
<?php
$unregg1="javascript:confirmUnreg('";
$unregg2="')";
if($row_nyvarer_handle['h_status']=='K'){
$stil='kjopt';} else {$stil='style1' ;}
if($row_nyvarer_handle['h_status']=='K') {
$link='<a href="'.$unregg1.'marker_ukjopt.php?id_v='.$row_nyvarer_handle['id_v'].'&id_nr='.$row_nyvarer_handle['liste_id'].'&sor='.$sorter.$unregg2.'">';}
else {
$link='<a href="marker_kjopt.php?id_v='.$row_nyvarer_handle['id_v'].'&id_nr='.$row_nyvarer_handle['liste_id'].'&sor='.$sorter.'">' ;}
;?>
<script>
<?php $vare=$row_nyvarer_handle['vare'];?>
function confirmDelete(delUrl) {
if (confirm("Are you sure you want to delete?")) {
document.location = delUrl;
}
}
</script>
<td width="10" align="center"><?php if($row_nyvarer_handle['h_status']=='K') {echo '<img src="../../images/greenlight.gif" alt="" width="10" height="10" />';} ;?></td>
<td width="1159" class="<?php echo $stil;?>"><?php echo $link ;?><?php echo $vare; ?></a></td>
<td width="47" align="center" class="<?php echo $stil;?>"><a href="javascript:confirmDelete('../slett_fraliste.php?id_v=<?php echo $row_nyvarer_handle['id_v'];?>&id_nr=<?php echo $row_nyvarer_handle['liste_id'] ;?>')"><img src="../../images/garbage_bin.gif" width="11" height="12" border="0" /></a></td>
</tr>
<?php } while ($row_nyvarer_handle = mysql_fetch_assoc($nyvarer_handle)); ?>
</table></td>
</tr>
</table>
</div>
<div data-role="footer">
<h4>&nbsp;</h4>
</div>
</div>
<div data-role="page" id="rapp">
<div data-role="header">
<meta charset="UTF-8">
<h1>Rapport</h1>
</div>
<div data-role="content">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF">

<tr>
<td height="34" bgcolor="#7D9D8A"><div align="left" class="style1">
<div align="center" class="style8">
<div align="left" class="style8"> HANDLELISTE RAPPORT (<span><?php echo 'Kr. '.$tot.',-';?></span>)<br /><table width="100%" border="o" cellpadding="0" cellspacing="0" class="rammehvit">
<tr>
<td width="51%" bgcolor="#FFCC33" class="style77"><form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="6%" bgcolor="#FFCC33">Fra</td>
<td bgcolor="#FFCC33"><input name="fra" type="text" class="stiplet_orange" id="fra" />
&Aring;&Aring;&Aring;&Aring;MMDD</td>
</tr>
<tr>
<td bgcolor="#FFCC33">Til</td>
<td bgcolor="#FFCC33"><input name="til" type="text" class="stiplet_orange" id="til" />
&Aring;&Aring;&Aring;&Aring;MMDD</td>
</tr>
<tr>
<td bgcolor="#FFCC33"><input name="MM_update" type="hidden" id="MM_update" value="form1" /></td>
<td bgcolor="#FFCC33"><input name="submit" type="submit" id="submit" value="S&Oslash;K" /></td>
</tr>
</table>
</form></td>
<td width="49%" valign="top" bgcolor="#6BC0C7" class="style77"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="form2" id="form2">
Texts&oslash;k
<input name="vtext" type="vtext" class="stiplet_orange" id="vtext" />
<input name="submit2" type="submit" id="submit2" value="S&Oslash;K" />
<input name="MM_update2" type="hidden" id="MM_update2" value="form2" />
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td height="40" colspan="2" bgcolor="#D0D0D5" class="style77"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#D0D0D5"><span class="vanlig">
<?php if($fra<>'') {echo 'Perioden: '.$fra.' - '.$til;} if($text<>'') {echo 'Tekst: '.$text ;}
else {echo 'Komplett';}?>
</span></td>
<td bgcolor="#D0D0D5" align="right">| <a href="index.php" rel="external" class="hvitlink">MENY </a>| <a href="rapport1.php" class="hvitlink">KOMPLETT LISTE</a>|</td>
</tr>
</table></td>
</tr>
</table>
</div>
</div>
</div></td>
</tr>
<tr>
<td align="left" valign="top"><div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<ul data-role="listview"> <li></li> </ul>
<?php $i = 0 ; do { $i++ ; ?>
<tr <?php $bgfarge ="#F9F0BF"; if ( ($i % 2) == 0) {$bgfarge ="#FFFFFF" ;} echo 'bgcolor='.$bgfarge ; ?> >



<script>
function confirmDelete(delUrl) {
if (confirm("Are you sure you want to delete <?php echo $row_nyvarer['vare'];?>")) {
document.location = delUrl;
}
}
</script>
<ul data-role="listview">
<?php

if($row_vare_liste_rapp['h_status']=='K'){
$stil='style1';} else {$stil='style1' ;}
if($row_vare_liste_rapp['h_status']=='K') {
$link_rapp='<a href="liste_rapport.php?id='.$row_vare_liste_rapp['id_hl'].'">';}
else {
$link_rapp='<a href="liste_rapport.php?id='.$row_vare_liste_rapp['id_hl'].'">' ;}
;?>

<li><?php echo $row_vare_liste_rapp['date']; ?>
<?php echo $link ;?><?php echo $row_vare_liste_rapp['listenavn']; ?></a>
<?php echo '(Kr. '.$row_vare_liste_rapp['sum'].',-)'; ?></li>

<?php } while ($row_vare_liste_rapp = mysql_fetch_assoc($vare_liste_rapp)); ?>

</ul>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</div></td>
</tr>

</table></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
<div data-role="footer">
</div>
</div>
<div data-role="page" id="nyside">
<div data-role="header">
<h1>Legg til vare</h1>
</div>
<div data-role="content">
Content
</div>
<div data-role="footer">
</body>
</html>


--
OleO.Wiik
17-Jan-12 08:03
Ahhh... I found the solution

The data-ajax="false" is not to be put in the $updateGoTo string, but in the form attribute.

Then the form tag will be looking something like this:

<form id="form_handle" name="form_handle" method="post" data-ajax="false" enctype="multipart/form-data" action="<?= $_SERVER['PHP_SELF'] ?>">


--
OleO.Wiik
19-Jan-12 23:25
@oleowiik: Ah, I see. Yes, data-ajax="false" needs to go either inside an <a> tag, or in a <form> tag.

Glad you got it working

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/

 
New posts
Old posts

Follow Elated