TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05-07-2009, 10:41 PM   #1 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default Personal Notes via PHP

So i know i just got help with some update settings from yall but this one is quite different in a way.

I am trying to have a personal notepad in the user/admin dashboard but for some reason it won't update like last time or read the data from the mysql database to post..

Full Code:
http://pastie.org/471693

Code To Read & Post Data To Form:
PHP Code:
            $notesquery mysql_query("SELECT * FROM user WHERE `username` = '$username' && `password` = '$password'") or die(mysql_error()); 
            
$notesresult mysql_fetch_array$notesquery ); 
            
$notes $notesresult['notes']; 
Code To Update/Display Form:
PHP Code:
            <?php
                            
if (isset($_POST['submit'])) {

                            
// Define Variables
                            
$notes $_POST['notes'];
                            
                        
// Attempt To Update
                        
$update mysql_query("UPDATE user SET `notes` = '".$notes."' WHERE `username` = '$username' && `password` = '$password'") or die(mysql_error());
                            if(
$update) {
                                echo 
"Success";
                                }  
                        
                } else {
            
                
?>
              <form id="form1" name="form1" method="post" action="">
                My Personal Notes<br />
                  <label class="textarea">
                    <textarea name="notes" id="notes" rows="6" cols="80"><?php echo $notes ?></textarea>
                  </label>
                  <p><small>Any notes that you put in this box are your private notes, Nobody else will be able to see them, so make them as secret as you want.</small></p>
                <p>
            <input name="submit" id="submit" type="submit" />
                  </p>
              </form>
              <?php ?>
It won't even display the $notes in the form.. nor will it update the mysql database, im not sure whats going on. please help again.
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get PHP 5. to work? Newbie windows PHP guy DotNetTim Absolute Beginners 11 02-01-2013 11:02 AM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
what are all the subjects in php? sarmenhb General 7 01-21-2008 05:41 PM
Uploading Files with PHP daz Absolute Beginners 3 09-30-2007 06:23 PM


All times are GMT. The time now is 05:51 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design