-
Posts
2,527 -
Joined
-
Last visited
Posts posted by DeanWhitehouse
-
-
ok, i tried this , but it still does the same
<?php require_once 'includes/header.php'; require_once 'includes/db_connect.php'; ?><div class="bg"></div> <div class="clock"><?php echo gmdate('l, jS F Y');?> <span id="txt"></span></div> <div class="member"> <?php if ($_SESSION['is_valid'] == true){ if (isset($_GET['id'])) { if ((int) $_GET['id'] > 0) { $userid = $_GET['id']; $sql = "SELECT * FROM $user WHERE `user_id`='{$userid}' LIMIT 0,1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $userprofname = $row['user_name']; $profemail = $row['user_email']; echo "$userprofname<br>"; $show_email = $row['show_email']; if ($show_email == 1) { echo 'Email:<a href="mailto:'.$profemail.'"> Email Me</a>'; } elseif ($show_email == 0) { echo "Email: Hidden"; } exit(); } } //No ID passed to page, display user list: $query = "SELECT user_id, user_name FROM $user"; $result = mysql_query($query) or die("Error:" . mysql_error()); if (mysql_num_rows($result) < 1) { echo 'This ID does not exist in the database'; echo "<a href=\"members.php\">Return to Members</a>"; }if (mysql_num_rows($result) > 0) { echo "User List:<br />"; while ($row = mysql_fetch_assoc($result)) { echo '<a href="?id=' . $row['user_id'] . '">' . $row['user_name'] . '</a><br />'; } } } else { echo "Please login to view this page."; } ?> </div> <?php mysql_close(); require_once 'nav_bar.php'; require_once 'includes/footer.php'; ?>
-
yer, i think i understand, i can replace this
$email = "admin@randomgamedesign.uk.tt";
with
$email = "something_from_mydatabase_using_a_query";
-
i have this code for a members page,
and when someone enters an invalid URL with an id that doesn't exist it should echo a message, but it doesn't work, it just says email: hidden.
any ideas
<?php if ($_SESSION['is_valid'] == true){ if (isset($_GET['id'])) { if ((int) $_GET['id'] > 0) { $userid = $_GET['id']; $sql = "SELECT * FROM $user WHERE `user_id`='{$userid}' LIMIT 0,1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $userprofname = $row['user_name']; $profemail = $row['user_email']; echo "$userprofname<br>"; $show_email = $row['show_email']; if ($show_email == 1) { echo 'Email:<a href="mailto:'.$profemail.'"> Email Me</a>'; } elseif ($show_email == 0) { echo "Email: Hidden"; } exit(); } else { echo "Invalid user! <br />"; echo "<a href=\"members.php\">Return to Members</a>"; exit(); } } //No ID passed to page, display user list: $query = "SELECT user_id, user_name FROM $user"; $result = mysql_query($query) or die("Error:" . mysql_error()); if (mysql_num_rows($result) > 0) { echo "User List:<br />"; while ($row = mysql_fetch_assoc($result)) { echo '<a href="?id=' . $row['user_id'] . '">' . $row['user_name'] . '</a><br />'; } } } else { echo "Please login to view this page."; } ?>
-
near the same thing but this is for a user profile, it is so they don't recieve spam mail, but i can't see how to change
href='javascript:window.location="mai"+"lto:"+"admin"+"@"+"randomgamedesign.uk.tt";self.close();
so it is an email from my database.
-
this is a code i found in a template system
<span style="float: right; text-align: right;"><a target="_blank" rel="external" href='javascript:window.location="mai"+"lto:"+"admin"+"@"+"randomgamedesign.uk.tt";self.close();' onmouseover='window.status="mai"+"lto:"+"admin"+"@"+"randomgamedesign.uk.tt"; return true;' onmouseout='window.status="";return true;'>Email </a></span>
how can i use this code or something similar so you can only email them, and not see there email when you mouseover?
-
yer, that was a mistake, i have now got it at 30 but and still having the same error
-
ok, i tried the wordwrap code, and it doesn't seem to apply wrap to the second line.
$intro = "Welcome, this is a test of the sites features.Please go to the admin centre to cutomise the site.TEXTTEXTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT"; $welcome = wordwrap($intro, 60, "<br />\n"); <p class="welcome"><?php echo"$welcome"; ?></p>
-
you get this error
Parse error: syntax error, unexpected $end in /home/content/e/v/e/everkleen/html/testforum/forum/usrsignup.php on line 57
on this page
-
this is the site, you can see that it isn't working and what it is doing wrong.
http://deanwhitehouse.awardspace.co.uk/home.php
with ********* it does what you see on the page, and if i use words like "thisistext" it does work, why is this??
-
this is what i get showen when i sign-up.
i am not using a real email address, or am i using @ in the address, i am just using a word.
-
awardspace is good
-
i have a piece of text in a variable(which people can edit)
this text needs to be displayed down the page and should stay within the bounderies i set, but it isn't. here are some snippets from my code.
$intro = "Welcome, this is a test of the sites features.Please go to the admin centre to cutomise the site."; <p class="welcome"><?php echo"$intro"; ?></p>
p.welcome { color:#000; font-size:14px; text-align:center; margin-left:425px; margin-top:40px; width:400px; border:ridge #0000FF; }
-
thanks, i didn't even think of that.
The header still works,
-
how can i get the echo's to display below the form instead of above, will i need to postition using CSS??
<div class="login"> <?php if ($_SESSION['is_valid'] == false) { if (isset($_POST['login'])) { $user_name = mysql_real_escape_string($_POST["user_name"]); $user_password = mysql_real_escape_string($_POST["user_password"]); $cookiename = forumcookie; $verify_username = strlen($user_name); $verify_pass = strlen($user_password); if ($verify_pass > 0 && $verify_username > 0) { $userPswd = md5($user_password); $userpwsd = sha1($userPswd); $sql = "SELECT * FROM $user WHERE user_name='$user_name' AND user_password='$userpwsd' LIMIT 1;"; $result = mysql_query($sql) or die(mysql_error() . " in $sql"); if (mysql_num_rows($result) == 1) { $row = mysql_fetch_assoc($result); $s_userpass = serialize($userpass); $_SESSION['id_username'] = $row['user_name']; $_SESSION['id_user_password'] = $row['user_password']; $_SESSION['user_level'] = $row['userlevel']; $_SESSION['user_id'] = $row['user_id']; $_SESSION['is_valid'] = true; if (isset($_POST['remember'])) { $checked = "checked='checked'"; setcookie("uname", $_SESSION['id_username'], time() + 86400*100); setcookie("userpw", $user_password, time() + 86400*100); setcookie("check",$checked, time() + 86400*100); } header("Location:http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]); } else { echo "Login failed. Username or Password are not correct."; } } else { ?> <p><font style="font-size:small;">You left required field(s) blank</p> <?php } } $server = str_replace("?logout","",$_SERVER['PHP_SELF']); ?> <table class="log_in"><form action="<?php echo "$server"; ?>" method="post"> <th>Welcome</th> <tr><td align="center">Username:</td></tr><tr><td align="center"><input type="text" name="user_name" size="16" value="<?php echo $_COOKIE['uname']; ?>" /><br /></td></tr> <tr><td align="center">Password:</td></tr><tr><td align="center"> <input type="password" name="user_password" size="16" value="<?php echo $_COOKIE['userpw'] ?>" /><br /></td></tr> <tr><td align="center"><input type="hidden" name="login" value="true"><input type="submit" value="Submit"></td></tr> <tr><td align="centre"><input type="checkbox" name="remember" <?php echo $_COOKIE['check'] ?>> Remember Me </td></tr><tr><td align="center"><a href="register.php">[Register]</a></td></tr><tr><td align="center"><a href="forgot_password.php">[Forgot Password?]</a></td></tr></table> </form> </div> <?php mysql_close(); } } ?> </div>
-
I think i have coded this wrong , because when i submit the form and it echoes something the background above it moves down, this is my CSS
body { background-color:#FFFFFF; font-family:"Times New Roman", Times, serif; font-style:normal; color:#990000; } /*link styles*/ /******************************************************************/ /*Title Links*/ a.title:link:{color:#FF0000; text-decoration:none;} a.title:visited {color:#0000FF; text-decoration:none;} a.title:hover {color:#FFFF00; text-decoration:none;} a.title:active {color:#00FF33; text-decoration:none;} /*Nav Bar Links*/ a.nav_bar:link:{color: #000066; text-decoration:none;} a.nav_bar:visited {color: #00FF33; text-decoration:none;} a.nav_bar:hover {color: #FF0000; text-decoration:underline;} a.nav_bar:active {color: #FFFF00;} /*Table Styles*/ /******************************************************************/ /*Title Bar*/ table.title { width:800px; table-layout:auto; height:100px; margin-left:225px; color:#FF0000; border:ridge #0000FF; text-align:center; background-color:#000000; } /*Logged In Section*/ table.logged_in { } /*Forum Main Page*/ table.forum_main { background-color:#0000CC; width:900px; } /**/ table.admin { border:#0000FF; } /*Div Styles*/ /******************************************************************/ /*Left Menu*/ div.left_bar { width:150px; border:ridge #0000FF; margin-left:225px; margin-top:20px; } /*Navigation Bar*/ div.nav_bar { table-layout:auto; } /*Login Menu(Side Bar)*/ div.login { } /*Time*/ div.clock { margin-left:615px; margin-top:-302px; width:179px; } /*background area under title*/ div.bg { margin-left:225px; margin-top:1px; background:repeat-x #00FF33; width:794px; height:20px; border-left:ridge #0000FF; border-right:ridge #0000FF; border-bottom:ridge #0000FF; } /*P Styles*/ /******************************************************************/ /*File Exists*/ p.exists { color:#FF00FF; font-size:xx-large; } /*Welcome Message*/ p.welcome { color:#000; font-size:14px; text-align:center; margin-left:10px; margin-right:30px; margin-top:40px; width:400px; border:#666666 thin solid; height:auto; } /*Disclaimer(footer)*/ p.disclaimer { font-size:small; }
and this is my page, i have removed some of the PHP code,
<div class="bg"><div class="clock"><?php echo gmdate('l, jS F Y');?> <span id="txt"></span></div></div>
bg is the bit that moves,
this is the link to the page, please say if you need to see more code
http://deanwhitehouse.awardspace.co.uk/home.php
when you click submit, when the fields blank the echo moves the bit above.
-
i registered and got an error about the email and then when i logged in to the forum , it just says forum, nothing else
-
anyway, back to my question, it is appearing on a different line, why is this?
-
I would use sessions then check for the session on the page's you want protected
-
what i had tried was this
<script type="text/javascript"> function startTime() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); // add a zero in front of numbers<10 m=checkTime(m); document.getElementById('txt').innerHTML=h+":"+m+"; t=setTimeout('startTime()',500); } function checkTime(i) { if (i<10) { i="0" + i; } return i; } </script>
-
how am i lazy if i don't no how to do something???
as i did try changing it but i changed it wrong.
Also this is dislaying on a second line, the code to display it, is this
<?php echo gmdate('l, jS F Y');?><div id="txt"></div>
-
I need a clock code that just shows hours and minutes and always updates,
e.g
you shouldn't need to refresh to show the current time.
I was given this code a while ago
<script type="text/javascript"> function startTime() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); // add a zero in front of numbers<10 m=checkTime(m); s=checkTime(s); document.getElementById('txt').innerHTML=h+":"+m+":"+s; t=setTimeout('startTime()',500); } function checkTime(i) { if (i<10) { i="0" + i; } return i; } </script>
but this shows seconds, and i don't no how to change it.
-
thanks, that worked
-
because it's ment to refer the user to the home page, and it is for a CMS so it has to be to there host.
BTW i can follow directions, i just decide not to follow bad ones, as i thought your code done the same as mine
-
i tried this
$url = $_SERVER['HTTP_HOST']; $log_out = $_SERVER['HTTP_HOST']."?logout"; $logout = str_replace($log_out,"",$url); header("Location:".$logout);
but this does this
[SOLVED] members page
in PHP Coding Help
Posted
ok, so it is now working with this code,
but it is still showing the Email: Hidden