Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 10-23-2008, 03:02 PM Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
Dear Friends,

I facing a problem of display in my guestbook. Im not able to trace out where Im putting tht mistake. I trust you ppl only. Plz sort it out.

HTML Code:
<div class="postcomment">  
<h3 name="postcomment" id="postcomment" title="postcomment" align="left">Leave a comment</h3></a>   
<form method="post" name="guestform" action="viewguestbook.php">
      <p><input name="nick" type="text" id="nick" size="22">
       <label for="author"><small>:Nick </small></label></p>
      <p><input name="email" type="text" id="email" size="22">
       <label for="email"><small>:E-Mail </small></label></p>
     <input type="hidden" name="item_id" value="1" />
     <textarea name="comments" cols="30" rows="10" id="comments"></textarea>
      <p><input name="btnSign" type="submit" id="btnSign" value="Sign Guestbook" class="button" onmouseover="this.className='button_h'" onmouseout="this.className='button'" onClick="return checkForm();"></p>
</p>
</form>
</div>
PHP Code:
<?php
// how many guestbook entries to show per page
$rowsPerPage 10;
// by default we show first page
$pageNum 1;
// if $_GET['page'] defined, use the value as page number
if(isset($_GET['page']))
{
 
$pageNum $_GET['page'];
}
// counting the offset ( where to start fetching the entries )
$offset = ($pageNum 1) * $rowsPerPage;
// prepare the query string
$query "SELECT nick, email, comments, DATE_FORMAT(date, '%d.%m.%Y'), item_id
         FROM guestbook 
            WHERE item_id = 1
              ORDER BY id DESC
                 LIMIT 
$offset$rowsPerPage";
                         
// execute the query 
$result mysql_query($query) or die('Error, query failed. ' mysql_error());
// if the guestbook is empty show a message
if(mysql_num_rows($result) == 0)
{
?>
<p><br>
 <br>Guestbook is empty </p>
<?php
}
else
{
 
// get all guestbook entries
 
while($row mysql_fetch_row($result)) {
 
  
// list() is a convenient way of assign a list of variables
  // from an array values
  
list($nick$email$comments$date) = $row;                     
                        
  
// change all HTML special characters,
  // to prevent some nasty code injection
  
$nick    htmlspecialchars($nick);
  
$comments htmlspecialchars($comments);  
  
// convert newline characters ( \n OR \r OR both ) to HTML break tag ( <br> )
  
$comments nl2br($comments);
?>
<div class="comments">
        <h2><img src="images/icons/comments.png" width="16" height="16" alt="Post a Comment" style="cursor: pointer; vertical-align: -20%;" /> Comments</h2>
        <!-- Comments Start -->
                        <div class="comment-item" align="left">
                    <?=$comments;?><br>
          <p class="comment-info">
            <small>
              Comment by  <?=$nick;?>  —   <?=$date;?>
            </small>

          </p>
                  </div>
        <br>
  <!-- Comments End -->
<?
}
}
mysql_close(); //close database
?>

      </div>
      <!------------ END Comment List ------------>
Ignatius
Attached Images
File Type: jpg actual_display.JPG (45.7 KB, 3 views)
File Type: jpg false.JPG (34.0 KB, 3 views)
iggywiggy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-23-2008, 03:38 PM Re: Display problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
need a URL to see the final code
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-23-2008, 03:44 PM Re: Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
http://worldzyourz.info/viewguestbook.php
iggywiggy is offline
Reply With Quote
View Public Profile
 
Old 10-23-2008, 04:27 PM Re: Display problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
HTML Code:
          </p>

                  </div>
        <br>
it's missing the closing div  here
  <!-- Comments End -->
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-24-2008, 07:55 AM Re: Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
Dear chrishirst,

Now Im facing th problem of individual Comments block. U can see the same in my URL...
http://worldzyourz.info/viewguestbook.php

Plz help me.

Ignatius
iggywiggy is offline
Reply With Quote
View Public Profile
 
Old 10-24-2008, 08:49 AM Re: Display problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
looks fine in FF

IE gets it wrong because it is in "quirks" mode, apply a valid doctype before you do ANYTHING else otherwise you are simply p!$$ing into the wind (to coin a phrase )

BTW having a conditional comment of (if NOT IE) is a little pointless

the negation operator "!" should be used for targeting specific versions of IE
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-24-2008, 02:47 PM Re: Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
Dear chrishirst,

Maybe the .JS & .CSS link got nothing to do in my page. so,The above suggestion got not worth,except the below words of yours (it means a lot & gave a chance to resolve my problem.)

"you are simply p!$$ing into the wind (to coin a phrase )"

Really I was pi$$ing in wind only.

Thanx alot,
Ignatius
iggywiggy is offline
Reply With Quote
View Public Profile
 
Old 10-24-2008, 03:02 PM Re: Display problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Maybe the .JS & .CSS link got nothing to do in my page. so,The above suggestion got not worth
??? Sorry don't understand what you mean.

A full, valid DTD is essential to make Internet Explorer behave correctly with CSS layouts.
Nothing to do with javascript or stylesheet links.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 09:24 AM Re: Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
Dear chrishirst,

I mean to say tht words u wrote.. Its all abt formating my comments area. I have put the comments area in a wrong pattern or may in wrong manner. My previous quoted words really gave new view of thinking. Now u can see the URL http://worldzyourz.info/test1.php

Im always thankful to u ppl. What ever u write it make a meaning for my designing. As Im not a web designer. Im a telecom engineer. If I said anything wrong. Feel sorry for that. Will come to you if I got any problem with my next level of execution. Don't miss understand.

Thanx,

Ignatius
iggywiggy is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 10:03 AM Re: Display problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Get rid of that junk in the meta keywords element as soon as possible. While SEs ignore the meta KW element for anything useful, stuffing that much junk in it NOT going to do you any favours.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 11:22 AM Re: Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
Dear chrishirst,

Thanx for your suggestion. I got no Idea abt Search Engine Optimization. As of now I tried to add my URL in google. They too not accepted my web page. Im totally puzzled with it. I will remove those keywords immdtly.

Thanx,
Ignatius
iggywiggy is offline
Reply With Quote
View Public Profile
 
Old 10-26-2008, 01:35 PM Re: Display problem
Experienced Talker

Posts: 31
Name: Ignatius Vinoth
Trades: 0
Dear chrishirst,

PHP Code:
<?xml version "1.0"?>
Can you plz tell me whats wrong with above coding Im getting,

Code:
Parse error: syntax error, unexpected T_STRING in /home/worldzyo/public_html/rss.php on line 1
Even I tried all ;,('s all blah blah's


As well as I have writen rss.php codings


HTML Code:
<rss version="2.0">  
  <channel>   
  <title>worldzyourz.info</title>
   <link>http://www.worldzyourz.info</link>
   <description>Movies-All Movies to rock u around...Enjoy</description>
   <language>en-us</language>
   <copyright>2008 worldzyourz.info</copyright>
   <managingEditor>iggywiggy@worldzyourz.info (Iggy)</managingEditor>
   <webMaster>iggywiggy@worldzyourz.info (Iggy)</webMaster>
   <pubDate>Sun, 26 Oct 2008 21:06:45 EDT</pubDate>
   <lastBuildDate>Sun, 26 Oct 2008 21:06:45 EDT</lastBuildDate>
   <category>Movies Special</category>  
  <generator>worldzyourz RSS Generator</generator>
   <docs>http://www.rssboard.org/rss-specification</docs>
   <ttl>60</ttl>
   <image>
    <url>http://www.worldzyourz.info/images/rss_icon.png</url>
    <title>worldzyourz.info</title>
    <link>http://worldzyourz.info</link>
    <height>10</height>
    <width>10</width>
    <description>Movies-All Movies to rock u around...Enjoy</description>
   </image>
[php]
<?php
//Connect to the database here
require_once('includes/config.php');
require_once('includes/opendb.php');
//Create the SELECT statement and execute it
$query = "SELECT *, DATE_FORMAT(article_date, '%a, %d %b %Y %T PST') AS article_pubdate FROM articles ORDER BY article_date LIMIT 5";
$result = mysql_query($query);
//Iterate over the rows to create each item
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){

echo '<item>
<title>'.$row['article_title'].'</title>
<link>'.$row['article_url'].'</link>
<description>'.$row['article_text'].'</description>
<author>'.$row['article_author'].'</author>
<category>'.$row['article_category'].'</category>
<pubDate>'.$row['article_pubdate'].'</pubDate>
<source url="

Last edited by iggywiggy; 10-26-2008 at 01:40 PM.. Reason: missed to end ith php tag
iggywiggy is offline
Reply With Quote
View Public Profile
 
Old 10-26-2008, 08:20 PM Re: Display problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the PHP interpreter is set to use short_tags "<?" and is trying to run the line as PHP.

it's a very old problem and the equally old fix is to echo the xml declaration into the document.

echo("<?xml version =\"1.0\"?>")
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Display problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37044 seconds with 13 queries