Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. exactly there ( in the tab if its IE 7, or the bar at the top, in previous versions on IE) when veiwing this particular page. youll see something like "[image] logos in web page header"  and the [logo] is like a blue swirl on a white background how would i create that image on a web page im making ???
  2. im not wuite sure whether this is done in php, or just html or xml or whatever. when you go to a webpage, and in the header of thep ager, on the internet broswer, it displays the title of the page, and often a small image or thumbnail of an image, ( like only 5 pixels across, or something tiny ) . people using xampp, or wamp maybe might know of this when they veiw their pages. my question is..... can you chenge this image, from the defult, such as the xampp logo for xampp users.  instead have it the logo of the page.  thanks for your help in advance, PC Nerd
  3. ok, i got rid of the entire "or die" statement. and instead went to use "echo $New_Player_Query;"  when that happened nothing happened on screen.  but..... does that mean that it is returning NULL becauase its an INSTER INTO Query?  when i put the "or die" back in, the "or die" ran every time.  would it be better to run an "if ( !$New_Player_Query) {finnish script}" ???, or is "or die" still better???, all help is much appreciated..... thankyou
  4. ok, ive changed the directory to inc_files", but it makes no difference.  anywayz, i think that if it was a problem with the database link, the error notice within that file would show up, an not the error message from the actual query. when i give mysqli_error(), the variable of the query, it gives an error that the variable is a boolean, so does a INSERT INTO query give a different output, since it doesnt retreive data.  could that be the problem.??? once again, thanks for all your suggestions, PC Nerd
  5. youd need to do something like this ( im writing this as i think of it here, so be prepared for numerous mistakes) [code] <a href = page.php?Image=1>Link</a> [/code] thats the link on the page. you could put the <img> tag where ive said link [code] <?php if($Image == 1) { $_SESSION['image_clicks'] +=1; echo "//Javascript code here to redirect user back to your original page, if you need i can look that up in one of my books"; ?> i hope that helps, although youll have to add code to create the session, or you could use cookies, or whatever... [/code]
  6. you could always password the page your on, that starts the download, like with javascript or something simple
  7. no, sorry that doesnt work, im using xampp, ( very similar to wamp if yoiu know it) its running on windows, using apache and php 5, and mysql 5.0.21 ive trie3d everything
  8. also, does anyone think that this could be done another way, or is this the easiest way to create a new entry in the database ( new user ).  ive been working on it for about a week
  9. [code] <?php $host="localhost"; $account="*****"; $password="*****"; $dbname="battle-ages_db"; $Error_Log[1] = ""; $Error_Log[2] = ""; $DB_Server = mysqli_connect($host, $account); if(!$DB_Server){echo "<p>There was an error in connecting to the database server.  Please try again later.</p>"; $Error_Log[1] = "DB_Server";} else{} $DB = mysqli_select_db($DB_Server, $dbname); if(!$DB){echo "<p>There was an error connecting to the Database.  Please try Again later.</p>"; $Error_Log[2] = "DB_Connect";} else{} if(empty($Error_Log[1])){} elseif(empty($Error_Log[2])){} else{echo "<p>Battle_Ages apologises for any and all inconveniences caused by this fualt in the system.  We are working on fixing the connection problem.  Why not explore the public site for FAQ's and other help sections to become more aquainted with the game.</p>";} ?> [/code] thats the database link, that will be included whenever i need to connect to the database. this is the code for the previous page [code] <html> <head> <link rel="stylesheet" type="text/css" href="B_A-CSS.css"> <title>Battle Ages New Player</title> </head> <body> <?php $Wrong = "NO"; $Form = "NO"; if($_POST['Email'] != $_POST['Re_Email']){$Wrong = "YES";} foreach($_POST as $field){     if(empty($field)){         $Wrong = "YES";     } } if($Empty == "YES"){     $Form = "YES"; } else{     $Individual = "NO";     while($Individual == "NO"){         $Security_Number = rand(0, 9).rand(0, 9).rand(0, 9).rand(0, 9)." - ".rand(0, 9).rand(0, 9).rand(0, 9)." - ".rand(0, 9).rand(0,9).rand(0, 9);         $S_N_SQL = "SELECT Security_Number FROM Table_1 WHERE Security_Number = '".$Security_Number."'";         include('inc files/Database_link.inc');         $Query = @mysql_query($S_N_Query, $DB_Server);         if(!$Query){             $Individual = "YES";         }     }     } echo "<table>"; echo "<thead>\n"; echo "<td class = \"left\">\n"; echo "<img src=\"Graphics\\Draft Logo.jpg\" alt=\"Logo\" width = \"75%\" hight = \"75%\" align = \"left\">\n"; echo "</td>"; echo "<td class = \"centre\">\n"; echo "</td>"; echo "<td class = \"right\">\n"; echo "<img src=\"Graphics\\Draft Logo.jpg\" alt=\"Logo\" width = \"75%\" hight = \"75%\" align = \"right\">\n"; echo " </td>"; echo "</thead>"; echo "<tbody>"; echo "<tr>"; echo "<td class = \"left\">\n"; echo "</td>"; echo "<td class = \"centre\">\n"; echo "<center><h1>New Player</h1></center>"; if($Form == "YES"){ echo "<p>You left one of the fields blank, or your emails did not match.  Please fill in the form again.</p>"; include("inc_files/B_A-New_Player.inc"); } else{     echo "<p>Every time you login to Battle Ages, you will be required to use your User Name and your password.  In addition to this you need to fill in a sequrity section, just like the ine at the end of the previous page.  This helps to stop automated scripts playing th game for you.</p>"; echo "<p>To activate your account you must use the security number that is displayed below.  The security Number will be emailed to the address which you enter before, along wil your details (Username, Password etc.)</p>"; echo "<p>Your Security Number is: $Security_Number</p>"; echo "<br>"; echo "<p>Click Finish to submit the full form to us.  Your email will be sent within 24 hours.  After you recieve the email, login at the First Time Login page of the Battle Ages home Page.  To view that page, <a href=\"B_A-First Login.html\" alt=\"First time Login\">Click here</a>.</p>"; echo "<p>Click the Re-Start link to restart the New Player Form.  This will reset all information you have entered.</p>";     echo "<p><a href=\"B_A-New_Player.html\" alt=\"Re-Start\">Start again</a></p>\n"; echo "<form action=\"B_A-New_Player_Create.php\" action=\"POST\">\n"; echo "<p><input type = 'hidden' name = 'User_Name' value = "."'".$_POST['User_Name']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'Password' value = "."'".$_POST['Password']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'Re_Password' value = "."'".$_POST['Re_Password']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'Email' value = "."'".$_POST['Email']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'Re_Email' value = "."'".$_POST['Re_Email']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'Security_Number' value = "."'".$Security_Number."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'F_Name' value = "."'".$_POST['F_Name']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'L_Name' value = "."'".$_POST['L_Name']."'"." ></p>\n"; echo "<p><input type = 'hidden' name = 'Age' value = "."'".$_POST['Age']."'"." ></p>\n"; echo "<p><input type='submit' value='Finish'></p>"; echo "</form>"; } echo "</td>"; echo "<td right = \"right\">\n"; echo "</td>"; echo "</tr>"; echo "</tbody>"; echo "</table>"; echo "</body>"; echo "</html>"; ?> [/code]
  10. is that the Database link includefile, or the form validation
  11. no, im using the right query  becauase im using mysql v5.0.21, xampp if anyone usaes it.  but i still cant firgure it out
  12. just a pointer in the right direction. id use the images as links to a page, that adds the information to the session array, and thenk redirects to the click.php
  13. im going to be doing roughly the same thing, although i was going to have a feild called "activated", and the link would point to a page that would add the ranom generated number, in the "activated" field.  before the person activates it, that field contains NULL.  I hope thats helpfull.... i havent actually tried to do it yet
  14. [code]Warning: mysqli_error() expects parameter 1 to be mysqli, string given in FILENAME HERE[/code] on line 21
  15. hi guys.  ive been working on a text based game..., but i cannot for the life of me find the error in my scripting for adding a new user to the database ( mysql v5).  my code is bellow, and the error is with the query to add the user [code] <?php $User_Name = $_POST['User_Name']; $Password = $_POST['Password']; $Email = $_POST['Email']; $Security_Number = $_POST['Security_Number']; $F_Name = $_POST['F_Name']; $L_Name = $_POST['L_Name']; $Age = $_POST['Age']; include("inc files\Database_link.inc"); $New_Player_SQL = "INSERT INTO General_Stats ('User_Name', 'Password', 'Email', 'Security_Number', 'F_Name', 'L_Name', 'Age') VALUES ('$User_Name', '$Password', '$Email', '$Security_Number', '$F_Name', '$L_Name', '$Age')"; $New_Player_Query = mysqli_query($DB_Server, $New_Player_SQL) or die ("<h3>Error</h3>\n<br><br>\n<p>An error has occured while submitting your details to the Database.  As a result your account has not been created, although you may still receive your confirmation email.  If you do receive your Email, please ignore it, and resubmit your account request in 24 hours.</p><br><br>".mysqli_error($New_Player_SQL)); #if(!@$New_Player_Query){ # echo " #<h3>Error</h3>\n<br><br>\n<p>An error has occured while submitting your details to the Database.  As a result your account has not been created, although you may still receive your confirmation email.  If you do receive your Email, please ignore it, and resubmit your account request in 24 hours.</p>"); #} #else{ echo "<h3>Success</h3>\n<br><br>\n<p>Your account has been added to our database.  Once you receive your confirmation email, follow the link, and your account will be activated, after which you will be able to play on Battle-Ages whenever you wish.</p>"; #}[/code] The include file, Datatabse link is working fine, as the previous page use it with no problems.  if you wish me to post it though, please just let me know. i know it must be tedious, debuggingother peoples scripts, but i could really use all the help i can get, becauase ive been working on solveing this error for the last 4 hours.  Thanks all who help, PC Nerd[font=Verdana][/font][color=red][/color][color=red][/color]
  16. Im looking for a free php editor. it needs to color different code.  be able to read PHP HTML CSS SQL Javascript and it needs to be able to check my syntax with the php at least. all assistance will be of great help
  17. thanks mate, i always get confused between SQL and PHP equality testing
  18. if your expecing lots of changes to a users profile, then definately use the database, but if your not expecting much, use cookies, then the strain is on their computer.  you could simply update the script when a user logs out (tell them that any changes will not be saved unless they logout properly (not just close the browser))
  19. ok. then how would i display enrties 20 - 40 and there fore would i have to create a script that would re-rank the entrys.  (im writing a game, so the database is continually minipulated) if so, how would i write it so that it runns every, 20 minute (or like), without me having to continually manually run the script.  i want the site to be as sent maintaing as possible thanks for your help with that query, PC Nerd
  20. i want to create a page, which loops on itself, eg page.php the page sources from a very large database, so i want to display 20 entrys per page, and display them in order of points, then alphabetically.  i dont want to display enrtys multiple time. i havent written any PHP, but im thinking of how to approach this problem. All help  is much appreciated, Pc Nerd
  21. i didnt read all the script, but the following might work $feed = "INPUT FROM FEILD" include('inc_files/'.$feed/"'"); simply save your different feeds as seperate inc files. you could also create an array, which could check the input, to that sent data could be simply 1, 2,3 ,4 5, 6 7 ,8 8 etc. good luck
  22. you could also try to include the error.php, if the border styles and formating is the same.  you could use something like if(condition){include("error.php";)} i would also rename the file .inc, so that it easy to tell wht it is used for. this is sometimes good for form validation, where you want to redisplay the form, the form would simply be in the inc file
  23. this is a script that validates a users input, from a previous page.  2 problems, 1.    the information is being sent as get ($_GET)  but the form says <form action = 'validation_form.php' action = 'post'> 2.    the form is continually displayed, even when the information is correct the form is continually displayed through an include file.  if the previous data is wrong, then redisplay the form, which send to the same page checks then loops. i cant seem to get the validation to work [code]<html> <head> <link rel="stylesheet" type="text/css" href="B_A-CSS.css"> <title>New</title> </head> <body> <?php $Wrong = "NO"; $Form = "NO"; if($_POST['Email'] != $_POST['Re_Email']){$Wrong = "YES";} foreach($_POST as $field){     if(empty($field)){         $Wrong = "YES";     } } if($Empty = "YES"){     $Form = "YES"; } else{     $Individual = "NO";     while($Individual == "NO"){         $Security_Number = rand(0, 9).rand(0, 9).rand(0, 9).rand(0, 9)." - ".rand(0, 9).rand(0, 9).rand(0, 9)." - ".rand(0, 9).rand(0, 9).rand(0, 9);         $S_N_SQL = "SELECT Security_Number FROM Table_1 WHERE Security_Number = '".$Security_Number."'";         include('inc files/Database link.inc');         $Query = @mysql_query($S_N_Query, $DB_Server);         if(!$Query){             $Individual = "YES";         }     }     setcookie("User_Name", "'".$_POST['User_Name']."'", strtotime(' + 1 day'));     setcookie("Password", "'".$_POST['Password']."'", strtotime(' + 1 day'));     setcookie("Email", "'".$_POST['Email']."'", strtotime(' + 1 day'));     setcookie("Security_Code", "'".$Security_Number."'", strtotime(' + 1 day'));     $mailaddress = "'".$_POST['Email']."'";     $subject = "Confirmation Email";     $message = "This email is to confirm your request to join.  This email is in html format.  If you would like a text version, please email us, EMAIL.  The following email, contains all of the information you entered when you signed up. <br>User Name: "."'".$_POST['User_Name']."'"."<br>Password: "."'".$_POST['Password']."'"."<br>You have 24 hours to activate your acount by logging in.  To activate your account, go to <a href = SITE NAME>this page</a>.  If you do not activate within 24 hours, you will need to re-enter your details and sign up again.  Goodluck with your playing.<br><br><br>Battle-Ages Staff";     $header = "Signup Confirmation";     $header . "From: EMAIL";     mail($mailaddress,$subject,$message,$header); } echo "<table>"; echo "<thead>\n"; echo "<td class = \"left\">\n"; echo "<img src=\"Graphics\\Draft Logo.jpg\" alt=\"Logo\" width = \"50%\" hight = \"50%\">\n"; echo "</td>"; echo "<td class = \"centre\">\n"; echo "</td>"; echo "<td class = \"right\">\n"; echo "<img src=\"Graphics\\Draft Logo.jpg\" alt=\"Logo\" width = \"50%\" hight = \"50%\">\n"; echo " </td>"; echo "</thead>"; echo "<tbody>"; echo "<tr>"; echo "<td class = \"left\">\n"; echo "</td>"; echo "<td class = \"centre\">\n"; echo "<center><h1>New Player</h1></center>"; if($Form == "YES"){ echo "<p>You left one of the fields blank, or your emails did not match.  Please fill in the form again.</p>"; include("inc_files/B_A-New_Player.inc"); } else{     echo "<p>Every time you login, you will be required to use your User Name and your password.  In addition to this you need to fill in a sequrity section, just like the ine at the end of the previous page.  This helps to stop automated scripts playing th game for you.</p>"; echo "<p>To activate your account you must use the security number that is displayed below.  The security Number will be emailed to the address which you enter before, along wil your details (Username, Password etc.)</p>"; echo "<p>Your Security Number is: $Security_Number</p>"; echo "<br>"; echo "<p>Click Finish to submit the full form to us.  Your email will be sent within 24 hours.  After you recieve the email, login at the First Time Login page which has a link from the email.  To view that page, <a href=\"B_A-First Login.html\" alt=\"First time Login\">Click here</a>.</p>"; echo "<p>Click the Re-Start link to restart the New Player Form.  This will reset all information you have entered.</p>"; echo "<form action=\"B_A-New_Create.php\" action=\"POST\">";     echo "<p><a href=\"B_A-New Player.html\" alt=\"Re-Start\">Start again</a></p>\n";     echo "<p><input type=\"submit\" value=\"Finish\"></p>";                 echo "</form>"; } echo "</td>"; echo "<td right = \"right\">\n"; echo "</td>"; echo "</tr>"; echo "</tbody>"; echo "</table>"; echo "</body>"; echo "</html>";[/code] THIS IS THE INC FILE WHICH IS THE FORM [code]<?php echo "<form action='B_A-New_Player_Valid.php' action='post'>"; echo " <p>User Name: <input type='text' name='User Name'></p>"; echo " <p>Password: <input type='password' name='Password'></p>"; echo " <p>Re-Enter Password: <input type='password' name='Re_Password'></p>"; echo " <hr>"; echo " <p>Email: <input type='text' name='Email'></p>"; echo " <p>Re-Enter Email: <input type='text' name='Re_Email'></p>"; echo " <hr>"; echo " <P>Terms And Conditions: <input type='checkbox' name='terms and conditions'></p>"; echo " <P>Privacy Policy: <input type='checkbox' name='Privacy Policy'></p>"; echo " <p><input type = 'submit' value = 'submit'></p>"; echo " <p><input type = 'reset' value = 'reset'></p>"; echo "</form>"; ?>[/code] i dont need to include the other inc files, because i can tell that the error is in the loop. all help is appreciated P.S please dont comment about any bad formating.  I am coppying from a page which reformats to a word wrap style look, but infact creates tabs and all sorts.  im trying to change it.  especially the loops may be a little messy. 
×
×
  • 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.