Jump to content

redwall_hp

Members
  • Posts

    136
  • Joined

  • Last visited

Everything posted by redwall_hp

  1. redwall_hp

    INSERT Query

    I just got it working. There weren't any single-quotes around the values. That was kind of dumb. Thanks for the help, anyway.P.S. You can view the poll at http://siteofrequirement.com/mpoll/voting3/createpoll.phpI plan to clean up the code and make it available as donate-ware eventually on webmaster-source.com.
  2. redwall_hp

    INSERT Query

    Nope. It's not like that in the source code. Just here on the forum. Don't know why...
  3. redwall_hp

    INSERT Query

    $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?
  4. thanks. It seems to work.
  5. 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.
  6. the tags are there.I got the passing variables correct. Insted of mydomain.com/header.php in the include statement, you use ./header.php
  7. 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.
  8. 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>
  9. Cant believe I missed that, but it still isn't working.
  10. 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>
  11. Unlike other search engines, it's not possible to skew the results. You can't find a perfect combination of code and words to jump you to the top of the list. There's so many things it checks, like links, it's not possible. That's why I never search with any site other than google.
  12. Lol. I knew that. What I meant was it's so complex it's not possible to predict how something will affect your pageranking.
  13. Ya, I know that. Google's a mystey though. It's not possible to figure out how it works. There are helpful books and resources, though.
  14. 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.
  15. Someone, tell me. What's the secret to starting a successfull message board? I know how to set one up and all, and how to manage one. But HOW do you get a bunch of users to register and post regularly (I'd like to get 200 users and have new posts regularly).
  16. Those are pretty good. I'll keep them in mind.
  17. I'm planning on starting a webmaster site featuring my large compilation of useful web-related links. Anyone have a good idea for a name?
  18. thanks, your width tip helped. And I got rid of the IFRAME.
  19. I've been planning on getting rid of the IFRAME. I didn't have it before either. It was supposed to be temporary.
  20. 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.
  21. I'll use the script, it should work. If anyone finds anything that might be better, post it!It'll be easy to add, because I just switched to PHP and I can change things site-wide in a snap!
  22. guess i'll have to live with this then, i'm not about to switch to an inferior method.
  23. If you visit The Site of Requirement (my Harry Potter site), you'll notice that the two sidebars don't go all the way down to the bottom of the page. It would probably look better if they did. They should go all the way down almost to the copyright notice, and if the page isn't that big, they should resize to fit the sidebar-content, and be as near as possible to the size of the page. I've tried percentages, but they didn't work.
×
×
  • Create New...