Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

php go to next page

echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS6.php/\" />\n";

How can i correct this code  such as

http://127.0.0.1/asian/connections/presalefromS5.php/presalefromS6.php/ 
it should go to
http://127.0.0.1/asian/connections/presalefromS6.php
0
teera
Asked:
teera
1 Solution
 
ludofulopCommented:
echo "<meta http-equiv=\"refresh\" content=\"0;url=/asian/connections/presalefromS6.php/\" />\n";

_or_ : why are you using slash after the file name (.php/) ? remove it from everywhere, and then you can use

echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS6.php\" />\n";
0
 
pg-expertCommented:
you should remove the slash at the end of filename as given below
echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS6.php\" />\n";
0
 
ThiyagarajRamaswamyCommented:
Hello Expert,

This should work.

echo "<meta http-equiv=\"refresh\" content=\"0;url=http://127.0.0.1/asian/connections/presalefromS6.php\" />\n";
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
VanHackmanCommented:

Try:



$URL = 'http://127.0.0.1/asian/connections/presalefromS6.php';
echo '<meta http-equiv="refresh" content="0;'.$URL.'" />'."\n";

Open in new window

0
 
teeraAuthor Commented:
Hi  ludofulop, pg-expert,ThiyagarajRa, VanHackman

I try yor suggestion but it go to
http://127.0.0.1/asian/connections/presalefromS5.php/presalefromS6.php/ 
but on http://127.0.0.1/asian/connections/presalefromS4.php

echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS6.php/\" />\n";  it work

If i use

http://127.0.0.1/asian/connections/   

it mean i cannot change it to another computer  and directory much fix
0
 
ludofulopCommented:
ok, so again:

why are you using slash after the file name (.php/) ? remove it from everywhere, and then you can use

echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS6.php\" />\n";
0
 
teeraAuthor Commented:
Hi  ludofulop

It go to http://127.0.0.1/asian/connections/presalefromS5.php/presalefromS6.php

I put your suggestion online 107
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php 
session_start();
require_once('../Connections/aoldatabase.php'); 
mysql_select_db($database_aoldatabase, $aoldatabase);
$vat = 7 ;
$invoiceno =  $_SESSION['invoiceno']; 
if (isset($_POST['invoiceType'])) 
{
$invoicetype = $_POST['invoiceType'] ;
if ($invoicetype == 'i') 
{
		$query_slelectPresell = "SELECT presell.refid, presell.productcode, presell.qutiy, presell.price,presell.qutiy*presell.price, presell.productname		FROM presell where presell.refid = $invoiceno ORDER BY `presell`.`timestamp` ASC";
		$slelectPresell = mysql_query($query_slelectPresell, $aoldatabase) or die(mysql_error());
		$row_slelectPresell = mysql_fetch_assoc($slelectPresell);
		$totalRows_slelectPresell = mysql_num_rows($slelectPresell);
		?>
      
		 <table width="906" height="121" border="1">
			<tr>
				<td width="80" height="37"></td>
				<td width="136">CODE</td>
				<td width="108">NAME</td>
				 <td width="108">Quantity</td>
				 <td width="108">Uprice</td>
				<td width="160">Total</td>
				 
			</tr>
			 <?php 
				$totqutiy = 0  ;
				$toPay = 0  ;
				$noorder = 0  ;

			 do { ?>
			<tr>
				<?php $totqutiy = $totqutiy+$row_slelectPresell['qutiy']  ;
				$toPay = $toPay+$row_slelectPresell['presell.qutiy*presell.price']  ;
				$noorder = $noorder + 1 ;
       			?>
 		    <td height="32"><?php echo $noorder ; ?></td>
     		<td><?php echo $row_slelectPresell['productcode']; ?></td>
     		<td><?php echo  substr($row_slelectPresell['productname'], 0, 30); ?></td>
    		<td><?php echo $row_slelectPresell['qutiy']; ?></td>
    		<td align="right"><?php echo  number_format($row_slelectPresell['price'], 2, '.', ','); ?></td>
     		<td align="right"><?php echo  number_format($row_slelectPresell['presell.qutiy*presell.price'], 2, '.', ',');   $row_slelectPresell['presell.qutiy*presell.price']; ?></td>
    		
   			</tr>
   			<?php } while ($row_slelectPresell = mysql_fetch_assoc($slelectPresell)); ?>
    		<tr>
    		<td width="80" height="42"></td>
    		<td width="136">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108"><?php echo $totqutiy; ?></td>
     		<td width="108">total </td>
     		<td width="160" align="right"><?php echo number_format($toPay/1.07 , 2, '.', ',') ;
     		$beforevat = number_format($toPay/1.07 , 2, '.', ''); 
     		$beforevatin = str_replace(",","",$beforevat);
     		
     		?></td>
    		
  			 </tr>
  			 <tr>
    		 <td width="80" height="42"></td>
    		 <td width="136">&nbsp;</td>
     		 <td width="108">&nbsp;</td>
     		 <td width="108">&nbsp;</td>
     		<td width="108">VAT </td>
     		<td width="160" align="right"><?php echo number_format(($toPay - $beforevat) , 2, '.', ',')  ;

     		$vatcost = number_format(($toPay - $beforevat) , 2, '.', ',') ; 
     		$vatcostin = str_replace(",","",$vatcost);
     		?></td>
    		
  			 </tr>
  			 <tr>
    		 <td width="80" height="42"></td>
    		 <td width="136">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108">Grand total </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',')  ; 
     		 $grandtotal = number_format($toPay, 2, '.', ',')  ; 
     		 $grandtotalin = str_replace(",","",$grandtotal );  ?></td>
    		
  			 </tr>
  			 
			 </table>


				<?php
				echo " test $beforevatin   s  $vatcostin  ss  $grandtotalin  " ;
//				$query_salehead  = "UPDATE `sale` SET `total`= $beforevat, `vatinbill`= $vatcost , `grandtotal`= $grandtotal , `invoicetype`= 'i'  WHERE (`preselRef`='$invoiceno'  )  " ;
//				$salehead = mysql_query($query_salehead, $aoldatabase) or die(mysql_error());
				$query_salehead  = "UPDATE `sale` SET `total`= $beforevatin, `vatinbill`= $vatcostin , `grandtotal`= $grandtotalin , `invoicetype`= 'i'  WHERE `preselRef`= $invoiceno   " ;
                $salehead = mysql_query($query_salehead, $aoldatabase) or die(mysql_error());
				
				
				
				mysql_free_result($slelectPresell);
               echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS6.php\" />\n";
			

// invoice ==  i
}

if ($invoicetype == 'r') 
{
 	
		$query_slelectPresell = "SELECT presell.refid, presell.productcode, presell.qutiy, presell.price,presell.qutiy*presell.price, presell.productname		FROM presell where presell.refid = $invoiceno ORDER BY `presell`.`timestamp` ASC";
		$slelectPresell = mysql_query($query_slelectPresell, $aoldatabase) or die(mysql_error());
		$row_slelectPresell = mysql_fetch_assoc($slelectPresell);
		$totalRows_slelectPresell = mysql_num_rows($slelectPresell);
		?>
      
		 <table width="906" height="121" border="1">
			<tr>
				<td width="80" height="37"></td>
				<td width="136">CODE</td>
				<td width="108">NAME</td>
				 <td width="108">Quantity</td>
				 <td width="108">Uprice</td>
				<td width="160">Total</td>
				 
			</tr>
			 <?php 
				$totqutiy = 0  ;
				$toPay = 0  ;
				$noorder = 0  ;

			 do { ?>
			<tr>
				<?php $totqutiy = $totqutiy+$row_slelectPresell['qutiy']  ;
				$toPay = $toPay+$row_slelectPresell['presell.qutiy*presell.price']  ;
				$noorder = $noorder + 1 ;
       			?>
 		    <td height="32"><?php echo $noorder ; ?></td>
     		<td><?php echo $row_slelectPresell['productcode']; ?></td>
     		<td><?php echo  substr($row_slelectPresell['productname'], 0, 30); ?></td>
    		<td><?php echo $row_slelectPresell['qutiy']; ?></td>
    		<td align="right"><?php echo  number_format($row_slelectPresell['price'], 2, '.', ','); ?></td>
     		<td align="right"><?php echo  number_format($row_slelectPresell['presell.qutiy*presell.price'], 2, '.', ',');   $row_slelectPresell['presell.qutiy*presell.price']; ?></td>
    		
   			</tr>
   			<?php } while ($row_slelectPresell = mysql_fetch_assoc($slelectPresell)); ?>
    		<tr>
    		<td width="80" height="42"></td>
    		<td width="136">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108"><?php echo $totqutiy; ?></td>
     		<td width="108">total </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',') ;
     		$beforevat = number_format($toPay, 2, '.', ','); ?></td>
    		
  			 </tr>
  			 <tr>
    		 <td width="80" height="42"></td>
    		 <td width="136">&nbsp;</td>
     		 <td width="108">&nbsp;</td>
     		 <td width="108">&nbsp;</td>
     		<td width="108">VAT </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',')  ;

     		$vatcost = number_format($toPay, 2, '.', ',')  ; ?></td>
    		
  			 </tr>
  			 <tr>
    		 <td width="80" height="42"></td>
    		 <td width="136">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108">Grand total </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',')  ; 
     		 $grandtotal = number_format($toPay, 2, '.', ',')  ; ?></td>
    		
  			 </tr>
  			 
			 </table>


				<?php
				$query_salehead  = "UPDATE `sale` SET `total`= $beforevat, `vatinbill`= $vatcost , `grandtotal`= $grandtotal , `invoicetype`= 'r'  WHERE (`preselRef`=$invoiceno )  " ;
				$salehead = mysql_query($query_salehead, $aoldatabase) or die(mysql_error());
				mysql_free_result($slelectPresell);
// invoice ==  r
}

if ($invoicetype == 'd')
 {
		$query_slelectPresell = "SELECT presell.refid, presell.productcode, presell.qutiy, presell.price,presell.qutiy*presell.price, presell.productname		FROM presell where presell.refid = $invoiceno ORDER BY `presell`.`timestamp` ASC";
		$slelectPresell = mysql_query($query_slelectPresell, $aoldatabase) or die(mysql_error());
		$row_slelectPresell = mysql_fetch_assoc($slelectPresell);
		$totalRows_slelectPresell = mysql_num_rows($slelectPresell);
		?>
      
		 <table width="906" height="121" border="1">
			<tr>
				<td width="80" height="37"></td>
				<td width="136">CODE</td>
				<td width="108">NAME</td>
				 <td width="108">Quantity</td>
				 <td width="108">Uprice</td>
				<td width="160">Total</td>
				 
			</tr>
			 <?php 
				$totqutiy = 0  ;
				$toPay = 0  ;
				$noorder = 0  ;

			 do { ?>
			<tr>
				<?php $totqutiy = $totqutiy+$row_slelectPresell['qutiy']  ;
				$toPay = $toPay+$row_slelectPresell['presell.qutiy*presell.price']  ;
				$noorder = $noorder + 1 ;
       			?>
 		    <td height="32"><?php echo $noorder ; ?></td>
     		<td><?php echo $row_slelectPresell['productcode']; ?></td>
     		<td><?php echo  substr($row_slelectPresell['productname'], 0, 30); ?></td>
    		<td><?php echo $row_slelectPresell['qutiy']; ?></td>
    		<td align="right"><?php echo  number_format($row_slelectPresell['price'], 2, '.', ','); ?></td>
     		<td align="right"><?php echo  number_format($row_slelectPresell['presell.qutiy*presell.price'], 2, '.', ',');   $row_slelectPresell['presell.qutiy*presell.price']; ?></td>
    		
   			</tr>
   			<?php } while ($row_slelectPresell = mysql_fetch_assoc($slelectPresell)); ?>
    		<tr>
    		<td width="80" height="42"></td>
    		<td width="136">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108"><?php echo $totqutiy; ?></td>
     		<td width="108">total </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',') ;
     		$beforevat = number_format($toPay, 2, '.', ','); ?></td>
    		
  			 </tr>
  			 <tr>
    		 <td width="80" height="42"></td>
    		 <td width="136">&nbsp;</td>
     		 <td width="108">&nbsp;</td>
     		 <td width="108">&nbsp;</td>
     		<td width="108">VAT </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',')  ;

     		$vatcost = number_format($toPay, 2, '.', ',')  ; ?></td>
    		
  			 </tr>
  			 <tr>
    		 <td width="80" height="42"></td>
    		 <td width="136">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108">&nbsp;</td>
     		<td width="108">Grand total </td>
     		<td width="160" align="right"><?php echo number_format($toPay, 2, '.', ',')  ; 
     		 $grandtotal = number_format($toPay, 2, '.', ',')  ; ?></td>
    		
  			 </tr>
  			 
			 </table>


				<?php
				$query_salehead  = "UPDATE `sale` SET `total`= $beforevat, `vatinbill`= $vatcost , `grandtotal`= $grandtotal , `invoicetype`= 'd'  WHERE (`preselRef`= '$invoiceno' )  " ;
				$salehead = mysql_query($query_salehead, $aoldatabase) or die(mysql_error());
				mysql_free_result($slelectPresell);
// invoice ==  d
}
}

?>

<form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
  <p>
    <label>
      <input type="radio" name="invoiceType" value="i" id="invoiceType_0" />
      Invoice</label>
    <br />
    <label>
      <input type="radio" name="invoiceType" value="r" id="invoiceType_1" />
      receipt</label>
    <br />
    <label>
      <input type="radio" name="invoiceType" value="d" id="invoiceType_2" />
      delivery note</label>
    <br /><input name="InvoiceType" type="submit" value="InvoiceType" />
  </p>
</form>
</body>
</html>

Open in new window

url.PNG
0
 
ludofulopCommented:
okay, put this to your line #107:

echo "<meta http-equiv=\"refresh\" content=\"0;url=../presalefromS6.php\" />\n";
0
 
ludofulopCommented:
by the way, you can't have <meta> tag outside the <head>
0
 
teeraAuthor Commented:
GHi ludofulop

It is work pleas exlain
0
 
ludofulopCommented:
explanation:
you are on this URL:
http://127.0.0.1/asian/connections/presalefromS5.php/presalefromS6.php/ 
if you need to get here:
http://127.0.0.1/asian/connections/presalefromS6.php
then you need to read file from the parent directory (that means ../ )
If you try to read file without ../, it goes to the same directory, as you are actually in (presalesfromS5.php/)

i think this is clear enough
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now