john010117
Members-
Posts
492 -
Joined
-
Last visited
Never
Everything posted by john010117
-
Google is your friend.
-
Oh shoot. I forgot to change some variables. Sorry. <?php $tbl_name2="members"; $myusername=$_SESSION['myusername']; $mydn="SELECT displayname FROM $tbl_name2 WHERE username = '$myusername'"; $mydisplayname=mysql_query($mydn); if (mysql_num_rows($mydisplayname)>0) { while ($row = mysql_fetch_assoc($mydisplayname)) { extract($row); if(session_is_registered(myusername)){ echo "Welcome ".$mydisplayname." | <a href='logout.php'>Logout</a>"; } else { echo "<a href='login.php'>Login</a> | <a href='register.php'>Register</a>"; } } } ?>
-
$query = "SELECT * FROM bl_admin ORDER BY adminid ASC"; I don't know if this is what you wanted....
-
Website where users can submit their own text
john010117 replied to keskin's topic in PHP Coding Help
Google is your friend. -
So what you're telling us is that adminid is in a different table?
-
Try this: <?php $tbl_name2="members"; $myusername=$_SESSION['myusername']; $mydn="SELECT displayname FROM $tbl_name2 WHERE username = '$myusername'"; $mydisplayname=mysql_query($mydn); if (mysql_num_rows($mydisplayname)>0) { while ($row = mysql_fetch_assoc($result)) { extract($row); if(session_is_registered(myusername)){ echo "Welcome ".$mydisplayname." | <a href='logout.php'>Logout</a>"; } else { echo "<a href='login.php'>Login</a> | <a href='register.php'>Register</a>"; } } } ?>
-
Are you with a host? Because I think the problem is on their end. Just check to see that you have the right conection info (host, db username, db password, db name).
-
geotargeting code, pls help improve security
john010117 replied to ddany24's topic in PHP Coding Help
Hello, ddany24. As you might have realized, we only speak English here. Either post your question in english, or look for other website(s) that speak your language. -
<?php $host = "localhost"; $user = "user"; $pass = "pass"; $dbname = "user"; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $query = "SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` > '20070228'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan')"; echo $query; $result= mysql_query($query); $num_results = mysql_num_rows($result); $row= mysql_fetch_assoc($result); mysql_free_result($result); echo $result ?>
-
If you're gong with Javascript, I can't help you. I'm mainly a PHP freak.
-
We should make a sticky describing the differences between tables and CSS, so that next time a person asks, you could just post a link to the sticky. That'll save you a lot of trouble.
-
<?php if (!isset($_COOKIE['***'])) { die("Do you belong here? I do not recognize you! I want cookies! Make sure your browser accepts cookies!<br><a href='../home.php'>Away From Here!</a>"); } $conn = mysql_connect("localhost", "***", "***") OR DIE (mysql_error()); @mysql_select_db ("databox", $conn) OR DIE (mysql_error()); if ($_POST) { $location = $_POST["location"]; $date = $_POST["date"]; $venue = $_POST["venue"]; $sql = "INSERT INTO `schedule` (location, date, venue) VALUES ('{$location}', '{$date}', '{$venue}')"; @mysql_query ($sql, $conn); Header("Location:".$_SERVER["PHP_SELF"]); } // Do this process of user has click a file name to view or remove if ($_GET) { $iid = $_GET["iid"]; $act = $_GET["act"]; switch ($act) { case rem: $sql = "DELETE FROM schedule WHERE id='$iid'"; @mysql_query ($sql, $conn); Header("Location:./sched_index.php"); exit(); break; default: break; } }?> <html> <body> <a href='../maintaindir.php'>Return to Maintain Headquarters</a><br> <a href='../home.php'>Return Home</a> <FORM name="formcheck" method="post" enctype="multipart/form-data" onsubmit="return formCheck(this);"> <center><font size=6>Schedule Update</font><hr><br> <table> <P> <tr><td> <LABEL for="name">Location (ex. Omaha, NE): </LABEL></td> <td><INPUT type="text" name="location" size="20"></td> </tr> <tr> <td> <LABEL for="name">Date (ex. April 26): </LABEL></td><td> <INPUT type="text" name="date" size="20"></td> </tr> <tr><td><LABEL for="name">Venue (ex. Downtown Boxing): </LABEL></td><td><INPUT type="text" name="venue" size="30"></td> </tr> <tr><td></td><td> <input type="submit" value="submit"></td></tr> </form></table> <?php echo "<br><br>These is the current schedule<br><hr><br>"; $sql3 = "SELECT * FROM schedule ORDER BY id asc"; $result3 = mysql_query ($sql3, $conn); if (mysql_num_rows($result3)>0) { while ($row = mysql_fetch_array($result3, MYSQL_ASSOC)) { $ic++; $str3 .= $ic.". "; $str3 .= "<a href=\"sched_index.php?iid=".$row["id"]."&tbl=schedule\">".$row["location"]."</a> "; $str3 .= "[".$row["date"]."] "; $str3 .= "[".$row["venue"]."]<br> "; $str3 .= "[<a href=\"sched_index.php?act=rem&iid=".$row["id"]."&tbl=schedule\">REMOVE</a>]<br><br>"; } print $str3; } mysql_free_result ($result3);?></body> </html> I cleaned up some mistakes. Also, try not to use short-hand tags.
-
What is $rel_path?
-
...so what's your problem? Read more about sessions here
-
Make sure to define the variables also.
-
Help with a php Admin CP with various access levels
john010117 replied to Starfox's topic in PHP Coding Help
I don't know if it's a coincidence or not, but right now, I'm designing an Admin CP for my website too. Anyways, to store a password that has been hashed (md5): $password = $_POST['password']; $password = md5($password); ... and just use the $password variable when inserting it into a database. Same thing goes with checking to see if a password a user entered matches the hashed version of the password stored in the database, except you'll need one more variable. md5 is just another function. Read more about it here Sessions -
You could do an if/else statement.
-
Right. Why didn't I think of that? I was only thinking of POST. Thanks.
-
Ok people. Let's settle down and get back on topic. Don't let a fight break out.
-
Whoops. Double post. My post
-
If trying that with PHP, make sure your server has PHP enabled.
-
How about: <input type="text" name="tsdate" value="" id="data" size="12" readonly="readonly"> ?
-
Aside from forgetting to put in the # before the color codes, why did you link to an image for a background color?
-
Mind if I join the "discussion"? I agree with both of you that CSS should be used on a normal page. I also agree that tables are for tabular data ONLY. That being said, the diagram shown to us looks like a profile of some sort (like MySpace). When I viewed the source of a random MySpace page, it showed that they primarily used divs. Now, I'm not saying MySpace is the only example of profiles. But logically thinking, the world's most-visited profile site uses CSS. So, in my opinion, a profile should be considered as a "normal page". But let me emphasize that there is no right solution. Feel free to use tables or CSS. But please post this in the freelancing section if you want somebody else to do it for you.
-
I don't really get what you're saying... So for your first question, you want the "Thank You message" in a textarea? Why did you mark it as "hidden" in the first place? <textarea name="item_number">Thank you for your generous donation. Your donation will be used to pay for our ever increasing bandwidth costs, our hosting Se</textarea> But your second question makes no sense to me. Care to elaborate?