Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Fitting web pages within the computer screen

Links for php scripts

Moderators: macek, egami, gesf

Fitting web pages within the computer screen

Postby IamNew » Tue Mar 13, 2012 6:26 am

Hi there,

I have a couple of web pages created but when I am previewing them in internet browser, the web pages somehow not fitting the screen when I trying to display them with different pc.

Meaning to say, if I create web page using larger screen pc and the webpage cant be fully preview when using a smaller screen pc. How can I make my web pages fit the screen flexibly?
IamNew
New php-forum User
New php-forum User
 
Posts: 28
Joined: Fri Nov 04, 2011 6:29 am

Re: Fitting web pages within the computer screen

Postby Acorn » Tue Mar 13, 2012 8:09 am

Hello,

Pm me the files and I'll have a look at them for you. I'll point out what you have done wrong, fix that if you would like me to and I'll also send you them back.

Thanks,

Adam.
Acorn
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Mar 13, 2012 8:07 am

Re: Fitting web pages within the computer screen

Postby IamNew » Tue Mar 13, 2012 5:45 pm

Acorn wrote:Hello,

Pm me the files and I'll have a look at them for you. I'll point out what you have done wrong, fix that if you would like me to and I'll also send you them back.

Thanks,

Adam.


This is my index file:
Code: Select all
<?php require_once('Connections/connection.php'); ?>

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['admin_id'])) {
  $loginUsername=$_POST['admin_id'];
  $password=$_POST['password'];
  $MM_fldUserAuthorization = "student_id";
  $MM_redirectLoginSuccess = "manage_student.php?student_id=$loginUsername";
  $MM_redirectLoginFailed = "index.php?error=e";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_connection, $connection);
     
  $LoginRS__query=sprintf("SELECT student_id, student_pass, student_id FROM student WHERE student_id=%s AND student_pass=%s",
  GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "text"));
   
  $LoginRS = mysql_query($LoginRS__query, $connection) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
   
    $loginStrGroup  = mysql_result($LoginRS,0,'student_id');
   
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;        

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FENG Mentor Mentee System</title>


<script type="text/javascript" src="image/swfobject.js"></script>
<script type="text/javascript" src="image/prototype.js"></script>
<script type="text/javascript" src="image/scriptaculous.js"></script>
<script type="text/javascript" src="image/effects.js"></script>
<script type="text/javascript" src="image/lightbox.js"></script>
<link rel="stylesheet" href="image/lightbox.css" type="text/css" media="screen">

<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="image/clogo.PNG" type="image/x-icon"/>


</head>

<body background="image/background.jpg">
<!-- BodyFrame -->
<table width="1250" border="0" align="center" cellpadding="0" cellspacing="0">

    <!-- Banner -->
    <tr>
    <td width="1250" height="120" align="center" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1250" height="120" id="FlashID" title="banner">
      <param name="movie" value="banner.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="banner.swf" width="1250" height="120">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object></td>
    </tr>
    <!-- Banner -->
   
    <!-- TopBorder -->
    <tr>
    <td width="1250" height="30"  background="image/Header.png"><strong style="color: #FFF;">&nbsp;&nbsp;&nbsp;Welcome to Mentor Mentee System of Faculty of Engineering</strong></td>
  </tr>
    <!-- TopBorder -->

    <!--BodyMenuOut-->
    <tr>
    <td>
    <table width="1250" align="center" valign="top">

   <!--BodyMenuIn-->
   <tr>

      <!--BodyMenuLeft-->
      <td width="410" align="center" valign="top">                     
            <table width="420" border="0" cellpadding="0" cellspacing="0">
               <tr>
                    <td width="420" height="18">
                        <!--BorderGray-->
                        <table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="420" height="23"  style="font-size: 12px"></td>
                            </tr>
                        </table>
                        <!--BorderGray-->
                    </td>
            <tr><!--XXX-->
                    <td width="420" align="left" valign="top">
                       <form action="<?php echo $loginFormAction; ?>" method="POST" name="frmLogin" id="frmLogin" style="font-size: 12px;">
                        <table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
                     <!--StudentLecturer-->
                            <tr>
                                <td height="32" colspan="4">
                                <strong>&nbsp;
                                <a href="login_admin.php"style="color:#FFFFFF; font-size: 13px">Administrator</a> | <a href="login_lecturer.php" style="color:#FFFFFF; font-size: 13px">Lecturer</a></strong></td>
                          </tr>
                     <!--StudentLecturer-->
                     <!--LoginStudent-->
                            <tr>
                                <td height="23" colspan="4"> <strong style="color: #FFD700; font-size: 13px;">&nbsp;&nbsp;&nbsp;Login Student</strong></td>
                            </tr>
                     <!--LoginStudent-->
                            <tr>
                                <td height="6" colspan="4"></td>
                            </tr>
                     <!--UserID-->
                            <tr>
                                <td width="40" height="23"></td>
                                <td width="75" height="23"><strong style="color: #FFFFFF; font-size: 12px;">UserID</strong></td>
                                <td width="15"><strong style="color: #FFFFFF; font-size: 12px;">:</strong></td>
                                <td width="290" style="font-size: 12px">
                                <span id="sprytextfield1">
                                <label>
                                    <input style="font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #009;" name="admin_id" type="text" id="admin_id" size="11" maxlength="100" />
                                </label>
                                </span>
                                </td>
                            </tr>
                     <!--UserID-->
                     <!--Password-->
                            <tr>
                                <td width="40" height="23"></td>
                                <td width="75" height="23"><strong style="color: #FFFFFF; font-size: 12px;">Password</strong></td>
                                <td width="15" height="23"><strong style="color: #FFFFFF; font-size: 12px;">:</strong></td>
                                <td width="290" style="font-size: 12px">
                                <span id="sprypassword1">
                                <label>
                                    <input style="font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #009;" name="password" type="password" id="password" size="11" maxlength="100" />
                                </label>
                                </span>
                                </td>
                            </tr>
                     <!--Password-->
                            <tr>
                                <td height="6" colspan="4"></td>
                            </tr>
                     <!--LoginButton-->
                            <tr>
                                <td height="21" colspan="3"></td>
                                <td width="290" height="21">
                                <label>
                                   <input type="image" src="image/button_login.gif" name="Login" id="Login" value="Login" />
                                </label>
                                </td>
                            </tr>
                     <!--LoginButton-->
                        </table>
   
                  <!--InvalidUser-->
                        <?php if(isset($_REQUEST['error']) && ($_REQUEST['error']== 'e')) { ?>
                        <table width="300" border="0" align="left" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="300" height="5" colspan="2"></td>
                            </tr>
                            <tr>
                                <td width="40" height="3"></td>
                                <td width="260" height="3"></td>
                            </tr>
                            <tr>
                                <td width="40" height="20"></td>
                                <td width="260" height="20" style="color:#C00; text-align:center; font-weight: bold; font-size: 12px;">Invalid UserID or Password !!!</td>
                            </tr>
                            <tr>
                                <td width="40" height="20"></td>
                                <td width="260" height="20" style="color:#C00; text-align:center; font-weight: bold; font-size: 12px;">Please Try Again !!!</td>
                            </tr>
                            <tr>
                                <td width="40" height="3"></td>
                                <td width="260" height="3"></td>
                            </tr>
                        </table>
                   <!--InvalidUser-->
                  <?php }?>
                       </form>
               </td>
               </tr>
            </table>
      </td>
      <!--BodyMenuLeft-->

      <!--BodyMenuRight-->
      <td width="828" align="center" valign="top">
            <table width="818" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="23" colspan="3" align="center"><strong style="font-size: 14px; color: #E0FFFF;">Student Session</strong></td>
                </tr>
                <tr>
                    <td height="32" align="right" colspan="3"><strong style="color: #FFD700;">Date: </strong><strong style="font-size: 12px; font-weight: normal; color: #FFFFFF;"><?php
echo date("l, d-m-Y");
?></strong>  <strong style="color: #FFD700;">Time: </strong><strong style="font-size: 12px; font-weight: normal; color: #FFFFFF;"><?php
date_default_timezone_set('Asia/Singapore');
echo date('h:i A');
?></strong></td>
                </tr>
                <tr>
                    <td width="37" rowspan="3"></td>
                    <td width="744" height="6"></td>
                    <td width="37" rowspan="3"></td>
                </tr>
               <tr align="center">
                    <td width="744"><p class="style32" align="left"><span style="color: #000; font-weight: bold; font-size: 12px;font-weight: bold; color: #FFD700;">Welcome to Mentor Mentee System - Student Session</span></span></p>
                      <p style="font-size: 12px; text-align: justify; font-weight: normal; color: #FFFFFF;">In this session, student's can fully access their own personal information and make necessary  amendments  when needed.</p>
                  <p style="font-size: 12px; text-align: justify; font-weight: normal;color: #FFFFFF;">At the same time, student's can view their  academic information and academic progress along with a bar graph for each  academic session that they have completed thus far.</p></td>
                </tr>
                <tr>
                  <td width="744" height="6"></td>
                </tr>
                <tr>
                    <td height="32" colspan="3">&nbsp;</td>
                </tr>
            </table>
      </td>
      <!--BodyMenuRight-->

   </tr>
   <!--BodyMenuIn-->

    </table>
    </td>
    </tr>
    <!--BodyMenuOut-->

</table>
<!-- BodyFrame -->

<!-- BottomBorder -->
<table width="1250" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td width="1250" height="23"></td>
   </tr>
    <tr>
      <td height="23"></td>
    </tr>
    <tr>
      <td height="23"></td>
    </tr>
    <tr>
      <td height="23"></td>
    </tr>
    <tr>
        <td width="1250" height="23"></td>
    </tr>
    <tr>
        <td width="1250" height="23"></td>
    </tr>
   <tr>
        <td width="1250" height="500" align="center" valign="top" style="font-size: 10px;">
        <strong style="font-style: italic; color: #FFFFFF; font-weight: bold;">Faculty of Engineering Mentor Mentee</strong>
        <strong><a href="login_admin.php" style="font-style: italic; color:#FFFFFF; font-weight: bold;">System</a></strong>
        <strong style="font-style: italic; color: #FFFFFF;"> @ Copyright 2012</strong><br />
        <strong style="font-style: italic; color: #FFFFFF;">Designed by Kuan Ee Liang</strong><br />
        <strong style="font-style: italic; color: #FFFFFF;">Revised by Dr Mohd Saufee Muhammad</strong></td>
    </tr>
</table>
<!-- BottomBorder -->

<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1");
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>


I cant view the full width of this page within my computer screen.
IamNew
New php-forum User
New php-forum User
 
Posts: 28
Joined: Fri Nov 04, 2011 6:29 am

Re: Fitting web pages within the computer screen

Postby minimihi » Tue Apr 24, 2012 5:49 pm

Code: Select all
width="1250"


well of course they don't fit.
Use % to determine width so that it would fin in any resolution.
Or use standard width in pixels so that it would fit most smallest standard resolutions.
User avatar
minimihi
New php-forum User
New php-forum User
 
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Re: Fitting web pages within the computer screen

Postby JordanMRichards » Wed Apr 25, 2012 6:58 am

I recommend you read up on the "flexible box" model with CSS3, that will make sure that no matter the size of your browser/screen, your website will auto-adjust.

:)

Hope this helped,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
14 Year Old Programmer & Graphic Artist, Confident and Courageous
Image
User avatar
JordanMRichards
New php-forum User
New php-forum User
 
Posts: 84
Joined: Mon Apr 23, 2012 7:43 am


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.