# PHP gBook script

**URL:** <https://forum.kirupa.com/t/php-gbook-script/25491>\
**Category:** programming\
**Created:** [July 13, 2003, 3:12pm UTC](https://forum.kirupa.com/t/php-gbook-script/25491 "2003-07-13T15:12:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joso](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@joso](https://forum.kirupa.com/u/joso)\
**Post date:** [July 13, 2003, 3:12pm UTC](https://forum.kirupa.com/t/php-gbook-script/25491/1 "2003-07-13T15:12:48Z")

</div>

Hey, this is for a PHP gBook, i’m really crap when it comes to PHP scripts, anyone know this keeps saying Parse Error on line 21 ?(whats the one with the date bit on)…

```php
<?php
 if ($message != '') 
 {
  $message = str_replace ("
","<br>",$message);
  $message = strip_tags ($message, '<br>');

  $newRow = '<div class="viewGuestbook">' . '<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="left" valign="top">'. strip_tags ($name) .'</td>
  </tr>
  <tr>
    <td align="left" valign="top"></td>
  </tr>' .
  	    '<tr>
    <td align="left" valign="top">'. ($message) .'</td>
  </tr>
  <tr>
    <td align="left" valign="top"></td>
  </tr>'
  	    '<tr>
    <td align="right" valign="top">'. date('d.m.Y') .'</td>
  </tr>
</table></div>';
  	      
  $oldRows = join ('', file ('guestbook.txt') );
  $fileName = fopen ('guestbook.txt', 'w');
  fputs ($fileName, $newRow . chr(13) . chr(10) . $oldRows);
  fclose ($fileName);
 }
 
 include ("guestbook.php");
?>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2003, 5:16pm UTC](https://forum.kirupa.com/t/php-gbook-script/25491/2 "2003-07-13T17:16:28Z")

</div>

when you are printing something and you need to have quotes then you have to do "

somehting like

```php
<td align=\"right\">

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2003, 10:27pm UTC](https://forum.kirupa.com/t/php-gbook-script/25491/3 "2003-07-13T22:27:28Z")

</div>

Not really, depends on the quotes, ’ is not like "…  
but check this:

```php

<td align="left" valign="top"></td>
  </tr>' .
          '<tr>
    <td align="left" valign="top">'. ($message) .'</td>
  </tr>
  <tr>
    <td align="left" valign="top"></td>
  </tr>'
          '<tr>

```

you forgot the . in the second bolded part to concatenate it!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 5:40am UTC](https://forum.kirupa.com/t/php-gbook-script/25491/4 "2003-07-14T05:40:54Z")

</div>

doh! it took my slashes out… stupid php… yeah thats true too … just not the way I go about it…
