Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7751305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:30:50+00:00 2026-06-01T11:30:50+00:00

I have a basic CMS for some news articles, basically some of my content

  • 0

I have a basic CMS for some news articles, basically some of my content contains links as the

    <a href=""></a> 

html so that the links are added when written to the page. Could this be why my content is being randomly duplicated? when edited?

Here’s the php I’m using to edit.

          include'includes/connection.php';
          $pName = $_POST['pName'];
         $pItem = $_POST['pItem'];
         $pCategory = $_POST['pCategory'];
         $pDate = $_POST['pDate'];
         $pAuthor = $_POST['pAuthor'];
         $pContent = $_POST['pContent'];
         $Page = $_POST['Page'];
         $id = $_POST['id'];
         $pApproval = $_POST['pApproval'];
         $pPriority = $_POST['pPriority'];
         $pImage_Name = $_POST['pImage_Name'];

         if($pItem != 2){

         $updateq = "UPDATE sitecontent SET ID = '$pID', Post_Title = '$pName',              Post_Year = '$pCategory', Date = '$pDate', Post_Author = '$pAuthor', Post_Content = '$pContent', Page = '$Page', Post_Approval = '$pApproval', Priority = '$pPriority', Image_Name = '$pImage_Name' WHERE ID = '$_POST[id]'";

         $result = mysql_query($updateq) or die (mysql_error());
         header("Location:admin.php");

         }
         if($pCategory = 2){
     $updateq = "UPDATE reviews SET review_id = '$pID', review_title = '$pName', review_category = '$pCategory', review_content = '$pContent', review_image = '$piName', review_approval = '$pApproval' WHERE ID = '$_POST[id]'";

         $result = mysql_query($updateq) or die (mysql_error());
         header("Location:reviews-category.php");
         }

This is the page before that sends the data.

    <form action="editp.php" method="POST" name="editform">
    <table cellpadding="10" >
        <tr>
        <td width="86" valign="top" >
        <label for="pName" style="padding:10px; ">Post Title</label></td>
        <td width="550">
        <input type="text" name="pName" style=" width:550px;border:#000099; margin:10px;" value="<?php echo $post['Post_Title']; ?>"/>
        </td>
        </tr>
        <tr>

         <td width="86" valign="top" >
        <label for="pCategory" style="padding:10px; ">Category</label></td>
        <td width="550">
        <input type="text" name="pCategory" style=" width:50px;border:#000099; margin:10px;" value="<?php echo $post['Post_Year']; ?>"/>
        </td>
        </tr>
        <tr>
        <td>
        <label for="pItem" style="padding:10px;">Item Type</label>
        </td>
        <td>
        <select name="pItem" style="border:#000099; margin:10px;">
            <option value="1">News</option>
            <option value="2">Review</option>
        </select>
        </td>
        </tr>
        <tr>
        <td>
        <label for="pName" style="padding:10px;">Article ID</label>
        </td>
        <td>
        <input type="text" name="pID" style="border:#000099; margin:10px;" value="<?php echo $post['ID']; ?>"/>
        </td>
        </tr>
        <tr>
          <td>
            <label for="pName" style="padding:10px;">Post Date</label>
            </td>
          <td>
                <input type="text"  name="pDate" style="border:#000099; margin:10px;" value="<?php echo $post['Date']; ?>">

            </td>
        </tr>
        <td>
        <label for="pName" style="padding:10px;">Post Author</label>
        </td>
        <td>
        <input type="text" name="pAuthor" style="border:#000099; margin:10px;" value="<?php echo $post['Post_Author']; ?>"/>
        </td>
        </tr>
         <tr>
        <td>
        <label for="pName" style="padding:10px;">Home Page</label>
        </td>
        <td>
        <select name="Page" style="border:#000099; margin:10px;">
            <option value="0">None</option>
            <option value="1">Home</option>
        </select>
        </td>
        </tr>
        <tr>
        <td>
        <label for="pPriority" style="padding:10px;">Home Priority</label>
        </td>
        <td>
        <select name="pPriority" style="border:#000099; margin:10px;">
            <option value="0">None</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
        </select>
        </td>
        </tr>
        <tr>
        <td>

          <label for="pName" style="padding:10px;">Post Content</label>
          </td>
          <td>
            <textarea style="width:550px; height:200px;border:#000099; margin:10px;" type="text" name="pContent" id="pContent" value="<?php echo $post['Post_Content']; ?>"><?php echo $post['Post_Content']; ?></textarea>
            </td>
            </tr>
               <tr>
            <td>
            </td>
            <td style="padding:10px;">
            <span id="btnStrong" style="  padding: 2px 8px;background-color:#C00;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; color:#FFF; cursor:pointer;">Bold</span> &nbsp;
             <span id="btnItalic" style=" padding: 2px 8px; background-color:#C00;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; color:#FFF; cursor:pointer;">Italic</span> 
             <span id="btnPara" style=" padding: 2px 8px; background-color:#C00;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; color:#FFF; cursor:pointer; margin-left:10px;">Paragraph</span>
             <span id="btnBreak" style=" padding: 2px 8px; background-color:#C00;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; color:#FFF; cursor:pointer; margin-left:10px;">Line Break</span>

             <span id="btnLink" style="  padding: 2px 8px;background-color:#C00;font-family:'Trebuchet MS', Arial, Helvetica, sans-serif; color:#FFF; cursor:pointer;">Link</span>
           </td>
        </tr>
        <td>
        <label for="pImage_Name" style="padding:10px;">Image Name</label>
        </td>
        <td>
        <input type="text" name="pImage_Name" style="border:#000099; margin:10px; width:550px;" value="<?php echo $post['Image_Name']; ?>"/>
        </td>
        </tr>
         <tr>
           <td>
             <label for="pApproval" style="padding:10px;">Approval</label>
             </td>
           <td>
             <select name="pApproval" style="border:#000099; margin:10px;">
               <option value="0">Pending</option>
               <option value="1">Approved</option>
               </select>
             </td>
         </tr>

         <tr align="right">
         <td><input type="hidden" name="id" value="<?php echo $_GET['id']; ?>"/></td>
        <td colspan="2"><span style="margin-left:10px;">Please check the changes above before submitting</span><br/>

        <input type="submit" name="go" value="Submit Changes" style=" padding: 2px 8px;background-color:#C00; color:#FFF; margin:10px;"/>
        </td>
       </tr>
    </table>
    </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:30:52+00:00Added an answer on June 1, 2026 at 11:30 am

    Are you sure you want if($pCategory = 2){ and not: if($pCategory == 2){?

    Your if($pCategory = 2){ will always evaluate to true, hence the duplicates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic cms that loads content into pages that have mustache tags
I have a basic CMS in PHP/MySQL where content managers can create pages to
I have a basic CMS where a user can update a database of articles
I am working on a webapp that contains the basic elements of a CMS
It is a basic HTML question. I have some div tags, which have some
I have a basic form with controls that are databound to an object implementing
I have a basic CRUD form that uses PageMethods to update the user details,
I have a basic model in which i have specified some of the fields
I have a basic ActiveRecord model in which i have two fields that i
I have to choose the structure of a database that will store content types

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.