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
teeraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.