Jump to content

Recommended Posts

Ok here is my include file(part of it):

 

mysql_connect("db854.perfora.net", "dbo283875085", "XjT.WtgW") or die(mysql_error());

mysql_select_db("db283875085") or die(mysql_error());

 

$titleRes = mysql_query("SELECT title FROM site_title");

$title = mysql_result($titleRes, 0, 0);

 

$aboutRes = mysql_query("SELECT about FROM about_title");

$about = mysql_result($aboutRes, 0, 0);

 

Here is my form:

 

<form id="form1" method="post" action="adminprocessgeneral.php">

      <p align="center">

        <label>Site Title:

        <input name="sitetitle" type="text" id="sitetitle" value="<?php echo "$title"; ?>" /> <br />

        </label>

        <label>

        About Me:

        <textarea name="about" id="about" cols="45" rows="5"><?php echo "$about"; ?></textarea>

        </label>

        <input type="submit" name="submit2" id="submit2" value="Submit" />

        </p>

        </form>

 

 

 

 

Here is my processing file(part i need help with):

 

      mysql_connect("db854.perfora.net", "dbo283875085", "XjT.WtgW") or die(mysql_error());

mysql_select_db("db283875085") or die(mysql_error());

 

      $newabout = $_POST['about'];

      $newtitle = $_POST['title'];

 

 

    mysql_query("UPDATE site_title SET title='$newtitle' WHERE title='$title'")

    or die(mysql_error()); 

      mysql_query("UPDATE about_title SET about='$newabout' WHERE about='$about'")

    or die(mysql_error()); 

   

    echo "Update succesfull! <br />

 

 

The about variable gets updated fine but the sitetitle just goes blank once I hit submit from my form. If I feed something directly in from phpmyadmin it shows up in the form in the $title variable fine. As soon as I hit that submit it erases it and doesn't put anything in. Whats wrong?

Link to comment
https://forums.phpfreaks.com/topic/156587-why-doesnt-it-work/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.