Jump to content

Recommended Posts

Parse error: syntax error, unexpected '=' in /home/cookbook/public_html/description_cookbook.php on line 100.

 

<?php
//include("include/session.php");
// Start_session, check if user is logged in or not, and connect to the database all in one included file
include_once("scripts/checkuserlog.php");
// Include the class files for auto making links out of full URLs and for Time Ago date formatting
include_once("wi_class_files/autoMakeLinks.php");
include_once ("wi_class_files/agoTimeFormat.php");
// Create the two objects before we can use them below in this script
$activeLinkObject = new autoActiveLink;
$myObject = new convertToAgo;
?>
<?php
// Include this script for random member display on home page
include_once "scripts/homePage_randomMembers.php"; 
?>
<?php
$sql_blabs = mysql_query("SELECT id, mem_id, the_blab, blab_date FROM blabbing ORDER BY blab_date DESC LIMIT 30");

$blabberDisplayList = ""; // Initialize the variable here

while($row = mysql_fetch_array($sql_blabs)){

$blabid = $row["id"];
$uid = $row["mem_id"];
$the_blab = $row["the_blab"];
$notokinarray = array("fag", "gay", "shit", "fuck", "stupid", "idiot", "asshole", "cunt", "douche");
    $okinarray   = array("sorcerer", "grey", "shug", "farg", "smart", "awesome guy", "asshole", "cake", "dude");
$the_blab = str_replace($notokinarray, $okinarray, $the_blab);
$the_blab = ($activeLinkObject -> makeActiveLink($the_blab));
$blab_date = $row["blab_date"];
$convertedTime = ($myObject -> convert_datetime($blab_date));
    $whenBlab = ($myObject -> makeAgo($convertedTime));
//$blab_date = strftime("%b %d, %Y %I:%M:%S %p", strtotime($blab_date));
// Inner sql query
$sql_mem_data = mysql_query("SELECT id, username, firstname, lastname FROM myMembers WHERE id='$uid' LIMIT 1");
while($row = mysql_fetch_array($sql_mem_data)){
		$uid = $row["id"];
		$username = $row["username"];
		$firstname = $row["firstname"];
		if ($firstname != "") {$username = $firstname; } // (I added usernames late in  my system, this line is not needed for you)
		///////  Mechanism to Display Pic. See if they have uploaded a pic or not  //////////////////////////
		$ucheck_pic = "members/$uid/image01.jpg";
		$udefault_pic = "members/0/image01.jpg";
		if (file_exists($ucheck_pic)) {
		$blabber_pic = '<div style="overflow:hidden; width:40px; height:40px;"><img src="' . $ucheck_pic . '" width="40px" border="0" /></div>'; // forces picture to be 100px wide and no more
		} else {
		$blabber_pic = "<img src=\"$udefault_pic\" width=\"40px\" height=\"40px\" border=\"0\" />"; // forces default picture to be 100px wide and no more
		}

		$blabberDisplayList .= '
      			<table width="100%" align="center" cellpadding="4" bgcolor="#CCCCCC">
        <tr>
          <td width="7%" bgcolor="#FFFFFF" valign="top"><a href="profile.php?id=' . $uid . '">' . $blabber_pic . '</a>
          </td>
          <td width="93%" bgcolor="#EFEFEF" style="line-height:1.5em;" valign="top"><span class="greenColor textsize10">' . $whenBlab . ' <a href="profile.php?id=' . $uid . '">' . $username . '</a> said: </span><br />
          ' . $the_blab . '</td>
        </tr>
      </table>';
		}

}
?>
<!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=ISO-8859-1" />
    <meta name="Description" content="Web Intersect is a deft combination of powerful free open source software for social networking, mixed with insider guidance and tutorials as to how it is made at its core for maximum adaptability. The goal is to give you a free website system that has a network or community integrated into it to allow people to join and interact with your website when you have the need." />
    <meta name="Keywords" content="web intersect, how to build community, build social network, how to build website, learn free online, php and mysql, internet crossroads, directory, friend, business, update, profile, connect, all, website, blog, social network, connecting people, youtube, myspace, facebook, twitter, dynamic, portal, community, technical, expert, professional, personal, find, school, build, join, combine, marketing, optimization, spider, search, engine, seo, script" />
    <title>CookBookers</title>
    <link href="style/main.css" rel="stylesheet" type="text/css" />
    <link rel="icon" href="favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<style type="text/css">
.style1 {
font-family: Arial;
font-size: 18px;
}
.style2 {font-size: 18px}
#Layer1 {
height:210px;
background-image: url(images/top_container_bg_recipes_new.gif);
}
</style>
</head>
<body>
<p>
  <?php include_once "header_template.php"; ?>
</p>
<center>
  <table cellpadding="0px" cellspacing="0px" style="border:0px solid #666666;" width="950">
    <tr>
    </tr>
    <tr>
      <td>
        <table width="95%" height="22" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color:#F2F2F2; border:1px solid #666666;">
          <tr>
            <td style="padding-left:45px;">
<?php
$qryUsers = "SELECT * from recipies WHERE user='".$_SESSION['username']."'" AND Rid=".$_REQUEST['Rid'];
$rsUsers = @mysql_query($qryUsers) or die(mysql_error());
		if( @mysql_num_rows($rsUsers)>0 )
		{
		$rowUsers = @mysql_fetch_object($rsUsers);
echo "<h4>Recipe Title: </h4>"; 
echo "<p style='margin-left:10px;'>" . $rowUsers->title . "</p>";

echo "<h4>Makes:</h4>";
echo "<p style='margin-left:10px;'>". $rowUsers->makes ."</p>";

echo "<h4>Ingredients:</h4>";
echo "<ol style='margin:0px 30px;'>";
$arr = split(",",$rowUsers->ingredients);
foreach($arr as $val){
  echo "<li style='margin:5px 0px;'>$val</li>";
}
echo "</ol>";

echo "<h4>Method:</h4>";
echo "<p style='margin-left:10px;'>". $rowUsers->recipe ."</p>";

echo "<h4>Notes:</h4>";
echo "<p style='margin-left:10px;'>". $rowUsers->notes ."</p>";
}
?>
            </td>
          </tr>
        </table>
      </td>
    </tr>
   <tr>
     </td>
   </tr>
  </table>
</center>
<?php include_once "footer_template.php"; ?>
</body>
</html>

 

Link to comment
https://forums.phpfreaks.com/topic/227466-another-error/
Share on other sites

Your string concatenation is hosing things. It really isn't necessary to use concatenation for that.

 

$qryUsers = "SELECT * from recipies WHERE user='{$_SESSION['username']}' AND Rid={$_REQUEST['Rid']}";

Link to comment
https://forums.phpfreaks.com/topic/227466-another-error/#findComment-1173266
Share on other sites

Your string concatenation is hosing things. It really isn't necessary to use concatenation for that.

 

$qryUsers = "SELECT * from recipies WHERE user='{$_SESSION['username']}' AND Rid={$_REQUEST['Rid']}";

 

hey thanks, in sorta still learning php, can u please explain to me?

Link to comment
https://forums.phpfreaks.com/topic/227466-another-error/#findComment-1173268
Share on other sites

Variables are interpolated within a double quoted string, so they don't need to be concatenated into the string. When using an array element with a quoted index, you just have to use complex notation, enclosing it in {curly braces}.

 

These two strings are functionally identical:

$string = "The " . $variable . " holds array index: " . $array['index'] . " and includes " . $more_text . " too.";
// No different from:
$string = "The $variable holds array index: {$array['index']} and includes $more_text too.";

 

Obviously, the second one is less likely to have typos, will be easier to spot mistakes, and is more readable than the first.

Link to comment
https://forums.phpfreaks.com/topic/227466-another-error/#findComment-1173275
Share on other sites

Variables are interpolated within a double quoted string, so they don't need to be concatenated into the string. When using an array element with a quoted index, you just have to use complex notation, enclosing it in {curly braces}.

 

These two strings are functionally identical:

$string = "The " . $variable . " holds array index: " . $array['index'] . " and includes " . $more_text . " too.";
// No different from:
$string = "The $variable holds array index: {$array['index']} and includes $more_text too.";

 

Obviously, the second one is less likely to have typos, will be easier to spot mistakes, and is more readable than the first.

 

hey cool thanks i get it, great example as well it really helped :)

Link to comment
https://forums.phpfreaks.com/topic/227466-another-error/#findComment-1173276
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.