Search Results

Search found 12 results on 1 pages for 'thatmaclad'.

Page 1/1 | 1 

  • Space Stuck between two Div Tags

    - by thatmaclad
    I've been working on a small blog form but have been having trouble with my Div tags. Whenever I create a second div tag to hold the Form a space has appeared between it and the previous Div tag. Is there anything wrong with my CSS? body { background-image: url(../images/body-bg.jpg); font-family: arial; } #header { background-image: url(../images/new-post-h.png); background-repeat: no-repeat; height: 124px; width: 850px; color: #ffffff; margin: 0em 0px; } #form-bg { background-image: url(../images/new-post-b.png); background-repeat: no-repeat; height: 500px; width: 850px; padding: 8px; margin: 0em 0px; } #new-form { height: 624px; width: 850; margin-left: auto; margin-right: auto; } Here is what keeps on happening: http://i40.tinypic.com/j623i8.jpg

    Read the article

  • Text not Being Placed Correctly In the Center

    - by ThatMacLad
    This is another noobish mistake from me but I've placed some text in my page but after adding some padding to my div tag it's impossible for me to place my Text in the vertical center. Here is a preview of my problem: The CSS: body { background-image: url(../images/body-bg.jpg); font-family: arial; } .cms-head { background-image: url(../images/cms-head.png); background-repeat: no-repeat; width: 850px; height: 50px; padding: 5px; margin-bottom: -10px; } .posts-list { background-image: url(../images/new-post-b.png);; width: 840px; height: 500px; padding: 5px; border-bottom: 1px solid #000000; } .content { width: 850px; height: 500px; margin-left: auto; margin-right: auto; } .edit-post-but { background-image: url(../images/new-button.png); background-repeat: no-repeat; width: 60px; height: 40px; } .post-title { width: 834px; height: 40px; background-image: url(../images/post-head.png); background-repeat: no-repeat; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin-left: auto; margin-right: auto; padding: 5px; font-size: 20px; color: #ffffff; } .bottom { width: 850px; height: 50px; background-image: url(../images/cms-bot.png); background-repeat: no-repeat; } a:active, a:link, a:visited{ color: #ffffff; } a:hover{ text-decoration:none; } The HTML/PHP: <html> <head> <title>Blog Name | Edit Post</title> <link rel="stylesheet" href="css/cms.css" type="text/css" /> </head> <body> <div class="content"> <div class="cms-head"> <a href="newpost.php"><img src="images/new-button.png" /></a> <a href="#"><img src="images/rss-button.png" /></a> </div> <div class="posts-list"> <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $result = mysql_query("SELECT timestamp, id, title FROM php_blog ORDER BY id DESC"); while($row = mysql_fetch_array($result)) { $date = date("l F d Y",$row['timestamp']); $id = $row['id']; $title = strip_tags(stripslashes($row['title'])); if (mb_strlen($title) >= 50) { $title = substr($title, 0, 50); $title = $title . "..."; } print("<div class='post-title'><a href=\"update.php?id=" . $id . "\"><img src='images/edit-button.png'></a>$title<br /></div>"); } mysql_close(); ?> </div> <div class="bottom"></div> </div> </body> </html>

    Read the article

  • Unnecessary Error Message Being Displayed

    - by ThatMacLad
    I've set up a form to update my blog and it was working fine up until about this morning. It keeps on turning up with an Invalid Entry ID error on the edit post page when I click the update button despite the fact that it updates the homepage. All help is seriously appreciated. <html> <head> <title>Ultan's Blog | New Post</title> <link rel="stylesheet" href="css/editpost.css" type="text/css" /> </head> <body> <div class="new-form"> <div class="header"> </div> <div class="form-bg"> <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); if (isset($_POST['update'])) { $id = htmlspecialchars(strip_tags($_POST['id'])); $month = htmlspecialchars(strip_tags($_POST['month'])); $date = htmlspecialchars(strip_tags($_POST['date'])); $year = htmlspecialchars(strip_tags($_POST['year'])); $time = htmlspecialchars(strip_tags($_POST['time'])); $entry = $_POST['entry']; $title = htmlspecialchars(strip_tags($_POST['title'])); if (isset($_POST['password'])) $password = htmlspecialchars(strip_tags($_POST['password'])); else $password = ""; $entry = nl2br($entry); if (!get_magic_quotes_gpc()) { $title = addslashes($title); $entry = addslashes($entry); } $timestamp = strtotime ($month . " " . $date . " " . $year . " " . $time); $result = mysql_query("UPDATE php_blog SET timestamp='$timestamp', title='$title', entry='$entry', password='$password' WHERE id='$id' LIMIT 1") or print ("Can't update entry.<br />" . mysql_error()); header("Location: post.php?id=" . $id); } if (isset($_POST['delete'])) { $id = (int)$_POST['id']; $result = mysql_query("DELETE FROM php_blog WHERE id='$id'") or print ("Can't delete entry.<br />" . mysql_error()); if ($result != false) { print "The entry has been successfully deleted from the database."; exit; } } if (!isset($_GET['id']) || empty($_GET['id']) || !is_numeric($_GET['id'])) { die("Invalid entry ID."); } else { $id = (int)$_GET['id']; } $result = mysql_query ("SELECT * FROM php_blog WHERE id='$id'") or print ("Can't select entry.<br />" . $sql . "<br />" . mysql_error()); while ($row = mysql_fetch_array($result)) { $old_timestamp = $row['timestamp']; $old_title = stripslashes($row['title']); $old_entry = stripslashes($row['entry']); $old_password = $row['password']; $old_title = str_replace('"','\'',$old_title); $old_entry = str_replace('<br />', '', $old_entry); $old_month = date("F",$old_timestamp); $old_date = date("d",$old_timestamp); $old_year = date("Y",$old_timestamp); $old_time = date("H:i",$old_timestamp); } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><input type="hidden" name="id" value="<?php echo $id; ?>" /> <strong><label for="month">Date (month, day, year):</label></strong> <select name="month" id="month"> <option value="<?php echo $old_month; ?>"><?php echo $old_month; ?></option> <option value="January">January</option> <option value="February">February</option> <option value="March">March</option> <option value="April">April</option> <option value="May">May</option> <option value="June">June</option> <option value="July">July</option> <option value="August">August</option> <option value="September">September</option> <option value="October">October</option> <option value="November">November</option> <option value="December">December</option> </select> <input type="text" name="date" id="date" size="2" value="<?php echo $old_date; ?>" /> <select name="year" id="year"> <option value="<?php echo $old_year; ?>"><?php echo $old_year; ?></option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </select> <strong><label for="time">Time:</label></strong> <input type="text" name="time" id="time" size="5" value="<?php echo $old_time; ?>" /></p> <p><strong><label for="title">Title:</label></strong> <input type="text" name="title" id="title" value="<?php echo $old_title; ?>" size="40" /> </p> <p><strong><label for="password">Password protect?</label></strong> <input type="checkbox" name="password" id="password" value="1"<?php if($old_password == 1) echo " checked=\"checked\""; ?> /></p> <p><textarea cols="80" rows="20" name="entry" id="entry"><?php echo $old_entry; ?></textarea></p> <p><input type="submit" name="update" id="update" value="Update"></p> </form> <p><strong>Be absolutely sure that this is the post that you wish to remove from the blog!</strong><br /> </p> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="hidden" name="id" id="id" value="<?php echo $id; ?>" /> <input type="submit" name="delete" id="delete" value="Delete" /> </form> </div> </div> </div> <div class="bottom"></div> </body> </html>

    Read the article

  • Displaying unnecessary HTML when showing content from MySQL database.

    - by ThatMacLad
    My homepage pulls in content from my MySQL database to create a blog. I've got it so that it only displays an extract from the posts. For some reason it displays HTML tags as well rather than formatting it using the tags (See picture below). Any help is appreciated. Homepage: <html> <head> <title>Ultan Casey | Homepage</title> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <div class="wrapper"> <div id="upperbar"> <a href="#">Home</a> <a href="#">About Me</a> <a href="#">Contact Me</a> <a href="http://www.twitter.com/UltanKC">Twitter</a> <form id="search-form" action="/search" method="get"> <input type="text" id="textarea" size="33" name="q" value=""/> <input type="submit" id="submit" value="Search"/> </form> </div> <div id="banner"> <img src="images/banner.jpg"> </div> <div class="sidebar"></div> <div class="posts"> <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $sql = "SELECT * FROM php_blog ORDER BY timestamp DESC LIMIT 5"; $result = mysql_query($sql) or print ("Can't select entries from table php_blog.<br />" . $sql . "<br />" . mysql_error()); while($row = mysql_fetch_array($result)) { $date = date("l F d Y", $row['timestamp']); $title = stripslashes($row['title']); $entry = stripslashes($row['entry']); $id = $row['id']; ?> <?php echo "<p id='title'><strong><a href=\"post.php?id=". $id . "\">" . $title . "</a></strong></p>"; ?><br /> <div class="post-thumb"><img src="thumbs/<?php echo $id ?>.png"></div> <?php echo htmlspecialchars(substr($entry, 0, 1050)) ?>... <br> <hr><br /> Posted on <?php echo $date; ?> </p> </div> </div> </p <?php } ?> </div> </div> </div> </body> </html> Image:

    Read the article

  • Styling an If Else Statement

    - by ThatMacLad
    I know that it's not possible to style any given PHP but I do know that it is possible to style the output HTML that the PHP provides you with. I was wondering if there was any method available for me to use that would enable me to style the output from my IF ELSE statement. if ($result != false) { print "Your entry has successfully been entered into the blog."; }

    Read the article

  • Linking Post Title to Specific Page ID

    - by ThatMacLad
    I've created a form to update my websites homepage with content but I wanted to know how I could set it up so that a posts title links to a specific post ID. I'd also like to add a Read More link that directs anybody reading the blog to the correct post. Here is my PHP code: <html> <head> <title>Blog Name</title> </head> <body> <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $sql = "SELECT * FROM php_blog ORDER BY timestamp DESC LIMIT 5"; $result = mysql_query($sql) or print ("Can't select entries from table php_blog.<br />" . $sql . "<br />" . mysql_error()); while($row = mysql_fetch_array($result)) { $date = date("l F d Y", $row['timestamp']); $title = stripslashes($row['title']); $entry = stripslashes($row['entry']); $password = $row['password']; $id = $row['id']; if ($password == 1) { echo "<p><strong>" . $title . "</strong></p>"; printf("<p>This is a password protected entry. If you have a password, log in below.</p>"); printf("<form method=\"post\" action=\"post.php?id=%s\"><p><strong><label for=\"username\">Username:</label></strong><br /><input type=\"text\" name=\"username\" id=\"username\" /></p><p><strong><label for=\"pass\">Password:</label></strong><br /><input type=\"password\" name=\"pass\" id=\"pass\" /></p><p><input type=\"submit\" name=\"submit\" id=\"submit\" value=\"submit\" /></p></form>",$id); print "<hr />"; } else { ?> <p><strong><?php echo $title; ?></strong><br /><br /> <?php echo $entry; ?><br /><br /> Posted on <?php echo $date; ?> <hr /></p> <?php } } ?> </body> </html> Thanks for any help. I really appreciate any input!

    Read the article

  • Entering Content Into A MySQL Database Via A Form

    - by ThatMacLad
    I've been working on creating a form that submits content into my database but I decided that rather than using a drop down menu to select the date I'd rather use a textfield. I was wondering what changes I will need to make to my table creation file. <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $sql = "CREATE TABLE php_blog ( id int(20) NOT NULL auto_increment, timestamp int(20) NOT NULL, title varchar(255) NOT NULL, entry longtext NOT NULL, PRIMARY KEY (id) )"; $result = mysql_query($sql) or print ("Can't create the table 'php_blog' in the database.<br />" . $sql . "<br />" . mysql_error()); mysql_close(); if ($result != false) { echo "Table 'php_blog' was successfully created."; } ?> It's the timestamp that I need to edit to enter in via a textfield. The Title and Entry are currently being entered via that method anyway.

    Read the article

  • Form Submitting Incorrect Information to MySQL Database

    - by ThatMacLad
    I've created a form that submits data to a MySQL database but the Date, Time, Year and Month fields constantly revert to the exact same date (1st January 1970) despite the fact that when I submit the information to the database the form displays the current date, time etc to me. I've already set it so that the time and date fields automatically display the current time and date. Could someone please help me with this. Form: <html> <head> <title>Blog | New Post</title> <link rel="stylesheet" href="css/newposts.css" type="text/css" /> </head> <body> <div class="new-form"> <div class="header"> <a href="edit.php"><img src="images/edit-home-button.png"></a> </div> <div class="form-bg"> <?php if (isset($_POST['submit'])) { $month = htmlspecialchars(strip_tags($_POST['month'])); $date = htmlspecialchars(strip_tags($_POST['date'])); $year = htmlspecialchars(strip_tags($_POST['year'])); $time = htmlspecialchars(strip_tags($_POST['time'])); $title = htmlspecialchars(strip_tags($_POST['title'])); $entry = $_POST['entry']; $timestamp = strtotime($month . " " . $date . " " . $year . " " . $time); $entry = nl2br($entry); if (!get_magic_quotes_gpc()) { $title = addslashes($title); $entry = addslashes($entry); } mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $sql = "INSERT INTO php_blog (timestamp,title,entry) VALUES ('$timestamp','$title','$entry')"; $result = mysql_query($sql) or print("Can't insert into table php_blog.<br />" . $sql . "<br />" . mysql_error()); if ($result != false) { print "<p class=\"success\">Your entry has successfully been entered into the blog. </p>"; } mysql_close(); } ?> <?php $current_month = date("F"); $current_date = date("d"); $current_year = date("Y"); $current_time = date("H:i"); ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input class="field" type="text" name="date" id="date" size="2" value="<?php echo $current_month; ?>" /> <input class="field" type="text" name="date" id="date" size="2" value="<?php echo $current_date; ?>" /> <input class="field" type="text" name="date" id="date" size="2" value="<?php echo $current_year; ?>" /> <input type="text" name="time" id="time" size="5"value="<?php echo $current_time; ?>" /> <input class="field2" type="text" id="title" value="Title Goes Here." name="title" size="40" /> <textarea class="textarea" cols="80" rows="20" name="entry" id="entry" class="field2"></textarea> <input class="field" type="submit" name="submit" id="submit" value="Submit"> </form> </div> </div> </div> <div class="bottom"></div> </body> </html>

    Read the article

  • How Can I Move the Web Browsers Scrollbar and Style It (CSS)?

    - by ThatMacLad
    Upon visiting the site that I'm currently working on you would immediately notice the fact that a bar placed at the top of your browser follows you down as you scroll through the blogs posts. I was wondering if there was any method which I could use to both shift the scrollbar below the bar rather than beside it and then style the bar to suit the sites style. Image:

    Read the article

  • How Can I Create A Featured Content Area?

    - by ThatMacLad
    I'm working on a blog and I'd love to create a homepage with a featured post image area. I'd like it to switch between 2-3 of the latest posts images. I was wondering how I would go about doing this but so that I also have a form to update it rather than constantly editing my code.

    Read the article

  • How can I Display an extract from MySQL database entry?

    - by ThatMacLad
    I'm after creating a webpage that includes a blog section and it currently displays the whole post on the homepage. I'd like to set it so that it only displays a certain part of the entry i.e 50 words. I'd then like to be able to set it so that I have a read more button below the post that links to the post id. I currently use post.php?=# (# = whatever the post id is). Here is the homepage: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Blog Name</title> <link rel="stylesheet" href="css/style.css" type="text/css" /> <body> <div id="upper-bar"> <div id="bar-content"> <a href="#">Home</a> <a href="#">Archives</a> <a href="#">Contact</a> <a href="#">About</a> <a href="#"><img src="images/twitter.png" id="tweet"></a><a href="#"><img src="images/feed.png" id="feed"></a> </div> </div> <div id="clear"> </div> <div class="main"> <h1>Blog Name</h1> <div class="post-col"> <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $sql = "SELECT * FROM php_blog ORDER BY timestamp DESC LIMIT 5"; $result = mysql_query($sql) or print ("Can't select entries from table php_blog.<br />" . $sql . "<br />" . mysql_error()); while($row = mysql_fetch_array($result)) { $date = date("l F d Y", $row['timestamp']); $title = stripslashes($row['title']); $entry = stripslashes($row['entry']); $id = $row['id']; ?> <div id='post-info'><?php echo "<p id='title'><strong><a href=\"post.php?id=". $id . "\">" . $title . "</a></strong></p>"; ?><br /></div> <div id="post"> <?php echo $entry; ?> <!--<br /><br /> Posted on <?php echo $date; ?> !--> </p> </div> </p> </div> <?php } ?> </div> </div> </body> </html>

    Read the article

1