Jump to content

tymierb

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by tymierb

  1. No go. I added the quotes around localhost and get the same error. I added $database to the string like Kaboom suggested and it gave this error which i guess is pretty much the same: $username='far'; $password='c00lfarus3r'; $database='far'; Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/FARv2/scripts/insertsection1.php on line 18 Unable to select database. @Kaboom > this is my own localhost so I control all of the accounts that can access it. Any more suggestions?
  2. I am writing an application to do annual reviews. I cannot get my script to work. Whenever it runs I get the following error: $username='far'; $password='c00lfarus3r@'; $database='far'; Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/FARv2/scripts/insertsection1.php on line 18 Unable to select database. This does not make sense to me. It has the username and password variables and does not seem to be using them. Who is user www-data? I am pretty new to php so I don't know where to start. Here are all of the files: Input Page - section1.php: <?php include('./includes/doc_top.php');?> <div class="container"> <form action="scripts/insertsection1.php" method="POST"> <h1>Teaching/Advising</h1> <div class="entry_box"> <h4>1.A. Courses taught including the summer term.</h4> <textarea name="_1a"></textarea><br> </div> <strong>Note:</strong> The information provided below is automatically generated: <table> <tr> <td>Course</td><td>Title</td><td>Term</td> </tr> </table> <div class="entry_box"> <h4>1.B. Independent Study Supervision</h4> <textarea name="_1b"></textarea> </div> <h3>1.C. Other Academic Assignments</h3> <div class="entry_box"> <h4>1. Undergraduate Advising</h4> <textarea name="_1c1"></textarea> </div> <div class="entry_box"> <h4>2. Senior Design Committee</h4> <textarea name="_1c2"></textarea> </div> <div class="entry_box"> <h4>1.D. Teaching Awards and Recognition</h4> <textarea name="_1d"></textarea> </div> <div class="entry_box"> <h4>1.E. Course-Faculty Survey Results</h4> <textarea name="_1e"></textarea><br> </div> <strong>Note:</strong> The information provided below is automatically generated: <table> <tr> <td>Course</td><td>Term</td><td>Course Rating</td><td>Faculty Rating</td><td># of Student Responses</td> </tr> </table> <div class="entry_box"> <h4>1.F. Course/Lab Development and Major Revision Activity</h4> <textarea name="_1f"></textarea><br> </div> <h3>1.G. Student Design Projects</h3> <div class="entry_box"> <h4>1.G.1. Freshman Design Supervision</h4> <textarea name="_1g1"></textarea> </div> <div class="entry_box"> <h4>1.G.2. Senior Design Supervision</h4> <textarea name="_1g2"></textarea> </div> <div class="entry_box"> <h4>1.H. Examples of Innovation in Teaching</h4> <textarea name="_1h"></textarea> </div> <div class="entry_box"> <h4>1.I. E-Learning and Distance Learning</h4> <textarea name="_1i"></textarea> </div> <div class="entry_box"> <h4>1.J. Other Teaching Related Activities (UNIV 101, Honors Seminar)</h4> <textarea name="_1j"></textarea> </div> <input type="submit" value="Submit Secion 1"> </form> </div> </body> </html> Input Script - insertsection1.php <?php include('./../includes/db_connect.php'); $_1a=$_POST['_1a']; $_1b=$_POST['_1b']; $_1c1=$_POST['_1c1']; $_1c2=$_POST['_1c2']; $_1d=$_POST['_1d']; $_1e=$_POST['_1e']; $_1f=$_POST['_1f']; $_1g1=$_POST['_1g1']; $_1g2=$_POST['_1g2']; $_1h=$_POST['_1h']; $_1i=$_POST['_1i']; $_1j=$_POST['_1j']; mysql_connect(localhost,$database,$password); @mysql_select_db(far) or die ("Unable to select database."); $query = "INSERT INTO far VALUES ('$_1a','$_1b','$_1c1','$_1c2','$_1d','$_1e','$_1f','$_1g1','$_1g2','$_1h','$_1i','$_1j')"; mysql_query($query); mysql_close(); ?> Output Page - output.php <?php include('./../includes/db_connect.php'); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die("Unable to select database"); $query="SELECT * FROM section1"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Database Output</center></b>"; $i=0; while($i < $num) { $_1a=mysql_result($result,$i,"_1a"); $_1b=mysql_result($result,$i,"_1b"); $_1c1=mysql_result($result,$i,"_1c1"); $_1c2=mysql_result($result,$i,"_1c2"); $_1d=mysql_result($result,$i,"_1d"); $_1e=mysql_result($result,$i,"_1e"); $_1f=mysql_result($result,$i,"_1f"); $_1g1=mysql_result($result,$i,"_1g1"); $_1g2=mysql_result($result,$i,"_1g2"); $_1g=mysql_result($result,$i,"_1h"); $_1i=mysql_result($result,$i,"_1i"); $_1j=mysql_result($result,$i,"_1j"); } ?> <h2>1.A. Courses taught including the Summer Term</h2> <div class="output"> <?php echo $_1a;?> </div> <h2>1.B. Independent Study Supervision <div class="output"> <?php echo $_1b;?> </div> <h2>1.C. Other Academic Assignments</h2> <h3>1. Undergraduate Advising</h3> <div class="output"> <?php echo $_1c1;?> </div> <h3>2. Senior Design Committee</h3> <div class="output"> <?php echo $_1c2;?> </div> <h2>1.D Teaching Awards and Recognition</h2> <div class="output"> <?php echo $_1d;?> </div> <h2>1.E. Course-Faculty Survey Results <div class="output"> <?php echo $_1e;?> </div> <h2>1.F. Course/Lab Development and Major Revision Activity</h2> <div class="output"> <?php echo $_1f;?> </div> <h2>1.G. Student Design Projects</h2> <h3>1. Freshman Design Supervision</h3> <div class="output"> <?php echo $_1g1;?> </div> <h3>2. Senior Design Supervision</h3> <div class="output"> <?php echo $_1g2;?> </div> <h2>1.H. Examples of Innovation in teaching <div class="output"> <?php echo $_1h;?> </div> <h2>1.I. E-Learning and Distance Learning <div class="output"> <?php echo $_1i;?> </div> <h2>1.J. Other Teaching Related Activities (UNIV 101, Honors Seminar)</h2> <div class="output"> <?php echo $_1j;?> </div> Usernames and Passwords - db_connect.php: $username='far'; $password='c00lfarus3r@'; $database='far';
  3. I am trying to install Joomla in a VM on my comptuer. The VM is running Ubuntu 9.04 with all the latest and greatest apache2, php5, and mySQL installed and working perfectly. I got wordpress to install no problem. That was my confirmation that everything is working as expected. I am trying to install Joomla for comparison. I haven't actually started yet, but I was reading through the manual to familiarize myself with the process. The manual calls for you to add some extensions in php.ini file. I cannot figure out how to tell whether or not these extensions are turned on, and if not how to turn them on. The manual explains that most prebuilt WAMP and LAMP installations come with these extensions activated. I installed all of the packages using Synaptic package manager but I don't know if that means these modules are active or not. How do I tell?
  4. Hi, I am trying to set up an GUI for proftpd. I am using the files found here: http://sourceforge.net/projects/proftpd-admin/ I have proftpd installed but I don't know if it's working. I wanted to install a GUI that would make testing and configuring easier. I did a google search and found this download. So far I have proftpd installed. I added the credentials for the mySQL database but that's all I've done to the config file so far. I created the database for proftpd in phpmyadmin. I tried to use the .sql file found in the folder linked above but then I got the #1067 - Invalid default value for 'uid' error. I copied and pasted the code. I have not modified it in any way. I don't know much about either php or mySQL so I'm having a really hard time figuring this out. Please help Code: # # Table structure for table `groups` # CREATE TABLE `groups` ( `groupid` varchar(10) NOT NULL default '', `gid` int(10) unsigned NOT NULL auto_increment, `members` varchar(255) NOT NULL default '', PRIMARY KEY (`gid`) ) TYPE=InnoDB ; # # Table structure for table `users` # CREATE TABLE `users` ( `id` smallint(2) NOT NULL auto_increment, `userid` varchar(10) NOT NULL default '', `uid` int(10) unsigned NOT NULL default '', `gid` int(10) unsigned NOT NULL default '', `passwd` varchar(255) NOT NULL default '', `homedir` varchar(255) NOT NULL default '', `comment` varchar(255) NOT NULL default '', `disabled` int(10) unsigned NOT NULL default '0', `shell` varchar(20) NOT NULL default '/sbin/nologin', `email` varchar(255) NOT NULL default '', `name` varchar(255) NOT NULL default '', `ul_bytes` bigint(20) NOT NULL default '0', `dl_bytes` bigint(20) NOT NULL default '0', `login_count` bigint(20) NOT NULL default '0', `dl_count` bigint(20) NOT NULL default '0', `ul_count` bigint(20) NOT NULL default '0', `last_login` datetime default NULL, PRIMARY KEY (`id`) ) TYPE=InnoDB ;
×
×
  • 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.