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
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-07-2009, 12:59 AM   #21 (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

NVM that worked allworknoplay

Thank you to both of you for your help.

+rep for you both :D
__________________
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
Old 05-07-2009, 12:59 AM   #22 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
Hmm.....can he do this?


PHP Code:
 $update mysql_query("UPDATE settings SET `sitename` = '".$websitename."' WHERE `build` = '1.0a'") or die(mysql_error());
if(
$update) {
echo 
"Success";

I honestly don't know. It's been so long since I've one anything like this in PHP.
__________________

Village Idiot is offline  
Reply With Quote
Old 05-07-2009, 01:00 AM   #23 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Randy View Post
so do what just delete that line?
No, that isn't the cause of it not updating. I'm just saying its a potential bug later on.
__________________

Village Idiot is offline  
Reply With Quote
Old 05-07-2009, 01:02 AM   #24 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Randy View Post
NVM that worked allworknoplay

Thank you to both of you for your help.

+rep for you both :D
Ok so what exactly worked?

LOL.....
allworknoplay is offline  
Reply With Quote
Old 05-07-2009, 01:02 AM   #25 (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

Alright, well it seems to have worked without that line :S

Final Code:

PHP Code:
<?php

                
if (isset($_POST['submit'])) {

                            
// Define Variables
                            
$websitename $_POST['websitename'];
                            
$tagline $_POST['tagline'];
                            
$websiteurl $_POST['websiteurl'];
                            
$contactemail $_POST['contactemail'];
                            
                        
// Attempt To Update
                        
$update mysql_query("UPDATE settings SET `sitename` = '".$websitename."' WHERE `build` = '1.0a'") or die(mysql_error());
                            if(
$update) {
echo 
"Success";
}  
                        
                } else {
            
?>
              <form action="" method="POST" id="settings" name="settings ">
                Website Name: <br />
                <label class="mediumInput">
                  <input name="websitename" id="websitename" type="text" size="75" />
                  </label>
                <br />
                <small>This will show up in the tab bar in your browser and all over the website.</small>
                <p>Tagline (Description): <br />
                  <label class="textareasmall">
                    <textarea name="tagline"  id="tagline" rows="2" cols="5"></textarea>
                  </label>
                <br />
                <small>This will show up on search engines under the name and will give a basic description of your website.</small></p>
                <p>Website URL: <br />
                  <label  class="mediumInput">
                    <input type="text" name="websiteurl" id="websiteurl" size="75"/>
                  </label>
                  <br />
                  <small>This is the URL to where you have this installed, It is recommend you do not change unless you know what you are doing.</small></p>
                <p>Contact Email: <br />
                  <label class="mediumInput">
                    <input name="contactemail" id="contactemail" type="text" size="75" />
                  </label>
                <br />
                <small>This is where emails will be sent to when contact form is used, as well as when emails are sent out.</small></p>
                <p>
            <input name="submit" id="submit" type="submit" />
                  </p>
              </form>
              <?php
                
}
                
?>
__________________
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
Old 05-07-2009, 01:09 AM   #26 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Randy View Post
Alright, well it seems to have worked without that line :S


ok cool....
allworknoplay is offline  
Reply With Quote
Old 05-07-2009, 02:31 AM   #27 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

mysql_affected_rows should tell you if there are any rows being modified.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Reply



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
Basic php form update mysql script dp2 Absolute Beginners 3 03-11-2009 04:06 PM
mysql update with multi fields sarmenhb Absolute Beginners 1 02-06-2009 10:03 PM
You are subscribed to this thread mysql update with multi fields sarmenhb Advanced PHP Programming 0 11-15-2008 05:00 AM
mysql update with multi fields sarmenhb General 0 11-15-2008 04:19 AM
Log User Data with PHP & MySQL mortisimus Absolute Beginners 6 09-30-2007 05:52 PM


All times are GMT. The time now is 09:33 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