close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

parse error products_detail.php on line 168

Thread began 3/04/2013 2:18 am by henrik441511 | Last modified 3/07/2013 11:56 pm by henrik441511 | 2282 views | 9 replies |

henrik441511

parse error products_detail.php on line 168

Hi i have tried to run a videolesson "Build an Admin-Driven PayPal Store - YouTube"
but there are som failures in it:
I got error:
Parse error: syntax error, unexpected '=' in /Applications/AMPPS/www/calendartest/products_detail.php on line 168

/*syntax error here */
if (!is_array($WA_pp_options)) = $WA_pp_options = explode(",",$WA_pp_options);

Can you figure it out for me?

Sign in to reply to this post

Jason ByrnesWebAssist

that line should be:

if (!is_array($WA_pp_options)) $WA_pp_options = explode(",",$WA_pp_options);

Sign in to reply to this post

henrik441511

Thanks.
Still i have some errors with ecart when i do exactly the same as in the videolesson. The next problem is. when i want to add a product to cart after pressing add to cart it says "this product has been removed" ? Why? I have typed more product into the database and filled all fields in the record?

Sign in to reply to this post

Jason ByrnesWebAssist

please post a link where i can see the problem, and send a copy of the page that has the problem so i can see the code.

Sign in to reply to this post

henrik441511

The videolesson is: Build an Admin-Driven PayPal Store - YouTube.
imported everything correct. Binding ok ser/connection ok.

Malfunction: Product_detail.php
<?php require_once('../Connections/ecrtaserver.php'); ?>
<?php
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;
}
}
?>
<?php
$colname_WADAProducts = "-1";
if (isset($_GET['ProductID'])) {
$colname_WADAProducts = $_GET['ProductID'];
}
mysql_select_db($database_ecrtaserver, $ecrtaserver);
$query_WADAProducts = sprintf("SELECT * FROM Products WHERE ProductID = %s", GetSQLValueString($colname_WADAProducts, "int"));
$WADAProducts = mysql_query($query_WADAProducts, $ecrtaserver) or die(mysql_error());
$row_WADAProducts = mysql_fetch_assoc($WADAProducts);
$totalRows_WADAProducts = mysql_num_rows($WADAProducts);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
<script src="../webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>

<link href="../webassist/forms/fd_basic_default.css" rel="stylesheet" type="text/css">
<link href="../webassist/forms/dataassist_button.css" rel="stylesheet" type="text/css" />
<style>

/* Details page CSS */
form.DetailsPage {
width:565px;
}
.WADADetailsContainer {
font-size:11px;
width:555px;

}
#WADADetails, .WADANoResults {
padding-top:5px;

}
.WADADetailsLinkArea {
padding-top:2px;
padding-bottom:2px;
}
.WADADetailsImageInfoArea {
margin-top:5px;
margin-bottom:5px;

}
.WADADetailsMainImageArea {
float:left;

}
.WADADetailsMainImage {
float:left;

}
.WADADetailsProductInfo {
margin-left:255px;
height:188px;
padding-top:5px;
padding-right:5px;
padding-bottom:5px;
padding-left:5px;

}
.WADADetailsSubHeading {
font-weight:bold;

}
.WADADetailsSubText {}
.WADADetailsPriceButton {
margin-top:5px;

}
.WADADetailsPrice {
float:left;

}
.WADADetailsButton {
float:left;
margin-left:5px;

}
.WADADetailsShortDesc {
margin-top:5px;
margin-bottom:5px;

}
.WADADetailsLongDesc {
border-top-width:1px;
border-top-style:solid;
border-top-color:#BABDC2;
padding-top:5px;
margin-top:5px;
margin-bottom:5px;

}
</style>
</head>

<body>
<div id="Details_Basic_Default_ProgressWrapper">
<form class="DetailsPage Basic_Default" id="Details_Basic_Default" name="Details_Basic_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">
<fieldset class="Basic_Default" id="Details">
<legend class="groupHeader">Details</legend>

<div class="WADADetailsContainer">
<a name="top"></a>
<?php if ($totalRows_WADAProducts > 0) { // Show if recordset not empty ?>
<div id="WADADetails">
<div class="WADAHeader"><h1><?php echo($row_WADAProducts['ProductName']); ?></h1></div>
<div class="WADADetailsImageInfoArea">
<div class="WADADetailsMainImageArea"><img class="WADADetailsMainImage" src="<?php echo($row_WADAProducts['ProductImage']); ?>" alt="<?php echo($row_WADAProducts['ProductName']); ?>" width="180" /></div>
<div class="WADADetailsProductInfo">
<div class="WADADetailsSubHeading"><?php echo($row_WADAProducts['ProductName']); ?></div>
<div class="WADADetailsSubText"><?php echo($row_WADAProducts['ProductCartDesc']); ?></div>
<div class="WADADetailsPriceButton">
<div class="WADADetailsPrice"><?php echo($row_WADAProducts['ProductPrice']); ?></div>
<div class="WADADetailsButton"> <input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="webassist.dreamweaver.4_5_0" />
<input type="hidden" name="business" value="henrik_1362340619_biz@in-one.dk" />
<input type="hidden" name="item_name" value="<?php echo $row_WADAProducts['ProductName']; ?>" />
<input type="hidden" name="item_number" value="<?php echo $row_WADAProducts['ProductID']; ?>" />
<input type="hidden" name="amount" value="<?php echo $row_WADAProducts['ProductPrice']; ?>" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="http://paypallsuccess.php" />
<input type="hidden" name="cancel_return" value="http://paypalcancel.php" />
<input type="hidden" name="receiver_email" value="henrik_1362340619_biz@in-one.dk" />
<input type="hidden" name="mrb" value="R-3WH47588B4505740X" />
<input type="hidden" name="pal" value="ANNSXSLJLYR2A" />
<input type="hidden" name="no_shipping" value="0" />
<input type="hidden" name="no_note" value="0" />
<?php echo $row_WADAProducts['ProductOption']; ?>:<input type="hidden" name="on0" value="<?php echo $row_WADAProducts['ProductOption']; ?>" />
<select name="os0">
<?php
$WA_pp_options = "".$row_WADAProducts['ProductOptionValues'] ."";
if (!is_array($WA_pp_options)) $WA_pp_options = explode(",",$WA_pp_options);
foreach ($WA_pp_options as $WA_pp_option) {
?> <option value="<?php echo($WA_pp_option); ?>"><?php echo($WA_pp_option); ?></option>
<?php } ?>
</select>
<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but10.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!" />
</div>
</div>
<div class="WADAClearLeft"></div>
</div>
<div class="WADAClearLeft"></div>
</div>
<div class="WADADetailsShortDesc"><?php echo($row_WADAProducts['ProductShortDesc']); ?></div>
<div class="WADADetailsLongDesc"><?php echo($row_WADAProducts['ProductLongDesc']); ?></div>
</div>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAProducts == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">This product has been removed.</div>
</div>
<?php } // Show if recordset empty ?>
</div>
<span class="buttonFieldGroup" >
<div class="WADADetailsLinkArea">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<?php if ($totalRows_WADAProducts > 0) { // Show if recordset not empty ?>
<?php } // Show if recordset not empty ?>



<td><input type="button" value="Back To Results" class="formButton" id="BackToResults" name="BackToResults" onclick="document.location.href = 'products_results.php<?php echo(isset($_GET["pageNum_WADAProducts"])?"?pageNum_WADAProducts=".intval($_GET["pageNum_WADAProducts"]):""); ?>';" /></td>
</tr>
</table>
</div></span>
</fieldset>
</form></div><div id="Details_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
<script type="text/javascript">
WADFP_SetProgressToForm('Details_Basic_Default', 'Details_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);
</script>
<div id="Details_Basic_Default_ProgressMessage" >
<p style="margin:10px; padding:5px;" ><img src="../webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
</div>
</div>

</body>
</html>
<?php
mysql_free_result($WADAProducts);
?>

Sign in to reply to this post

Jason ByrnesWebAssist

please dont paste the code of you page into your message, compress the php page to a zip archive and attach the zip archive to the message.

also, please provide a link where i can see the problem in the web browser.

Sign in to reply to this post

henrik441511

link to site

I just fast did a new database:
try this: products_search.php
now only one record"parfume"

Cant see where i can attach any file?

Sign in to reply to this post

henrik441511

Find this attachment thing :-)

Sign in to reply to this post

Jason ByrnesWebAssist

on the product results page, there is a form that goes around the main products display region.

before you add the paypal button to the page, this form needs to be deleted.

Sign in to reply to this post

henrik441511

thanks working.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...