Posts filed under 'PHP'

Creating your own IFRAME and how to use them

If you allready know this then ignore this, but IFRAMEs are not good for accessability and – like many javascripts – I do not recommend the use of this, or any extensive use of javascript.

How Does it work?

The IFRAME tag needs the following properties URL: the address to the page you wish to include Name: You need to name each IFRAME Width: Width of the frame can be in percent/pixels Height: Height of the frame can be in percent/pixels Allignment: Where the Iframe Alligns. Border: Border Boolean Value Yes/No

The Code

Here is an example guided one for our own site
<iframe src="http://fabio.ugtech.net"
 name="fabiosframe"
width="50%"
height="200px"
align="middle"
scrolling="no"
frameborder="yes">
</iframe>
That’s an example which I have tried to use all possible values except Align So heres the diffrent variables
name="anytext here"
width="precentage px pt etc"
height="same as above goes like 200px"
align="can be either Left, Right, Top, Middle, Bottom"
scrolling="yes/no"
frameborder="yes/no"
Note: There is other methods listed on this site for redirecting and including other content, and css can be used to impliment scroll bars with the overflow = auto or always with scrollbars. I do not recommend the use of this script as it has deprecated.

Links:
Including content with out IFRAMEs

Add comment August 28th, 2005

Getting the users agent or Web browser using PHP

Are you still using Javascript which is ClientSideScripted. You have to rely on the user to have Javascript enabled. Random users are not reliable, expessially when they use numerous systems, browsers, etc. So this is why I focus on Server Side Scripting rather than Client Side Scripting (Javascript, Java, Flash are examples of Client Side Scripting – aka – CCS) Having one server doing all the work means, that your pages load at the same speed, (not slower on slow computer faster on some) everybody has the same accessability (this is some cases – eg CSS2 is not fully supported in IE and older versions of Netscape) so this is not fool proof but it works better than then CCS. Now you want to get the users Browser for what ever reason, with out using Javascript get this done.. easy PHP!

The coding


PHP predefines some variables on the server such as the information variables. $_SERVER[“HTTP_USER_AGENT”] is one of these.

So to get the code we use
< ?php
$_SERVER["HTTP_USER_AGENT"]
# http://fdr.at.tt scripts
?>

Code Examples

To print the code on a page examples Eg. Browser: $_SERVER[“HTTP_USER_AGENT”]
echo 'Browser:' . $_SERVER["HTTP_USER_AGENT"];
or
echo ('Browser:' . $_SERVER["HTTP_USER_AGENT"]);
Eg. You define the text, that says Browser: using a variable
< ?
$fabio_browser = 'Browser: '
Note: I put a space at the end other wise you’ll have somthing like Browser:Mozillia instead of Browser: Mozilla
echo $browser . $_SERVER["HTTP_USER_AGENT"];
?>
Eg. Just print it out the User Agent
< ? echo($_SERVER["HTTP_USER_AGENT"]); ?>

For help leave a comment and some one will help you or I will.

Add comment August 28th, 2005

Get or Print The Users IP using PHP

This code works by default on most php servers, just prints out a basic IP address of the user can be used or implented in about anything, from database to tic tac toe game.

Continue Reading Add comment August 28th, 2005

Previous Posts


Calendar

November 2009
S M T W T F S
« Oct    
1234567
891011121314
15161718192021
22232425262728
2930  

Posts by Month

Posts by Category