?
Solved

php go to next page

Posted on 2010-01-13
11
Medium Priority
?
227 Views
Last Modified: 2012-06-21
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
Comment
Question by:teera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 15

Expert Comment

by:ludofulop
ID: 26302907
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
 
LVL 9

Expert Comment

by:pg-expert
ID: 26302964
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
 
LVL 4

Expert Comment

by:ThiyagarajRamaswamy
ID: 26303341
Hello Expert,

This should work.

echo "<meta http-equiv=\"refresh\" content=\"0;url=http://127.0.0.1/asian/connections/presalefromS6.php\" />\n";
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:VanHackman
ID: 26306444

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
 

Author Comment

by:teera
ID: 26311691
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
 
LVL 15

Expert Comment

by:ludofulop
ID: 26311825
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
 

Author Comment

by:teera
ID: 26311871
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
 
LVL 15

Expert Comment

by:ludofulop
ID: 26311949
okay, put this to your line #107:

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

Accepted Solution

by:
ludofulop earned 2000 total points
ID: 26311960
by the way, you can't have <meta> tag outside the <head>
0
 

Author Comment

by:teera
ID: 26311977
GHi ludofulop

It is work pleas exlain
0
 
LVL 15

Expert Comment

by:ludofulop
ID: 26311996
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question