4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 using html tables in php scripts..
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
selpaw
WebHelper
WebHelper


Joined: 10 Jan 2002
Posts: 55
Location: Perth, Western Australia

PostPosted: Sat Jan 12, 2002 12:28 pm (22 years, 3 months ago) Reply with QuoteBack to Top

im using a php mailing list script, and I want to make it look like the rest of my site, which makes use of tables. below is a sample of code i have added:

echo "<table border=1 bgcolor="#FEDEB8" cellpadding=5 cellspacing=3 width=80% align=center valign=top height="240">";
echo "<tr>";

however it generates an error on the echo "<tr>";

and its not because of the <tr>, as i had two other lines above the code i pasted here and it coughed on <center>

what am I doing wrong? I know very little about php

thanks for any help

oh.. the error message i get is:

Parse error: parse error, expecting `','' or `';'' in /webdir/username/worldwide/phpscript/themailer/path/rgnmailer.php on line 80

in this case, echo "<tr>"; being the the 80th line...

________________________________
Luke

Selpaw Web Directory
OfflineView User's ProfileFind all posts by selpawSend Personal MessageVisit Poster's Website
JdS
Junior WebHelper
Junior WebHelper


Joined: 08 Jan 2002
Posts: 24
Location: KUL, Malaysia

PostPosted: Sat Jan 12, 2002 12:51 pm (22 years, 3 months ago) Reply with QuoteBack to Top

Warp wrote:
echo "<table border=1 bgcolor="#FEDEB8" cellpadding=5 cellspacing=3 width=80% align=center valign=top height="240">";
echo "<tr>";


Code:
echo "<table border=1 bgcolor=\"#FEDEB8\" cellpadding=5 cellspacing=3 width=80% align=center valign=top height=\"240\">";
echo "<tr>";


aren't u supposed to use the backslash in your code??

________________________________
JdS from
The Learning Journal

'New script on the Block' - GIDtopsites
OfflineView User's ProfileFind all posts by JdSSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Jan 12, 2002 12:55 pm (22 years, 3 months ago) Reply with QuoteBack to Top

Yes, you are, however,
Code:
echo "<tr>";
shouldn't produce an error.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
selpaw
WebHelper
WebHelper


Joined: 10 Jan 2002
Posts: 55
Location: Perth, Western Australia

PostPosted: Sat Jan 12, 2002 1:15 pm (22 years, 3 months ago) Reply with QuoteBack to Top

ok... thanks.. got that bit worked out.. however now... it just generates a blank screen Sad

any ideas? would i better off using the "print" command/function? or single quotes?

________________________________
Luke

Selpaw Web Directory
OfflineView User's ProfileFind all posts by selpawSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Jan 12, 2002 1:24 pm (22 years, 3 months ago) Reply with QuoteBack to Top

Could you please give us a URL? And did you look @ the source of the "blank page"?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
selpaw
WebHelper
WebHelper


Joined: 10 Jan 2002
Posts: 55
Location: Perth, Western Australia

PostPosted: Sat Jan 12, 2002 1:57 pm (22 years, 3 months ago) Reply with QuoteBack to Top

the url http://selpaw.com/scripts/mailer/recipes/rgnmailer.php?=subscribe

im trying to configure the subscribe page first...

view the page code of that is.. <html> <body> </body> </html>

click here to view the souce

________________________________
Luke

Selpaw Web Directory
OfflineView User's ProfileFind all posts by selpawSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Jan 12, 2002 2:06 pm (22 years, 3 months ago) Reply with QuoteBack to Top

What have you modified since it last worked?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
selpaw
WebHelper
WebHelper


Joined: 10 Jan 2002
Posts: 55
Location: Perth, Western Australia

PostPosted: Sat Jan 12, 2002 2:18 pm (22 years, 3 months ago) Reply with QuoteBack to Top

since adding:

echo "<table border=1 bgcolor=\"#FEDEB8\" cellpadding=5 cellspacing=3 width=80% align=center valign=top height=\"240\">";
echo "<tr>";
echo "<td colspan=2 bgcolor=\"#FFFE7\"> <FONT FACE=\"MS Sans Serif, arial,helvetica\" size=1 COLOR=\"navy\">";
echo " <b>Kaye\'s Recipe\'s: Welcome</b></font></td>";
echo "</tr>";
echo "<tr>";
echo "<td height=\"278\">";
echo "<p>";
echo "<center>";





echo "</center>";
echo "<br>";
echo "<p>&nbsp; </p>";
echo "<p><font face=\"verdana,arial,helvetica\" size=\"1\"><b> </b></font>";
echo " </td>";
echo "</tr>";
echo "</table>";

echo "</center>";

________________________________
Luke

Selpaw Web Directory
OfflineView User's ProfileFind all posts by selpawSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Jan 12, 2002 2:20 pm (22 years, 3 months ago) Reply with QuoteBack to Top

This is what's wrong:

Code:
Kaye\'s Recipe\'s


You shouldn't escape the ' when you're using " for your variables.

Also, your HTML isn't really valid, but that doesn't matter.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
selpaw
WebHelper
WebHelper


Joined: 10 Jan 2002
Posts: 55
Location: Perth, Western Australia

PostPosted: Sat Jan 12, 2002 2:36 pm (22 years, 3 months ago) Reply with QuoteBack to Top

the html code is pretty much straight copy from Gossamer-Threads DBMan.....

ill make the mentioned changes and see what happens.....

---------

still a blank page......

edit:

looking for another mailing list... one that maybe a bit more secure as well....

________________________________
Luke

Selpaw Web Directory
OfflineView User's ProfileFind all posts by selpawSend Personal MessageVisit Poster's Website
TerKuhlsw
Junior WebHelper
Junior WebHelper


Joined: 24 Jan 2002
Posts: 2

PostPosted: Thu Jan 24, 2002 2:45 am (22 years, 2 months ago) Reply with QuoteBack to Top

here is an example from my site at f2s
------------------------------------------------
<?
//Initialize database settings.

$link = mysql_connect("db.terkuhl.f2s.com:3306", "terkuhl", "*******");
$dbname = "terkuhl";
$tablename = "members";
//Initialize each table cloumn.

$query = "SELECT * from $tablename ORDER BY Sort";

$result = mysql_db_query ($dbname, $query, $link);

//create a table
print ("<table border=0 width=\"100%\" cellspacing=1 cellpadding=1 align=center>\n");
print ("<tr align=center>\n");
print ("<td align=center><b><u><h2>Rank</b></u></h2></td>\n");
print ("<td align=center><b><u><h2>Name</b></u></h2></td>\n");
print ("<td align=center><b><u><h2>Account</b></u></h2></td>\n");
print ("<td align=center><b><u><h2>Class</b></u></h2></td>\n");
print ("<td align=center><b><u><h2>Level</u>*</b></h2></td>\n");
print ("<td align=center><b><u><h2>XP</b></u></h2></td>\n");
print ("<td align=center><b><u><h2>E-Mail</b></u></h2></td>\n");
print ("</tr>\n");


while ($row = mysql_fetch_array ($result)) {
print ("<tr align=center valign=top>\n");
print ("<td align center valign=top>$row[Rank]</td>\n");
print ("<td align center valign=top>$row[Char_Name]</td>\n");
print ("<td align center valign=top>$row[Accnt_Name]</td>\n");
print ("<td align center valign=top>$row[Char_Type]</td>\n");
print ("<td align center valign=top>$row[Level]</td>\n");
print ("<td align center valign=top>$row[xp]</td>\n");
print ("<td align center valign=top><a href=mailto:$row[Email]>$row[Email]</a></td>\n");
print ("</tr>\n");
}

mysql_close ($link);
print ("</table>\n");
OfflineView User's ProfileFind all posts by TerKuhlswSend Personal Message
selpaw
WebHelper
WebHelper


Joined: 10 Jan 2002
Posts: 55
Location: Perth, Western Australia

PostPosted: Thu Jan 24, 2002 12:48 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Andrew wrote:

Try this
Code:
echo "1st line of what you want to print to browser" .
"2nd line" .
"3rd Line" .
"lastline";



thanks for your help... i have given that script a miss a now... found one that works.. and has more features etc... thanks tho!

________________________________
Luke

Selpaw Web Directory
OfflineView User's ProfileFind all posts by selpawSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.323892 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme