Jump to content

redwall_hp

Members
  • Posts

    136
  • Joined

  • Last visited

Posts posted by redwall_hp

  1. ErrorSQL query:INSERT INTO mpoll_results( last_name, first_name )VALUES ('Stein', 'Waldo')MySQL said: Documentation#1054 - Unknown column 'last_name' in 'field list'
  2. $query = mysql_query("INSERT INTO mpoll_results (question,numberofoptions,opt1,opt2,opt3,opt4,opt5,opt6,opt7,opt8,opt9,opt10,count1,count2,count3,count4,count5,count6,count7,count8,count9,count10,totalvotes) VALUES($question,$numberofoptions,$opt1,$opt2,$opt3,$opt4,$opt5,$opt6,$opt7,$opt8,$opt9,$opt10,$count1,$count2,$count3,$count4,$count5,$count6,$count7,$count8,$count9,$count10,$totalvotes)") or die(mysql_error());

    I'm making an AJAX poll script, but I ran into a brick wall here, sort of. I'm using some quick values I came up with so the script has something to work with. Unfortunately, I get the followng MYSQL error instead of the script continueing.

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Question,10,Option 1,Option 2,Option 3,Option 4,Option 5,Option

    Anyone know what the problem is?

  3. Here's what I'm trying to do:I want to have page (lets call it index.php) that has includes pointing to header and footer. Header should be able to check to see what page is trying to include it (is it index? or not) and react accordingly.

  4. I use PHP includes for my site. I have a header file which contains everything up to the main content. Then I ahve the footer file which is everything down from the content to the </html> tag.I would like to be able to have code in the header file which checks to see what the current page is (the current page. not the included header file). Whenever I try to, it tells me the current page is header.php rather than the actual page being viewed (ex. index.php which has php include statements pointing to the header and footer files). I'd also like to be able to pass variable from the index page to one of the included one. Which doesn't work as expected. I'd like to set a variable on the index to what I want the page title to be. Since the title tag for the page is in the header.php file, it should read the variable and echo the variable inside the title tag. This doesn't work as expected and it doesn't do anything.

  5. Everything is working now. You can test it if you want at http://www.siteofrequirement.com/myportkey/login.php. Use test as username and test as password. The code is as follows, thanks for the help.

    <?php//access config$dbhost = 'db1.awardspace.com';$dbusername = '<CENSORED FOR SECURITY>';$dbuserpass = '<CENSORED FOR SECURITY>';$dbname = 'redwall_hp_db';$badlogin = 0;Session_start();//connectmysql_connect($dbhost, $dbusername, $dbuserpass);mysql_select_db($dbname) or die("Error. Cannot conect to database. Please inform the webmaster via email");if ($_POST['username']) {//password and username supplied?$username = $_POST['username'];$password = $_POST['password'];$query = mysql_query("SELECT username,password FROM portkey_table WHERE username = '$username'") or die (mysql_error());$data = mysql_fetch_array($query);if ($data['password'] != $password) {echo "Wrong password.";$badlogin = 1;}if ($data['username'] != $username) {echo "Wrong username";$badlogin = 1;}if ($badlogin == 0) {$query = mysql_query ("SELECT username,password FROM portkey_table WHERE username = '$username'") or die (mysql_error());$row = mysql_fetch_array ($query);$_SESSION["s_username"] = $row['username'];echo "You are now logged in. <a href='admin.php'>Click here to continue.</a>";}}?><form action="login.php" method="post">Username: <input type="text" name="username"><br>Password: <input type="password" name="password"><br><input type="submit" value="login"></form>

  6. I have a membership system I've been working on. The login page is at http://www.siteofrequirement.com/myportkey/login.php. If you enter the username test and the password test it should display a link to another page (early development stage). Instead, the page refrshes and nothing happens. Here is the code if anyone can help.

    <?php//access config$dbhost = '[host]';$dbusername = '[db username]';$dbuserpass = '[db password]';$dbname = '[db name]';$badlogin = 0;Session_start();//connectmysql_connect($dbhost, $dbusername, $dbuserpass);mysql_select_db($dbname) or die("Error. Cannot conect to database. Please inform the webmaster via email");if ($POST['username']) {//password and username supplied?$username = $_POST['username'];$password = $_POST['password'];$query = mysql_query("SELECT username,password FROM portkey_table WHERE username = '$username'") or die (mysql_error());$data = mysql_fetch_array($query);if ($data['password'] != $password) {echo "Wrong password.";$badlogin = 1;}if ($data['username'] != $username) {echo "Wrong username";$badlogin = 1;}if ($badlogin = 0) {$query = mysql_query ("SELECT username,password FROM portkey_table WHERE username = '$username'") or die (mysql_error());$row = mysql_fetch_array ($query);$_SESSION["s_username"] = $row['username'];echo "You are now logged in. <a href='admin.php'>Click here to continue.</a>";}}?><form action="login.php">Username: <input type="text" name="username"><br>Password: <input type="password" name="password"><br><input type="submit" value="login"></form>

  7. Yeah. I think having a domain would be important, too. Just look at some of those Harry Potter sites. The ones with domains definitely do better in search engines, and get more users on the boards than the ones that use url redirection or a subdomain. I've been working on making the board more unique, too.I think I need to get a domain (1and1 hasn't sent me confirmation, yet, though), and exchange more links.

  8. If you look at http://www.SiteOfRequirement.net.tc in IE (Internet Explorer), you'll notice that the IFRAME with the news in it appears waaaay down at the bottom of the page. IE insists on adding a bunch of annoying white space (like 3.5 pages). How do I get rid of it? It's fine in Firefox. It still happens when the new is not in an IFRAME, just added with a PHP Include. How do I fix this? 89% of web users STILL use IE.

×
×
  • Create New...