Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with $ECHO


bigkimble

Recommended Posts

Posted

Hi there,

 

i have a small problem which drives me crazy. On my first site, I have a little Form where people can enter 2 Text messages. When they click on "next" those Text messages should show up on the next site. But this is not the case.

 

Here is my code for site 1:

 

<?php
/*
 $Id: conditions.php,v 1.22 2003/06/05 23:26:22 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>








	<form name="Text" action="Site2.php" method="POST">
<p><textarea rows="7" size="3" name="Text1" value="0" cols="45"> </textarea></p>
<p> </p>
<p><textarea rows="7" name="Text2" cols="45"></textarea></p>
<p><input type="submit" value="Next" name="B1"></p>
</form>










<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

Here is the code for site 2:

 

 

<?php
/*
 $Id: conditions.php,v 1.22 2003/06/05 23:26:22 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>









	<form name="Site2" action="mailer.php3"method="POST">
	<input name="Text1" value="<? echo $Text1; ?>">
	<input name="Text2" value="<? echo $Text2; ?>">
<p><input type="text" name="MainText" size="32"><input type="submit" value="Send" name="B1"></p>

</form>










<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

As you might see, the code for the Textfield / Messagebox is in the middle of the Site.

Site 1 sends the data (Textfield) via POST to Site 2.

On Site 2 I ask for the data of Site 1 (Textfield) by using <? echo $text1; ?> but this does not work.

However, if I just take the code from the FORM and compile it with HTML it works. But not with my OSC.

 

Any suggestions?

 

Thanks,

Kimble

Posted

Hi,

 

weird that this is working on your site???!

 

Any others suggestions what the problem might be. Can it be that another site e.g. require('includes/application_top.php'); is blocking the variable via $echo?

 

Kimble

Posted

Hi there,

 

maybe it has to do with "register_globals" which is turned off.

 

I have tried the following:

 

On Site1 instead of:

 <form name="Text" action="Site2.php" method="POST">

 

I did this:

	<form name="Text" action="Site2.php" method="$_POST, $_GET, $_SESSION">

 

 

But this does not change anything... ;-(

 

Any help?

Posted
Hi there,

 

maybe it has to do with "register_globals" which is turned off.

 

I have tried the following:

 

On Site1 instead of:

 <form name="Text" action="Site2.php" method="POST">

 

I did this:

	<form name="Text" action="Site2.php" method="$_POST, $_GET, $_SESSION">

But this does not change anything... ;-(

 

Any help?

 

Change your code back to

 

 <form name="Text" action="Site2.php" method="POST">

 

Then in the second page access the variables like this

 

$_POST['Text1']

 

Try that and let us know if it works

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...