Jump to content

Search the Community

Showing results for tags 'php mysql wysiwyg'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. <?php ## Blog Manager?> <?php if (isset($_POST['submitted']) == 1) { if ($_GET['id'] == '') { if ($_POST['title'] =='' || $_POST['body'] == '') { header('Location: index.php?page=blog'); } else { $title = $_POST['title']; $date = $_POST['date']; $body = $_POST['body']; $q = "INSERT INTO blog (title, date, body) VALUES ('$title', '$date', '$body')"; } }else { $q = "UPDATE blog SET title = '$_POST[title]', date = '$_POST[date]', body = '$_POST[body]' WHERE id = '$_POST[id]'"; } $r = mysqli_query($dbc, $q); } ?> < h2>ATOM.CMS Blog Manager</h2> <div class="col sidebar"> <ul class="nav_side"> <li><a href="?page=blog">+ Add Post</a></li> <?php $q = "SELECT * FROM blog ORDER BY date ASC"; $r = mysqli_query($dbc, $q); if ($r) { while ($link = mysqli_fetch_assoc($r)) { echo '<li><a href="?page=blog&id='.$link['id'].'">'.$link['title'].'</a></li>'; } } ?> </ul> < /div> < div class="col editor"> < h1> <?php if (isset($_GET['id'])) { $q = "SELECT * FROM blog WHERE id = '$_GET[id]' LIMIT 1"; $r = mysqli_query($dbc, $q); $opened = mysqli_fetch_assoc($r); echo 'Editing: '.$opened['title']; } else { echo 'Add a New Blog Post'; } ?> < /h1> <form action="?page=blog&id=<?php if (isset($_GET['id'])){echo $opened['id'];} ?>" method="post"> <table class="gen_form"> <tr> <td class="gen_label"><label>Blog title: </label></td> <td><input class="gen_input" type="text" size="30" name="title" value="<?php if (isset($_GET['id'])){echo $opened['title'];} ?>" /></td> </tr> <tr> <td class="gen_label"><label>Blog date: </label></td> <td><input class="gen_input" type="text" size="30" name="date" value="<?php if (isset($_GET['id'])){echo $opened['date'];} ?>"/></td> </tr> <tr> <td class="gen_label"></td> </tr> <tr> <td colspan="2" class="gen_label"><label>Blog body: </label></td> </tr> <tr> <td colspan="2"><textarea id="page_body" name="body" cols="90" rows="24"><?php if (isset($_GET['id'])){echo $opened['body'];} ?></textarea></td> </tr> <tr> <td colspan="2"><input class="gen_submit" type="submit" name="submit" value="Save Changes" /></td> </tr> <input type="hidden" name="submitted" value="1" /> <input type="hidden" name="id" value="<?php if (isset($_GET['id'])){echo $opened['id'];} ?>" /> </table> </form> <?php ?> </div> Two problems: 1. The timestamp being inserted into the database is 0000-00-00 00:00:00 2. The body content is being inserted into the database with paragraph tags around it (I am using Redactor WYSIWYG for the body field). What could be causing these two issues?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.