473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Unknown Syntax Error, When Echoing Out Content

ilya Kraft
134 100+
Hello I have content that I want to echo out, but I came across a syntax error on line 31, which I can't figure out.
I will post full code here just in case it is needed to answer a question, But The problem is on line 31.
line 31:
Expand|Select|Wrap|Line Numbers
  1. <input name=\"pm_sender_id\" id=\"pm_sender_id\" type=\"hidden\" value=\"<?php echo $_SESSION['id']; ?>\" />
  2.  
Full Code

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. $contentVar = $_POST['contentVar'];
  3. if ($contentVar == "con1") {
  4.     echo "<?php echo $interactionBox; ?>
  5. <div style=\"margin-left:30px; margin-right:38px;\" class=\"interactContainers\" id=\"add_friend\">
  6. <div align=\"right\"><a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:toggleInteractContainers('add_friend');\">cancel</a> </div>
  7. Add <?php echo \"$username\"; ?> as a friend? &nbsp;
  8. <a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:addAsFriend(<?php echo $logOptions_id; ?>, <?php echo $id; ?>);\">Yes</a>
  9. <span id=\"add_friend_loader\"><img src=\"images/loading.gif\" width=\"28\" height=\"10\" alt=\"Loading\" /></span>
  10. </div>
  11.  
  12. <div style=\"margin-left:30px; margin-right:38px;\" class=\"interactContainers\" id=\"remove_friend\">
  13. <div align=\"right\"><a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:toggleInteractContainers('remove_friend');\">cancel</a> </div>
  14. Remove <?php echo \"$username\"; ?> from your friend list? &nbsp;
  15. <a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:removeAsFriend(<?php echo $logOptions_id; ?>, <?php echo $id; ?>);\">Yes</a>
  16. <span id=\"remove_friend_loader\"><img src=\"images/loading.gif\" width=\"28\" height=\"10\" alt=\"Loading\" /></span>
  17. </div>
  18.  
  19. <!-- START DIV that serves as an interaction status and results container that only appears when we instruct it to -->
  20. <div id=\"interactionResults\" style=\"font-size:15px; padding:10px; margin-left:30px; margin-right:38px;\"></div>
  21. <!-- END DIV that serves as an interaction status and results container that only appears when we instruct it to -->
  22.  
  23. <!-- START DIV that contains the Private Message form -->
  24. <div class=\"interactContainers\" id=\"private_message\" style=\"background-color: #d3f499; margin-left:30px; margin-right:38px;\">
  25. <form action=\"javascript:sendPM();\" name=\"pmForm\" id=\"pmForm\" method=\"post\">
  26. <font size=\"+1\">Sending Private Message to <strong><em><?php echo \"$username\"; ?></em></strong></font><br /><br />
  27. Subject:
  28. <input name=\"pmSubject\" id=\"pmSubject\" type=\"text\" maxlength=\"64\" style=\"width:385px;\" />
  29. Message:
  30. <textarea name=\"pmTextArea\" id=\"pmTextArea\" style=\"width:372px; height:45px; padding:8px;\"></textarea>
  31. <input name=\"pm_sender_id\" id=\"pm_sender_id\" type=\"hidden\" value=\"<?php echo $_SESSION['id']; ?>\" />
  32. <input name=\"pm_sender_name\" id=\"pm_sender_name\" type=\"hidden\" value=\"<?php echo $_SESSION['username']; ?>\" />
  33. <input name=\"pm_rec_id\" id=\"pm_rec_id\" type=\"hidden\" value=\"<?php echo $id; ?>\" />
  34. <input name=\"pm_rec_name\" id=\"pm_rec_name\" type=\"hidden\" value=\"<?php echo $username; ?>\" />
  35. <input name=\"pmWipit\" id=\"pmWipit\" type=\"hidden\" value=\"<?php echo $thisRandNum; ?>\" />
  36. <span id=\"PMStatus\" style=\"color:#F00;\"></span>
  37. <br /><button name=\"pmSubmit\" type=\"submit\">Submit</button> or <a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:toggleInteractContainers('private_message');\">Close</a>
  38. <span id=\"pmFormProcessGif\" style=\"display:none;\"><img src=\"images/loading.gif\" width=\"28\" height=\"10\" alt=\"Loading\" /></span></form>
  39. </div>
  40. <!-- END DIV that contains the Private Message form -->
  41. <div class=\"interactContainers\" id=\"friend_requests\" style=\"background-color:#FFF; height:120px; overflow:auto; margin-left:30px; margin-right:38px;\">
  42. <div align=\"right\"><a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:toggleInteractContainers('friend_requests');\">close window</a> &nbsp; &nbsp; </div>
  43. <h3>The following people are requesting you as a friend</h3>
  44. <?php 
  45. $sql = \"SELECT * FROM friends_requests WHERE mem2='$id' ORDER BY id ASC LIMIT 5000\";
  46. $query = mysql_query($sql) or die (\"Sorry we had a mysql error!\");
  47. $num_rows = mysql_num_rows($query); 
  48. if ($num_rows < 1) {
  49. echo 'You have no Friend Requests at this time.';
  50. } else {
  51. while ($row = mysql_fetch_array($query)) { 
  52. $requestID = $row[\"id\"];
  53. $mem1 = $row[\"mem1\"];
  54. $sqlName = mysql_query(\"SELECT username FROM myMembers WHERE id='$mem1' LIMIT 1\") or die (\"Sorry we had a mysql error!\");
  55. while ($row = mysql_fetch_array($sqlName)) { $requesterUserName = $row[\"username\"]; }
  56. /////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
  57. $check_pic = 'members/' . $mem1 . '/image01.jpg';
  58. if (file_exists($check_pic)) {
  59. $lil_pic = '<a href=\"profile.php?id=' . $mem1 . '\"><img src=\"' . $check_pic . '\" width=\"50px\" border=\"0\"/></a>';
  60. } else {
  61. $lil_pic = '<a href=\"profile.php?id=' . $mem1 . '\"><img src=\"members/0/image01.jpg\" width=\"50px\" border=\"0\"/></a>';
  62. }
  63. echo    '<hr />
  64. <table width=\"100%\" cellpadding=\"5\"><tr><td width=\"17%\" align=\"left\"><div style=\"overflow:hidden; height:50px;\"> ' . $lil_pic . '</div></td>
  65. <td width=\"83%\"><a href=\"profile.php?id=' . $mem1 . '\">' . $requesterUserName . '</a> wants to be your Friend!<br /><br />
  66. <span id=\"req' . $requestID . '\">
  67. <a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:acceptFriendRequest(' . $requestID . ');\" >Accept</a>
  68. &nbsp; &nbsp; OR &nbsp; &nbsp;
  69. <a href=\"#\" onclick=\"return false\" onmousedown=\"javascript:denyFriendRequest(' . $requestID . ');\" >Deny</a>
  70. </span></td>
  71. </tr>
  72. </table>';
  73. }    
  74. }
  75. ?>
  76. </div>
  77.  
  78. <?php echo $the_blab_form; ?>
  79. <br />
  80. <div id=\"commentsdiv\">
  81. <?php include_once('checkcomments.php'); ?>
  82. </div>
  83.  
  84. <div style=\"padding-left:30px; background-color:#FFF;  border-top:none;\">
  85. <?php 
  86. if($comments!="")
  87. {
  88. echo \"$paginationDisplay\";
  89. }
  90. else{
  91. echo \"This user has no posts ! \";
  92.  
  93. ?>
  94. </div>";
  95. ?>
  96.  
Mar 28 '11 #1
1 1747
Ensure that you had started session before printing a session variable and that session variable had been registered.
e.g.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3.  
  4. if(isset($_SESSION['id'])){
  5. ?>
  6. <input name="pm_sender_id" id="pm_sender_id" type="hidden" value="<?php echo $_SESSION['id']; ?>" />
  7. <?php
  8. }
  9. else{
  10. ?>
  11. <input name="pm_sender_id" id="pm_sender_id" type="hidden" value="" />
  12. <?php
  13. }
  14. ?>
Mar 29 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: christian_stengel | last post by:
Hi *, I have just started to learn python and I am having a problem with an python client connecting to a perl server using ssl (I tried this with pyOpenSSL and with the build in SSL Module). ...
5
by: Joe | last post by:
Hello: For some strange reason, on a certain page of my site I cannot create sub-routines. Everytime I get the same error, no matter where this subroutine is, what it does, and what its name...
1
by: Simon Dahlbacka | last post by:
Hi, I'm doing some preparation for a hopefully upcoming transition to python 2.4 (from 2.3.4) on winxp platform However, I'm getting SyntaxErrors in files that worked fine in 2.3, it tells me...
1
by: FaYYaZ | last post by:
Hi All I am getting error "Syntax error " when trying to define a class Like Class myClass Public height Public ID Private t_width
3
by: KevLow | last post by:
Hi, Hope some kind soul can help me out here.. I'm trying to programmatically modify the column headings of a crosstab query such that it can be dynamic based on user specified period (Month...
3
by: Maciek | last post by:
All, I'm having a problem building a library (VMime) with Visual .NET 2003. It's including, among others, gnutls.h from the GNU TLS library and I'm getting syntax errors in that file. For...
0
by: Xh | last post by:
Hi all, I have successfully installed DB2 Net Search Extender. DB2Ext is up and running, I've run successfully this command: db2text ENABLE DATABASE FOR TEXT CONNECT TO TEST1; but when I...
2
by: RogerInHawaii | last post by:
I would like to pass an array by reference to a function so that I can modify the contents of the array and effectively "return" that array to the caller. I tried doing this: function...
2
by: sharmilah | last post by:
I have the following code in my script and it's giving a syntax error at line *** when using the password function. My password in the mysql database is encrypted using the password function itself...
1
by: Bauklotz | last post by:
So, recently I've been experimenting with a telnet server, and a 5250 terminal emutator and I thought of making a field system, for easier graphical (well, not quite) displaying. This basically...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.