Jump to content

bravo81

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Everything posted by bravo81

  1. Thanks for your help, I did say it was an easy problem! Haha. I found the php.ini file, found the line and corrected the error. Thanks again! Dean.
  2. Hmm all I can find it defines of localhost and: define("SITE_URL","http://www.thelaughingfactory.co.uk/"); define("SITE_FS_PATH",$_SERVER['DOCUMENT_ROOT']."/admincp/"); define("SITE_PATH","http://thelaughingfactory.co.uk/"); } else {
  3. Wow, Yeh I didnt notice that. So its rooting to the wrong area..where is that set? Haha..I will root through the files. Thanks for the fast response!
  4. Hi guys, I have moved servers and now a login PHP system I was using is giving me a session error It is here: http://thelaughingfactory.co.uk/admincp/ The error log states: [09-Jun-2010 20:25:45] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: open(/home/deandesi/public_html/bcwizards.co.uk/thelaughingfactory.co.uk/temp/sess_4b58db168873e6f8bc24d4a407fac790, O_RDWR) failed: No such file or directory (2) in /home/bcwizard/public_html/domains/thelaughingfactory.co.uk/admincp/index.php on line 1 [09-Jun-2010 20:25:45] PHP Warning: Unknown: open(/home/deandesi/public_html/bcwizards.co.uk/thelaughingfactory.co.uk/temp/sess_4b58db168873e6f8bc24d4a407fac790, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 [09-Jun-2010 20:25:45] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home/deandesi/public_html/bcwizards.co.uk/thelaughingfactory.co.uk/temp) in Unknown on line 0 Ive tried re-creating the file, deleting all files in the temp folder and even using the temp files that where on the old server. But no luck! Could someone please help me!! Regards, Dean.
  5. I have done that, Now my code is: mysql_query("INSERT INTO `users` ('username', 'password', 'activated', 'online', 'email', 'status', 'tut', 'activecode') VALUES ('$reg_username', '$randompassword', '0', '0', '$email', 'Alive', '0', '$code')"); if (mysql_affected_rows() != 1) die ('Query failed: '.mysql_error()); I have removed all other columns that I am not using. Also, the code is inserting into the columns in order. The error I get now is: Any ideas? Thanks, Dean.
  6. Thanks Fenway, I will try that. I have not got Defaults in all off the Fields, but I am not listing hte Column name so it should just be ok yeh? Im getting this error: Query failed: 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 '@hotmail.co.uk, ykyc4h67, 0, 0, Alive)' at line 2 The Email field has about 10 other fields between it and "Password". Is that why the error comes up? Thanks, Dean.
  7. Hi everyone, I am trying to INSTERT INTO my MySQL DB Table when someone registers. But I do not want to create Values for every field, is that possible? Its not working so far, I am defining the fields I wish to fill in with the Data supplied in the submit form. mysql_query("INSERT INTO `users` (username, password, email, activecode, activated, tut, status) VALUES ($reg_username, $randompassword, $email, $code, 0, 0, Alive)"); if (mysql_affected_rows() != 1) die ('Query failed: '.mysql_error()); The website is: www.southernheavenflorida.com/quarantime.com Thanks for any help/comments. Dean.
  8. Hi there, Try insterting: if (mysql_affected_rows() != 1) die ('Query failed: '.mysql_error()); Onto the line below your INSERT INTO code. This should tell you what is wrong.
  9. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/southern/public_html/newshf/admin/admincp.php on line 65 Line 65 is: while ($row=mysql_fetch_array($info)){ from: while ($row=mysql_fetch_array($info)){ echo " ".$row['title']."\r\n<br>".$row['content'].""; } Your code I entered: $sql = "SELECT * FROM welcome WHERE active='1'"; $result = mysql_query($sql) or die(mysql_error()); $info=mysql_fetch_object($result); Any ideas? This is annoying.
  10. Ok, Index.php: <? session_start(); include './includes/db_connect.php'; include './includes/counter.php'; include './includes/functions.php'; $username=$_SESSION['username']; $query2=mysql_query("SELECT * FROM users WHERE username='$username' LIMIT 1"); $fetch2=mysql_fetch_object($query2); $querywelcome=mysql_query("SELECT * FROM welcome WHERE active='1'"); ?> <? while ($row=mysql_fetch_array($querywelcome)){ echo " ".$row['title']."\r\n<br>".$row['content'].""; } ?> Works fine. admin.php: <?php session_start(); include "../includes/db_connect.php"; include "../includes/functions.php"; $username=$_SESSION['username']; $message=""; $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); if ($fetch->userlevel = "0"){ echo " <div align=center> <font color=red size=20> You Have No Rights Here. </font></div> "; exit(); } ?> <? if (strip_tags($_GET['op']) == "welcome"){ if(strip_tags($_POST['content'])){ $content=strip_tags($_POST['content']); $title=strip_tags($_POST['title']); $check = mysql_num_rows(mysql_query("SELECT * FROM welcome WHERE active='1'")); if ($check == "0") { echo "No such content"; }elseif ($check != "0") { $update = "UPDATE welcome SET content = '$content'". "WHERE active = '1'"; mysql_query($update) or die('<div align=center><br><img src=../images/error.jpg width=470 height=28><br><br><br><a href=index.php><img src=../images/lmenu.jpg border=0><img src=../images/home.jpg border=0><img src=../images/rmenu.jpg border=0></a></div>'); $message="<img src='../images/savecomplete.jpg' width='154' height='28' alt='Your content has been saved'"; }} echo "<br><br><center>$message</center>"; ?> <div align="center"> <br><br> <form name="form1" method="post" action="?op=welcome"><br> Title:<br><input name="title" type="text" id="title" value='Enter your title here.'> <br><br> Content:<br> <textarea name="content" cols="40" rows="7" id="content">Enter your content here.</textarea> <br><br> <input type="image" src="../images/save.jpg" alt="Click here to Save your content." name="Welcome"> </form> <p><br> <br> </p> </body> </html> <? }else{ ?> You can not enter this page directly,<br> Please go back. <? } ?> <p> <? logincheck(); ?>
  11. Hi all, I have the following code: $querywelcome=mysql_query("SELECT * FROM welcome WHERE active='1'"); while ($row=mysql_fetch_array($querywelcome)){ echo " ".$row['title']."\r\n<br>".$row['content'].""; } That works fine, displaying the text inside the fields chosen. I have set up and editing panel for the Admin, It uses the exact same code to show the Admin what is there at the moment. But errors? Invalid MySQL Resource I belive (I have removed the code now) But then I am using a text box to change it, which works fine..after submiting the form the error is gone and shows the text? Help! Regards, Dean.
  12. That worked great, thanks Pioden. But I didnt understand why I should delete that bit of code? Whats the purpose of that? Thanks for your help, Dean.
  13. Hi everyone, Im trying to display text on this page: www.southernheavenflorida.com/newshf/ But I want it to be editable, I have set it up and it works using a MySQL DB. It only sits on one line, no new line, <br> /n etc. I want an easyer way to do it as this is getting harder everytime i try to fix it. Any suggestions? tutorials? would be appreciated! I was thinking about just saving to a .txt file. Of course, im not a PHP pro and only know what I have learnt my self. Regards, Dean.
  14. That really confused me, but I think I understand. I will try that, thanks.
  15. It is supposed to display the "title" and "content" field like it does on: www.southernheavenflorida.com/newshf/index.php but, It just errors instead? But after submitting the form (Which updates the fields) it works fine, displaying the text inside the fields like on index.php. Why?
  16. Anyone? Really need this fixed..Its stopping the whole website in its tracks. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/southern/public_html/newshf/admin/admincp.php on line 62 Line 62: while ($row=mysql_fetch_array($welcome)){ $welcome: $welcome=mysql_query("SELECT * FROM welcome WHERE active='1'") or die('<div align=center><br><img src=../images/error.jpg width=470 height=28><br><br><br><a href=index.php><img src=../images/lmenu.jpg border=0><img src=../images/home.jpg border=0><img src=../images/rmenu.jpg border=0></a></div>');
  17. This is raw code from one of my projects: $sql_email_check = mysql_query("SELECT email FROM users WHERE email='$email' AND status='Alive'"); $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$reg_username'"); $email_check = mysql_num_rows($sql_email_check); $username_check = mysql_num_rows($sql_username_check); if(($email_check > 0) || ($username_check > 0)){ echo ""; if($email_check > 0){ $message= "*This email address has already been used by another player!"; unset($email); } if($username_check > 0){ $message="*That desired username is already in use!"; unset($reg_username); }
  18. Can you explain that a bit clearer please?
  19. I tried doing this before, gave up. How about cutting the image up into provinces? and changing the image from teh transparent dot, to a dot with the province behind it in your selected colour. Like an image rollover. Hope that helps.
  20. Sure the DB Table isnt Members? and not members like you wrote. Sounds stupid but could be it. Have you set the fields to the right settings? Like..your not trying to isntert text into an ENUM field etc. screenshot of the DB? Form HTML? Hope that helps.
  21. Ok, im still getting the error. But after submiting the form it displays correctly. What in the world?
  22. Thanks for the replys! It is a numeric field yes, I will remove the ' ' but it worked on index.php Heres the full code: <?php session_start(); include "../includes/db_connect.php"; include "../includes/functions.php"; $username=$_SESSION['username']; $message=""; $fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); if ($fetch->userlevel = "0"){ echo " <div align=center> <font color=red size=20> You Have No Rights Here. </font></div> "; }if (strip_tags($_GET['op']) == "welcome"){ if(strip_tags($_POST['content'])){ $content=strip_tags($_POST['content']); $title=strip_tags($_POST['title']); $check = mysql_num_rows(mysql_query("SELECT content FROM welcome WHERE active='1'")); $welcome=mysql_query("SELECT * FROM welcome WHERE active='1'") or die ('Error, Please contact Dean.'); if ($check == "0") { echo "No such content"; }elseif ($check != "0") { $update = "UPDATE welcome SET content = '$content'". "WHERE active = '1'"; mysql_query($update) or die('Error, query failed'); $message="<strong><font color=green>Done!</font></strong>"; }} ?> <br><br><br><br><br><br><br><br><br> <? echo "<center>$message</center>"; ?> <div align=center> <br> Current Content:<br><br> <? while ($row=mysql_fetch_array($welcome)){ echo " ".$row['title']."\r\n<br>".$row['content'].""; } ?> <br><br> <form name="form1" method="post" action="?op=welcome"> <strong>Edit the Welcome note</strong> </center><br> Title:<br><input name="title" type="text" id="title" value="Welcome"> <br><br> Content:<br> <textarea name="content" cols="40" rows="7" id="content"> Enter Your Content Here.</textarea> <br><br> <input name="Welcome" type="submit" id="Welcome" value="Save"> </form> <p><br> <br> </p> </body> </html> There is more, but it has nothing to do with the part im having problems with.
  23. Hi all, im getting this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/southern/public_html/newshf/admin/admincp.php on line 46 When trying to put MySQL content onto my site, but it works on another page fine? Heres the code: $welcome=mysql_query("SELECT * FROM welcome WHERE active='1'") or die ('Error, Please contact Dean.'); <? while ($row=mysql_fetch_array($welcome)){ echo " ".$row['title']."\r\n<br>".$row['content'].""; } ?> The DB is fine as my index.php works on: www.southernheavenflorida.com/newshf/ Any help would be appreciated! Thanks, Dean.
  24. Fixed it myself, thanks anyway.
×
×
  • 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.