dennismonsewicz
Members-
Posts
1,136 -
Joined
-
Last visited
Everything posted by dennismonsewicz
-
[SOLVED] stripping out slashes, dashes and parens!
dennismonsewicz replied to croakingtoad's topic in PHP Coding Help
look here for some great tutorials http://www.tizag.com/phpT/ -
Funny story... I did a hard refresh and the content loaded into the textarea very wierd
-
bump
-
$id = $_GET['id']; $query = mysql_query("SELECT * FROM issues WHERE ezine_id = '$id'") or die("ERROR: " . mysql_error()); $row = mysql_fetch_array($query);
-
$allowedTags='<p><strong><em><u><h1><h2><h3><h4><h5><h6><img>'; $allowedTags.='<li><ol><ul><br><ins><del>'; $sContent = strip_tags(stripslashes($row['welcome']),$allowedTags); echo "<div class='editor' style='text-align: center'>"; echo "<p class='editortitle' style='font-size: 175%; padding: 4px 0px 4px 0px; margin: 0px;'>Welcome Letter</p> <textarea cols='80' rows='25' name='welcome'>" . $sContent . "</textarea>"; echo "</div>";
-
I just echoed $row['welcome'] and it retrieved the file out of the database
-
that didn't work what does the ENT_QUOTES do?
-
yeah, i don't understand why its not loading. Everywhere I have looked (using google) suggests exactly what I am doing. Now I am using tinymce to handle my textareas but that shouldn't matter
-
yes they are closed. and I tried your code and it didn't work and your code should've been this: <?php echo $row['welcome'];?>
-
<p> and <font>
-
echo "<div class='editor' style='text-align: center'>"; echo "<p class='editortitle' style='font-size: 175%; padding: 4px 0px 4px 0px; margin: 0px;'>Welcome Letter</p> <textarea cols='80' rows='25' name='welcome'>" . $row['welcome'] . "</textarea>"; echo "</div>"; The following code above should work right? In the database there is html tags, could this cause the content to not load?
-
when i tell it to echo out the statement i get the following: Doctors said antipsychotic drugs don''t help Alzheimer''s patients...
-
I am writing a CMS for creating email blasts and when it comes to the editing part I get the following problem: echo "<div class='editor'>"; echo "<p class='editortitle' style='padding: 4px 0px 4px 0px; margin: 0px;'>Bookmark Link One</p> <input type='text' name='story_one' style='margin-bottom: 15px; width: 400px;' value='" . $row['story_one'] . "'/>"; echo "<p class='editortitle' style='padding: 4px 0px 4px 0px; margin: 0px;'>Bookmark Link Two</p> <input type='text' name='story_two' style='margin-bottom: 15px; width: 400px;' value='" . $row['story_two'] . "'/>"; echo "<p class='editortitle' style='padding: 4px 0px 4px 0px; margin: 0px;'>Bookmark Link Three</p> <input type='text' name='story_three' style='margin-bottom: 15px; width: 400px;' value='" . $row['story_three'] . "'/>"; echo "<p class='editortitle' style='padding: 4px 0px 4px 0px; margin: 0px;'>Bookmark Link Four</p> <input type='text' name='story_four' style='margin-bottom: 15px; width: 400px;' value='" . $row['story_four'] . "'/>"; echo "</div>"; in the browser story_one, three, and four display all the way but not two. It cuts off at the word don't, but it only displays don not with the 't and in my database it is setup for text. Any ideas?
-
I am wanting to have a select drop down list that is hard coded. But I would like for it to select the month that is current to the server. So when a user comes across the page the month that is selected in the list is the current month! Make sense? Any ideas?
-
thanks I am going to give it a shot
-
when setting up a database field to house text and HTML tags, what is the best setting for that field? IE. VARCHAR, text, blob
-
[SOLVED] sessions working improperly
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
ok i fixed my session problem, now i have a new problem session_start(); if($_POST["username"]) { //If the form has been submitted include "includes/sql.php"; $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); $sql = "select * from users where username = '$username' and password = '$password'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count == 1) { $_SESSION["username"] = $username; $_SESSION["password"] = $password; header("location: URL_GOES_HERE?username=" . $_SESSION['username'] . ""); if($_SESSION['username']) { $sqlcount = "select COUNT(username) from uploads where username = '" . $_SESSION['username'] . "'"; $result = mysql_query($sqlcount)or die(mysql_error()); $downloadcount = "select COUNT(username) from downloaded_images where username = '" . $_SESSION['username'] . "'"; $downloadresult = mysql_query($downloadcount)or die(mysql_error()); $downloadrow = mysql_fetch_array($downloadresult); $download_count = $downloadrow['COUNT(username)']; while($row = mysql_fetch_array($result)) { $upload_count = $row['COUNT(username)']; echo '<div class="login"> <p style="text-align: center;">Welcome, ' . ucwords($_SESSION['username']) . '</p> <p><a href="includes/logout.php">Logout?</a></p> <p><a href="index.php?username=' . $_SESSION['username'] . '">Home</a></p> <p><a href="myphotos.php?username=' . $_SESSION['username'] . '">My Photos (' . $upload_count . ')</a></p> <p><a href="mydownloads.php?username=' . $_SESSION['username'] . '">My Downloads (' . $download_count . ')</a></p> <p><a href="upload.php?username=' . $_SESSION['username'] . '">Upload An Image</a></p> <p><a href="change_password.php?username=' . $_SESSION['username'] . '&action=view">Change Password?</a></p> <div class="loginfooter" style="clear: both;"> </div> </div>'; } } } else { header("loaction: URL_GOES_HERE.php"); } } else { //User isn't logged in and therefore User must login before proceding echo '<div class="login"> <p>Please Login to Utilize Your Account</p> <form action="index.php" method="post" name="loginform"> <p style="text-align: left; padding-left: 11px;">Username:</p> <input type="text" id="username" name="username" /> <p style="text-align: left; padding-left: 11px;">Password:</p> <input type="password" id="password" name="password" style="clear: right;" /> <input type="image" src="images/loginbutton.jpg" style="width: 66px; height: 33px; float: right; margin-right: 7px;" name="login" /> </form> <div class="loginfooter" style="clear: both;"> </div> </div>'; } the login form keeps redisplaying and the control panel does not display. The form is in the last else statement. Any help? -
[SOLVED] sessions working improperly
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
<?php session_start(); if($_POST['username']) { //If the form has been submitted include "sql.php"; $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); $sql = "select * from users where username = " . $username . " and password = " . $password . ""; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count == 1) { $_SESSION["username"] = $username; $_SESSION["password"] = $password; header("location: http://intranet.healthresources.net/hrstock/index.php?username=" . $_SESSION['username'] . ""); } $sqlcount = "select COUNT(username) from uploads where username = '" . $_SESSION['username'] . "'"; $result = mysql_query($sqlcount)or die(mysql_error()); $downloadcount = "select COUNT(username) from downloaded_images where username = '" . $_SESSION['username'] . "'"; $downloadresult = mysql_query($downloadcount)or die(mysql_error()); $downloadrow = mysql_fetch_array($downloadresult); $download_count = $downloadrow['COUNT(username)']; while($row = mysql_fetch_array($result)) { $upload_count = $row['COUNT(username)']; echo '<div class="login"> <p style="text-align: center;">Welcome, ' . ucwords($_SESSION['username']) . '</p> <p><a href="includes/logout.php">Logout?</a></p> <p><a href="index.php?username=' . $_SESSION['username'] . '">Home</a></p> <p><a href="myphotos.php?username=' . $_SESSION['username'] . '">My Photos (' . $upload_count . ')</a></p> <p><a href="mydownloads.php?username=' . $_SESSION['username'] . '">My Downloads (' . $download_count . ')</a></p> <p><a href="upload.php?username=' . $_SESSION['username'] . '">Upload An Image</a></p> <p><a href="change_password.php?username=' . $_SESSION['username'] . '&action=view">Change Password?</a></p> <div class="loginfooter" style="clear: both;"> </div> </div>'; } } else { //User isn't logged in and therefore User must login before proceding echo '<div class="login"> <p>Please Login to Utilize Your Account</p> <form action="index.php" method="post" name="loginform"> <p style="text-align: left; padding-left: 11px;">Username:</p> <input type="text" id="username" name="username" /> <p style="text-align: left; padding-left: 11px;">Password:</p> <input type="password" id="password" name="password" style="clear: right;" /> <input type="image" src="images/loginbutton.jpg" style="width: 66px; height: 33px; float: right; margin-right: 7px;" name="login" /> </form> <div class="loginfooter" style="clear: both;"> </div> </div>'; } ?> in the php.ini file what would i look for, to see about a session path? -
[SOLVED] sessions working improperly
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
that didn't work -
session_start(); if($_POST['username']) { //If the form has been submitted include "sql.php"; $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); $sql = "select * from tbl_name where username = " . $username . " and password = " . $password . ""; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count == 1) { session_register("username"); session_register("password"); header("location: URL_GOES_HERE?username=" . $_SESSION['username'] . ""); } $sqlcount = "select COUNT(username) from tbl_name where username = '" . $_SESSION['username'] . "'"; $result = mysql_query($sqlcount)or die(mysql_error()); $downloadcount = "select COUNT(username) from tbl_name where username = '" . $_SESSION['username'] . "'"; $downloadresult = mysql_query($downloadcount)or die(mysql_error()); $downloadrow = mysql_fetch_array($downloadresult); $download_count = $downloadrow['COUNT(username)']; while($row = mysql_fetch_array($result)) { $upload_count = $row['COUNT(username)']; echo '<div class="login"> <p style="text-align: center;">Welcome, ' . ucwords($_SESSION['username']) . '</p> <p><a href="includes/logout.php">Logout?</a></p> <p><a href="index.php?username=' . $_SESSION['username'] . '">Home</a></p> <p><a href="myphotos.php?username=' . $_SESSION['username'] . '">My Photos (' . $upload_count . ')</a></p> <p><a href="mydownloads.php?username=' . $_SESSION['username'] . '">My Downloads (' . $download_count . ')</a></p> <p><a href="upload.php?username=' . $_SESSION['username'] . '">Upload An Image</a></p> <p><a href="change_password.php?username=' . $_SESSION['username'] . '&action=view">Change Password?</a></p> <div class="loginfooter" style="clear: both;"> </div> </div>'; } } else { //User isn't logged in and therefore User must login before proceding echo '<div class="login"> <p>Please Login to Utilize Your Account</p> <form action="index.php" method="post" name="loginform"> <p style="text-align: left; padding-left: 11px;">Username:</p> <input type="text" id="username" name="username" /> <p style="text-align: left; padding-left: 11px;">Password:</p> <input type="password" id="password" name="password" style="clear: right;" /> <input type="image" src="images/loginbutton.jpg" style="width: 66px; height: 33px; float: right; margin-right: 7px;" name="login" /> </form> <div class="loginfooter" style="clear: both;"> </div> </div>'; } Ok so heres my problem, The above code does not pass the username to the header and the session starts but there is no username that gets registered! any ideas?
-
[SOLVED] if no update do insert
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
can you give me an example? -
I need a way to insert a value into a DB table if the value does not exist if it does then update. Any help?
-
problem with adding seasion information in mysql query
dennismonsewicz replied to gli's topic in PHP Coding Help
did this work? -
[SOLVED] IE problem but not in Firefox
dennismonsewicz replied to Asheeown's topic in PHP Coding Help
Ah you learn something new everyday! And yes it should be Saturday everyday indeed! -
Can php trigger another php script?
dennismonsewicz replied to bobinindia's topic in PHP Coding Help
try looking through this http://de2.php.net/manual/en/function.set-time-limit.php