sorry but im back lol

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
TrickyRic
New php-forum User
New php-forum User
Posts: 50
Joined: Mon Mar 03, 2003 6:28 am
Location: Toronto, Canada
Contact:

sorry but im back lol

Postby TrickyRic » Sun Sep 21, 2003 10:58 am

<sigh> hi again lol, i thought i was finally getting the hang of php and then i decided to redesign my perfectly good site, and i didnt keep a backup, really wish i had but instead ill just have to continue with this new design and hope you people can once again throw me a rope so i can climb out of my hole :)

you may remember last time i was making a system that checked the inputted password and if it was correct, it made one table, if not, it made another (i believe the codes still on this forum somewhere). well you people all helped a lot and in the end we got it working. now im doing a similar thing using very similar code, its taken a lot of debugging but ive got it this far and now im totally stuck (it doesnt help that i have even less knowledge of html, im a dreamweaver wysiwyg kinda guy). anyway, my plan is to have a flash movie for the header of the page on the first load (when someone first visits the site) but then after that, it will be a static jpg file to stop it playing ovfer and over again. in theory it should be easy because my design already means its the same page, and depending on the value of 'page', different scripts are included. so if the hyperlink is index.php?page=community then community.php is added to the center table of index.php. im using isset statements to check if page has a value, and if not, the flash is shown, if so, the jpg is shown. and its not looking too bad.

now, heres the problem, when isset returns 0, its correctly ignoring the code to add the movie file, BUT its refusing to add the jpg, i know its the right file name, and i know it exists on my server, theres absolutely no reason why it shouldnt be shown. heres my code anyway (ive put the bit it seems to be ignoring in bold), just wondering if anybody has any ideas? thanks (o, btw, to see what i mean, heres the site so far.. http://www.freefornow.co.uk)

Code: Select all

<html>
<head>
<title>freefornow</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="links.css" type="text/css">
</head>

<body bgcolor="#CCCCCC" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" leftmargin="0" background="page.jpg" bgproperties="fixed">
<div align="center">
  <table width="600" border="0" cellspacing="0" cellpadding="0" height="100%">
  <?php
    $check = isset($page);
    if ($check == 1)
    {
  ?>
      [b]<tr background="head.jpg">
        <td height="100" colspan="5">&nbsp;</td>
      </tr>[/b]
  <?php
    }
    if ($check <> 1)
    {
  ?>
      <tr>
        <td height="100" colspan="5"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="600" height="100">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value="head.swf" />
        <param name="loop" value="false" />
        <param name="menu" value="false" />
        <param name="quality" value="medium" />
        <param name="wmode" value="transparent" />
        <param name="bgcolor" value="#2330B2" />
        <embed src="head.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="100">
        </embed>
        </object></td>
      </tr>
  <?php
    }
  ?>
  <tr>
      <td bgcolor="#0F144B" height="1" width="120">
        <div align="center"><font face="Courier New" size="2" color="#FFFFFF"><a href="index.php?page=home" class="linksheet">HOME</a></font></div>
      </td>
      <td bgcolor="#0F144B" height="1" width="120">
        <div align="center"><font face="Courier New" size="2" color="#FFFFFF"><a href="index.php?page=freeware" class="linksheet">FREEWARE</a></font></div>
      </td>
      <td bgcolor="#0F144B" height="1" width="120">
        <div align="center"><font face="Courier New" size="2" color="#FFFFFF"><a href="index.php?page=shareware" class="linksheet">SHAREWARE</a></font></div>
      </td>
      <td bgcolor="#0F144B" height="1" width="120">
        <div align="center"><font face="Courier New" size="2" color="#FFFFFF"><a href="index.php?page=premium" class="linksheet">PREMIUM</a></font></div>
      </td>
      <td bgcolor="#0F144B" height="1" width="120">
        <div align="center"><font face="Courier New" size="2" color="#FFFFFF"><a href="index.php?page=community" class="linksheet">COMMUNITY</a></font></div>
      </td>
    </tr>
    <tr valign="top" align="center">
      <td background="body.jpg" colspan="5"><br>
        <?php
        $check = isset($page);
        if ($check == 1)
        {
          if (@fopen("$page.php", "r"))
          {
            include ("$page.php");
          }
          if (!(@fopen("$page.php", "r")))
          {
            include("404.php");
          }
        }
        if ($check <> 1)
        {
          include("home.php");

          $counterfile='visits.dat';

          $fp = fopen($counterfile, 'r');
          $num = fread($fp, 100);
          $cnum = ($num + 1);
          fclose($fp);

          $fa = fopen($counterfile, 'w');
          fwrite( $fa, $cnum, 100);
          fclose($fa);

        }

        $counterfile='hits.dat';

        $fp = fopen($counterfile, 'r');
        $num = fread($fp, 100);
        $cnum = ($num + 1);
        fclose($fp);

        $fa = fopen($counterfile, 'w');
        fwrite( $fa, $cnum, 100);
        fclose($fa);
      ?>
        <br>
      </td>
    </tr>
    <tr>
      <td bgcolor="#0F144B" height="1" colspan="5">
        <div align="center"><font face="Courier New" size="2" color="#FFFFFF">Richard
          Grant</font></div>
      </td>
    </tr>
  </table>
</div>
</body>
</html>

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Mon Sep 22, 2003 7:52 am

judging by looking at your site it seems you have fixed it.

User avatar
TrickyRic
New php-forum User
New php-forum User
Posts: 50
Joined: Mon Mar 03, 2003 6:28 am
Location: Toronto, Canada
Contact:

fixed

Postby TrickyRic » Wed Sep 24, 2003 2:41 am

lol i dunno when you posted that, (ive just woken up) but i thought id fixed it last night and now ive just this second updated the server and yes its working :D im not very good with html so i was surprised id managed it but heres the change (it turned out to be a html bug not php)

i changed...

<tr background="head.jpg">
<td height="100" colspan="5">&nbsp;</td>
</tr>

..to...

<tr>
<td height="100" colspan="5" background="head.jpg">&nbsp;</td>
</tr>

..and all is happy. thanks to everyone who read my post, now i guess i have no excuse for not getting to work on the rest of the site lol.

[EDIT]
hmm, just noticed you posted on the 22nd, it should have sent me an email to say i got a new post :? o well its working now anyway


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron