1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

PHP MySQL inserts, Reward offered for solution...

Discussion in 'Plesk for Linux - 8.x and Older' started by EnigmaBurn, Jun 13, 2005.

  1. EnigmaBurn

    EnigmaBurn Guest

    I got a problem and I need it fixed now. I cannot screw around with half answers anymore. I will give $50 USD to whoever figures and gives me a definative solution. First person to the solution gets it.

    Plesk 7.5, Linux, MySQL, PHP script attempting to insert news into DB. PHP sucessfully pulls information from the DB so connection is seemingly working. However, it is not inserting the information and it is not throwing any errors.

    This is the script:

    <title> ASG Newsfeed Admin</title>
    if (isset($_GET['addnews'])): // If the user wants to add a headline
    <form action="<?=$PHP_SELF?>" method="post">
    <p>Headline:<br />
    <input name="headline" length="100"></input><br />
    <p>URL:<br />
    <input name="url" length="100"></input><br />
    <p>Section:<br />
    <SELECT id="Select1" size="1" name="section">
    <OPTION selected>
    <OPTION value="Asian Health">
    Asian Health<OPTION value="China">
    China<OPTION value="Central Asia">
    Central Asia<OPTION value="Korea">
    Korea<OPTION value="Japan"> Japan<OPTION value="Middle East">
    Middle East<OPTION value="South Asia">
    South Asia<OPTION value="Southeast Asia">
    Southeast Asia
    </OPTION> </SELECT><br />
    <p>Description:<br />
    <textarea name="desctext" rows="10" cols="40" wrap></textarea><br />
    <input type="submit" name="submitnews" value="SUBMIT" /></p>
    else: // Default page display
    // Connect to the database server
    $dbcnx = @mysql_connect("localhost", "USER", "PASS");
    if (!$dbcnx) {
    echo( "<p>Unable to connect to the " .
    "database server at this time.</p>" );
    // Select the newsfeed database
    if (! @mysql_select_db("rssnews") ) {
    echo( "<p>Unable to locate the newsfeed " .
    "database at this time.</p>" );
    // If a headline has been submitted,
    // add it to the database.
    if ($_POST['submitnews'] == "SUBMIT") {
    $sql = "INSERT INTO RSSnews SET

    if (@mysql_query($sql)) {
    echo("<p>Your headline has been added.</p>");
    } else {
    echo("<p>Error adding headline: " .
    mysql_error() . "</p>");

    echo("<p><b> Headlines currently displaying: </b></p>");

    // Request all the headlines
    $result = @mysql_query("SELECT * FROM RSSnews ORDER BY f_id DESC, f_date DESC LIMIT 6");
    if (!$result) {
    echo("<p>Error performing query: " . mysql_error() . "</p>");

    // Display the text of each item in a paragraph
    while ( $row = mysql_fetch_array($result) ) {
    echo("<p>" . $row["f_title"] . "</p>");

    // When clicked, this link will load this page
    // with the headline submission form displayed.
    echo("<p><a href='$PHP_SELF?addnews=1'>Add a headline</a></p>");



    Finally, I don't care how stupid or simple the solution is that I may have overlooked - you give it to me, I give you $50... I am sick of screwing around this.

  2. tyler

    tyler Guest


    <form action="<?=$PHP_SELF;?>" method="post">

    If you have register_globals turned off (which you should), that won't work. Try

    <form action="<?=$_SERVER["PHP_SELF"];?>" method="post">

  3. EnigmaBurn

    EnigmaBurn Guest

    You're the big winner. Many thanks, I needed that. You finally saw - or at least helped where others ignored or simply did not know... I appreciate that.

    PM me and I will arrange your renumeration.

    Many thanks again!
  4. jamesyeeoc

    jamesyeeoc Guest

    I assume this is related to your other post. If it is, then if you had posted the script in question in the first place, then you would have gotten better answers.

    Those who try and help others on this forum do the best they can with the information posted. If you give partial info, then you may only get partial answers...

    This is a common problem with many of the posts I've seen and tried to help out with in the last few months.

    It's like calling a help desk and saying 'it doesn't work, fix it.'

    And money is not the object of helping, at least not to me.
  5. EnigmaBurn

    EnigmaBurn Guest

    Actually I was not referring to the previous thread here necessarily... I have sought help in three different forums, and from one offline resource... All got me very close to the 'final answer' but obviously, still just a step away...

    I apoligize if you thought this was intended solely to that previous post and was a dig against you... It was not.

    I simply got fed up and posted this as a result of such frustration - time is money, my site(s) and I am happy to give a little back for definitive answers...

    I appreicate EVERYONE'S time in this community.

  6. jamesyeeoc

    jamesyeeoc Guest

    No problem, when it gets to be really late, sometimes I get touchy. I realized it afterwards and should have deleted that post but forgot.

    A lot of it stems from trying too hard to help find an answer when the info posted is sparse, combined with not wanting to 'ignore' those posts.

    Frustration of my own making...

    I fully understand how frustrating it is when a server has a problem, that's one reason I try to help out even with the 'my qmail won't send, what could it be' type questions from others.....

    Please forgive my last post. Thanks.
  7. EnigmaBurn

    EnigmaBurn Guest

    No worries man! I totally understand. I hope that we may liazze again soon... I get punchy late too... Cheers!