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
PHP coding problem with echo
Old 08-14-2007, 01:24 PM PHP coding problem with echo
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
TALKUPATION WILL BE GIVEN
I am having a problem with echo $dsrptn in the file head.php from my other file I don't know why I can't get it to post correctly

my header head.php

Code:
<html>
<head>
<link rel="stylesheet" type="text/css"
href="http://www.technologyforever.com/test.css" />
<link rel="Shortcut Icon" href="http://technologyforever.com/favicon.ico">
<meta name="description" content="<?php echo $dsrptn; ?>">
<META NAME="KEYWORDS" CONTENT="games, kids games, fun games, play free games, web game, java game, arcade game, arcade, arcades, flash, flash java, online, play online, free, free strategy, playable, kids, teens, technologyforever.com">
<META NAME="ROBOTS" CONTENT="INDEX,FOLLOW">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META NAME="AUTHOR" CONTENT="TechnologyForever.com">
<meta http-equiv="Content-Language" content="en"/>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
<META NAME="COPYRIGHT" CONTENT="&copy; 2007 TechnologyForever.com">
<title>(Games , Forum , Fun ! ON Technology Forever.com ) - <?php echo "$sect"; ?> - <?php echo "$what"; ?></title>
<meta name="verify-v1" content="0MIoWbBzMG3P5TseRyUmOM7o3J5LL9Njf3HyRiMXpVw=" />
<style type="text/css">
<!--
.style16 {
    font-size: 16px;
    color: #000000;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<?php
$nav1hometf = "http://www.technologyforever.com/"; //main
$nav2blogtf = "http://www.technologyforever.com/blogtf/"; //Blog
$nav3gamestf = "http://www.technologyforever.com/game1.html"; //Games
$nav4forumstf = "http://www.technologyforever.com/forums/"; //Forums
$nav5contacttf = "http://www.technologyforever.com/contact.html"
?>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td colspan="12" background="http://www.technologyforever.com/images/bk.gif" bgcolor="#FFFFFF"><div align="left"><a href="http://www.technologyforever.com/"><img src="http://www.technologyforever.com/images/logo.gif" alt="GAMES GAMES FORUM FUN GAMES FORUM FUN" 
     width="357" height="95" border="0" /></a></div></td>
  </tr>
  <tr>
    <td width="32" background="http://www.technologyforever.com/images/tile_back.gif">&nbsp;</td>
    <td width="4" background="http://www.technologyforever.com/images/tile_back.gif"><img src="http://www.technologyforever.com/images/sep.gif" width="3" height="25" /></td>
    <td width="112" background="http://www.technologyforever.com/images/tile_back.gif"><div align="center" class="style1 style5"> <a href="<?php echo $nav1hometf; ?>" class="nav">Home</a></div></td>
    <td width="4" background="http://www.technologyforever.com/images/tile_back.gif"><img src="http://www.technologyforever.com/images/sep.gif" width="3" height="25" /></td>
    <td width="112" background="http://www.technologyforever.com/images/tile_back.gif"><div align="center" class="style1 style5"><a href="<?php echo $nav2blogtf; ?>" class="nav">Blog</a></div></td>
    <td width="4" background="http://www.technologyforever.com/images/tile_back.gif"><img src="http://www.technologyforever.com/images/sep.gif" width="3" height="25" /></td>
    <td width="112" background="http://www.technologyforever.com/images/tile_back.gif"><div align="center" class="style1 style5"><a href="<?php echo $nav3gamestf; ?>" class="nav">Games</a></div></td>
    <td width="4" background="http://www.technologyforever.com/images/tile_back.gif"><img src="http://www.technologyforever.com/images/sep.gif" width="3" height="25" /></td>
    <td width="113" background="http://www.technologyforever.com/images/tile_back.gif"><div align="center" class="style1"><a href="<?php echo $nav4forumstf; ?>" class="nav">Forum</a></div></td>
    <td width="3" background="http://www.technologyforever.com/images/tile_back.gif"><img src="http://www.technologyforever.com/images/sep.gif" width="3" height="25" /></td>
    <td colspan="2" background="http://www.technologyforever.com/images/tile_back.gif"><form id="form1" name="form1" method="post" action="">
      </form></td>
  </tr>
  <tr>
    <td colspan="12" align="center" valign="middle"><h1 align="center" class="style500 style16"></h1></td>
  </tr>
  </table>
my page

Code:
<?php
$sect = ('Games');



require('configure.php');

require('mySqlClass.inc.php');
$db = new mysqlClass();
$db->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE);

require('myPaginationClass.inc.php');
$pagination = new myPagination();

$results = $pagination->ReturnResults('*', 'games', '1=1 ORDER BY id', 1);

//echo "<b><center>Database Output</center></b><br><br>";

$i=0;
while(!$results->EOF) {

$gatitle=$results->fields['title'];
$gadescr=$results->fields['descr'];
$galocat=$results->fields['locat'];
$what=$results->fields['title'];

require('head.php');
$results->MoveNext();
echo '<table bgcolor="#FFFFFF" width="95%%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center" class="style1">
      <h2>'.$gatitle.'</h2>
    </div>
    <tr>
      <td colspan="3"><center><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,30,0" width="350" height="300" align="middle">
<param name=movie alt="'.$gatitle.'" value="http://technologyforever.com/SWF/'.$galocat.'?url=technologyforever.com">
<param name=quality value=high>
<embed src=http://technologyforever.com/SWF/'.$galocat.'?url=technologyforever.com width="468" height="440" align="middle" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" menu="1"></embed>
</object>
<p></p>
</center></td>
    </tr>
    <tr>
      <td colspan="3"><div align="center">
        <form id="form1" name="form1" method="post" action="">
          <label> Description:<br />
          <textarea name="textarea" id="textarea" cols="45" rows="5">'.$gadescr.'</textarea>
          </label>
        </form>
        </div></td>
    </tr>
    </td>
  </tr>
</table>';
require('foot.php');
 } ?>
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Last edited by goheadtry; 08-14-2007 at 01:27 PM..
goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 08-14-2007, 01:52 PM Re: PHP coding problem with echo
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
ok sorry i dont have enough time at the moment to go tho it,

but some hints,

when ur assigning variables, you dont need to put it in brackets

$sect = ('Games');


$sect = 'Games';

does just as well, cuts down ur file size and makes it a little easier to read.

Also when assigning variables i would advise using single quotes
because PHP parses double quotes and so using double quote when its just pleain text and html it lighten the load on php a litle,

isnt needed when assigning variables i would advise using single quotes.

so
PHP Code:
<?php
$nav1hometf 
"http://www.technologyforever.com/"//main
$nav2blogtf "http://www.technologyforever.com/blogtf/"//Blog
$nav3gamestf "http://www.technologyforever.com/game1.html"//Games
$nav4forumstf "http://www.technologyforever.com/forums/"//Forums
$nav5contacttf "http://www.technologyforever.com/contact.html"
?>
could be better as
PHP Code:
<?php
$nav1hometf    
'http://www.technologyforever.com/'//main
$nav2blogtf      'http://www.technologyforever.com/blogtf/'//Blog
$nav3gamestf   'http://www.technologyforever.com/game1.html'//Games
$nav4forumstf  'http://www.technologyforever.com/forums/'//Forums
$nav5contacttf 'http://www.technologyforever.com/contact.html';
?>
when i have a bit more time il ahev a better look hope this helps.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-14-2007, 03:12 PM Re: PHP coding problem with echo
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
Dan you are not talking about the same thing
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 08-14-2007, 03:22 PM Re: PHP coding problem with echo
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
i know i just said some tips in general.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-14-2007, 04:14 PM Re: PHP coding problem with echo
blackfalcon's Avatar
Skilled Talker

Latest Blog Post:
New Site: 10DollarBluRay.com
Posts: 62
Name: JuanJose H. Galvez
Trades: 0
Where are you pulling the information for that page on? If you are actually getting it from a previous form (using POST or GET) don't forget to set $dsrptn = $_POST['variable']; or $dsrptn = $_GET['variable']; Now if you are setting this variable in another page of code, make sure that page is included before you attempt to echo it.
blackfalcon is offline
Reply With Quote
View Public Profile Visit blackfalcon's homepage!
 
Reply     « Reply to PHP coding problem with echo
 

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.17352 seconds with 12 queries