tarun
-
Posts
321 -
Joined
-
Last visited
Never
Posts posted by tarun
-
-
Also Works On My
1. AOL 9.0
2. IE 7.0
Windows XP Home Edition
-
Ive Already Asked For Help About This But...
Heres My New Code
<?PHP $host = $_SERVER['HTTP_HOST']; ?> <?PHP INCLUDE("http://$host/header.php"); ?> <DIV CLASS="contentheaderdiv">Home</DIV> <DIV CLASS="maincontentdiv"> Welcome To TPatel<BR>We Hope You Enjoy Our Site <?PHP if(!isset($changestyle)){ echo'<BR><BR>Please Choose A Style For The Site:<BR> <FORM ACTION="index.php" METHOD="POST"> <SELECT NAME="changestyle"> <OPTION>Blue</OPTION> <OPTION>Green</OPTION> <OPTION>Brown</OPTION> </SELECT> <INPUT TYPE="SUBMIT" VALUE="Change Style"> </FORM>'; exit; } $newstyle = $_POST['changestyle']; htmlentities($newstyle); if($newstyle == Blue) { setcookie("style", "blue", TIME()+3600); echo 'The Style Was Successfully Changed'; } elseif($newstyle == Green) { setcookie("style", "green", TIME()+3600); echo 'The Style Was Successfully Changed'; } elseif($newstyle == Brown) { setcookie("style", "brown", TIME()+3600); echo 'The Style Was Successfully Changed'; } else { echo 'The Style Could Not Be Changed'; } ?> </DIV> <?PHP INCLUDE("http://$host/footer.php"); ?>
Why Do I Get This Error When Submitting The Form
"Warning: Cannot modify header information - headers already sent by (output started at *****/header.php:10) in /home/www/*****/index.php on line 33"
-
Yh Thnx EveryOne
Err...How Foolish Of Me To Forget The ";"
Basic Stuff
-
Nice One
Thnx,
Tarun
-
Okay This Is My Code:
<?php $host = $_SERVER['HTTP_HOST']; ?> <?php INCLUDE("http://$host/header.php"); ?> <DIV CLASS="contentheaderdiv">Home</DIV> <DIV CLASS="maincontentdiv"> Welcome To TPatel<BR>We Hope You Enjoy Our Site <?php if(!isset($changestyle)){ echo'<BR><BR>Please Choose A Style For The Site:<BR> <FORM ACTION="index.php" METHOD="POST"> <SELECT NAME="changestyle"> <OPTION>Blue</OPTION> <OPTION>Green</OPTION> <OPTION>Brown</OPTION> </SELECT> </FORM>'; exit; } $newstyle = $_POST['changestyle']; htmlentities($newstyle) if($newstyle == Blue) { setcookie("style", "blue", TIME()+3600); echo 'The Style Was Successfully Changed' } elseif($newstyle == Green) { setcookie("style", "green", TIME()+3600); echo 'The Style Was Successfully Changed' } elseif($newstyle == Brown) { setcookie("style", "brown", TIME()+3600); echo 'The Style Was Successfully Changed' } else { echo 'The Style Could Not Be Changed' } ?> </DIV> <?php INCLUDE("http://$host/footer.php"); ?>
But Why Do I Get This Error:
"Parse error: parse error, unexpected T_IF in ****** on line 21"
(Obviously The Stars Are Just To Hide The Location Of The File)
Thnx,
Tarun
-
Thnx For Your Help
It Works Now!
Tarun
-
I Cant Find Exactly What's Wrong But
You Could Mayby Build It Around This
$filename = "text.txt";
$filecontent = "The Content Of The File"
$file_pointer1 = fopen("$filename", "w");
fwrite($file_pointer1, "$filecontent");
fclose($file_pointer1);
-
This Is My Basic Layout For My Guestbook
<CENTER> <DIV ALIGN="LEFT"><a href="mailto:">Tarun</a></DIV> <DIV ALIGN="RIGHT">10/02/07 | 14:08pm</DIV> <DIV ALIGN="LEFT">GUESTBOOK MSG</P> </CENTER>
But...
The Bit Where It Says "10/02/07 | 14:08pm" Is On A New Line
AnyHelp
Thnx,
Tarun
-
Thnx - AGAIN For Your Help
And For The Link
Tarun
-
I Had Help With This Yesturday And Now I Need Some More
This Is My Example Code
$friendList = array(); $friendList["Lisa"] = "offline"; $friendList["Jack"] = "online"; $friendList["Ryan"] = "offline"; $friendList["Rachel"] = "offline"; $friendList["Grace"] = "online"; foreach( $friendList as $key => $value){ echo "Friend: $key, Status: $value"; }
How Would I Change The Values (offline, online etc.)?
Thnx,
Tarun
-
WoW!
Thnx - All Your Help Was Greatly Appreciated
Tarun
-
Okay Heres My Code
$friendList; $friendList["Lisa"] = "offline"; $friendList["Jack"] = "online"; $friendList["Ryan"] = "offline"; $friendList["Rachel"] = "offline"; $friendList["Grace"] = "online"; foreach( $friendList as $key => $value){ echo "Friend: $key, Status: $value"; }
How Would I Add And Remove Friends?
Thnx,
Tarun
-
Also How Do You Create Directorys
Beacause Thats Something Ive Wanted To Know
But I Havent Got Round To It
Thnx,
Tarun
-
Personally, i like to have smaller php files that link to each other, like i have header.php, footer.php, menu.php. in this way, when i edit one php file, all the other pages get updated, and this saves both space and time when designing your pages.
but thats my opinion.
Ted
I Agree This Is A Much Easier Way Of Editing Content Like Navigation Menus
-
Ive Come Up With This
$newfile = "username/$username.php"; $file_pointer1 = fopen("$newfile", "a"); fwrite($file_pointer1, "content"); fclose($file_pointer1);
-
Well Ive Been Looking Around For You And Ive Found This:
Simple But Does The Job - And It Can Easily Be Changed To Suit Your Needs
Hope Ive Helped,
Tarun
<style> .error { color: red; display:none; } </style> <script> function checkForm() { user = document.getElementById("user").value; pass = document.getElementById("pass").value; if (user == "") { hideAllErrors(); document.getElementById("userError").style.display = "inline"; document.getElementById("user").select(); document.getElementById("user").focus(); return false; }else if (pass == "") { hideAllErrors(); document.getElementById("passError").style.display = "inline"; document.getElementById("pass").select(); document.getElementById("pass").focus(); return false; } return true; } function hideAllErrors() { document.getElementById("userError").style.display = "none" document.getElementById("passError").style.display = "none" } </script> <form onSubmit="return checkForm();" action='login.php' method='post'> Username: <input type='text' name='user'><br> <div class='error' id='userError'><br>Required: Please Enter Your Username<br></div><br> Password: <input type='password' name='pass'><br> <div class='error' id='passError'><br>Required: Please Enter Your Password<br></div><br> <input type='submit' name='submit'> </form>
-
Errmm Whats XHTML?
PM Thnx
Tarun
-
Wow Thank You
I Really Appreciate That
-
Try This
[code]<meta http-equiv=refresh content="3; url=http://www.msn.co.uk">[/code] -
I Need Some Help
I Want To Have A Different Page Title (<title>) Depending On The URL
Ive Got This But I Know That Its Wrong
<?PHP if $_SERVER['PHP_SELF'] == "index.php"{ echo "<title>HomePage</title>"; } if $_SERVER['PHP_SELF'] == "chat.php"{ echo "<title>ChatRoom</title>"; } else{ echo "<title>PageNotFound</title>" } ?>
Thnx
Tarun
-
Ok Thnx
But Could This Work
if $_SERVER['PHP_SELF'] == "index.php"{ echo "<title>HomePage</title>"; } else{ echo "<title>PageNotFound</title>" }
Just Remember Im A Bit Of A Newbie When It Comes To If and ElseIf
Tarun
-
Thnx Thats Great
Tarun
-
I Want Some Thing Like
Say If The Is index.php To Echo <TITLE>Tarun-Home</TITLE>
And If It Is chat.php To Echo <TITLE>Tarun-Chat</TITLE>
Im Not Sure How To Do It - Any Ideas?
Thnx
Tarun
-
Thnx For Your Help
BUT
Ive Discovered The Problem
My Bloody Free Web Host Decided To Disable include and file_get_contents In The Server Configuration
Thnx Alot www.110mb.com
Cannot modify header information
in PHP Coding Help
Posted
So Sorry
My Head Just Isnt Working Today
Thnx,
Tarun