Jump to content

kaosjon

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by kaosjon

  1. Hi, i am thinking of creating a text based game mmorpg using php/mysql etc... I know that a lot of these types of games use a tick based system, but i want it to be realtime, the only game i cna find that uses this is Torn, does anyone know how they make it realtime? I know that ticks can be controlled by cronjobs, but how about realtime? The problem is that the game might involve the player building a house, in a tick based system it could be easy to manage by saying the house will take 3 ticks to complete, but i want the house to be like in 10 minutes of 32 minutes, how can i do this. Someone said to check whenever the player next logs in to check if the house has finished and then say it has been built, but seeing as it is an mmorpg it could affect everyones gameplay, not just the person building it, so this will not work. Thanks and sorry if this is a bit confusing.
  2. Yes i did, but i think it just installs the whole upload process of which i don't want to change from mine, i had a bit more of a look and i think what i want is iframing, but not sure.
  3. Hi thanks for the reply, but my website already uplaods files, i just want to make it look more professional, so when the file is uploading a box appears in the middle of the screen saying something like scanning/uploading, i want to be able to code this myself. Any ideas on how i can do that?
  4. i am currently trying to add a uploading/scanning screen to my file upload site, (just to be clear i need the 'design' part of it, like actually displaying the box not anything to do with the scanners, or implementing the scanners, just a box that says scanning with a scanning gif next to it). Pretty much my site allows people to upload files which scans them and then displays the result. All the scanners are up and working but i am trying to add this scanning page. I want it to look a bit like this when you upload a file - www.virustotal.com How would I be able to do this? You don't have to be very specific just like what programming languages, or any examples of code, to help me, i don't really know where to start. Here is my website www.zerovirus.org Thanks for your help
  5. Hi, i am developing a website that involves members uploading files. For better security i want to be able to scan the file with a variety of AV scanners. I have done some research and the easiest way to do this seems to use command line scanners. I am currently testing on my own computer using xampp. The problem is when i run the scan it displays the output 0 which means no virus found and i know that the file is infected because i ran the same AV scan through the windows command prompt and it found the virus. Here is the code <?php exec("C:\\Program Files (x86)\AVG\AVG2012\avgscana.exe\ /SCAN=daniel_crypted.exe/"); $result = exec("echo %ERRORLEVEL%"); ?> Any ideas why it is doing this? Thanks
  6. Hi i am having a little trouble with my jquery tabs, for some reason it loads the first tab content, but when i select another tab the content is not displayed. When i try to go back to the first tab it doesnt load either. Here is the html <div id="content"> <div id="tabsX"> <div id="tabContent"> <ul class="tabs"> <li><a id="all" href="#all" class="all">All</a></li> <li><a id="free" href="#free" class="free">Free</a></li> <li><a id="paid" href="#paid" class="paid">Paid</a></li> <li><a id="completed" href="#completed" class="completed">Completed</a></li> <div id="filter"><select name="filterQuest"> <option>Name</option> <option>Payout</option> <option>Difficulty</option> </select></div> </ul> <div class="tab_container"> <div id="all" class="tab_content"> asddd </div> <div id="free" class="tab_content"> <!--Content-->adadada </div> <div id="paid" class="tab_content"> <!--Content-->adad </div> <div id="completed" class="tab_content"> <!--Content-->adsasd </div> </div><!--- end tab_container---> </div><!---end tab content---> <br class="clear" /> </div><!--- end tabsX---> <div id="tournament"></div><!--- end tournament---> </div><!--- end content---> Here is the javascript <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </script> Any Ideas, Thanks
  7. Hi, thanks for the reply, the div i want to center is #accountContent and i want it to expand horizontally. Is there anything i can do to make this work? Thanks
  8. Hi i am trying to center a div that auto expands depending on the content, however the div must be fixed positioned with a background that can also expand and contract with the div. I have gotten pretty far with the coding of this, however have struck a problem that i can't seem to fix. So far the div expands and contracts depending on the content and is fixed positioned, but it is not centered and won't center for some reason. Here is the html <div id="accountBar"> <div id="accountContent">sdfsdfsdffsdf</div><!---end accountContent---> </div><!--- end accountBar---> Here is the css #accountBar { height: 56px; width: 100%; border: thin dotted #333; margin-top: 56px; margin-right: auto; margin-bottom: 0; margin-left: auto; position: fixed; } #accountBar #accountContent { height: 56px; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; background-image: url(../images/accountBar.png); background-repeat: repeat-x; display: inline-block; padding-right: 10px; padding-left: 10px; } Thanks for any help you can give
  9. Hi i am trying to develop my registration page it is a combination of multistep (tabs) with real time validation which is sort of working ok, it validates on entry which is really good, however when i include the script JavaScript / DHTML / AJAX Syntax (Toggle Plain Text) <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script> which is for the form validation, for some reason the next button for the tabs do not work, when i take it out the next buttons work but the form validation does not. Any ideas? All the code for the next button is at the bottom of the code below, the code for the validation is in a seperate file and is pretty big, so ask if you want me to include it. Thanks for the help JavaScript / DHTML / AJAX Syntax (Toggle Plain Text) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <!-- This is a jQuery Tools standalone demo. Feel free to copy/paste. http://flowplayer.org/tools/demos/ Do *not* reference CSS files and images from flowplayer.org when in production Enjoy! --> <head> <title>jQuery Tools standalone demo</title> <!-- include the Tools --> <script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script> <script type="text/javascript" src="registration_validation.js" charset="utf-8"></script> <!-- standalone page styling (can be removed) --> <link rel="stylesheet" type="text/css" href="standalone.css"/> <link rel="stylesheet" type="text/css" href="scrollable.css"/> <!-- a little more standalone page styling --> <style> body { padding-top:5%; } </style> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- twitter style notification bar for validation errors --> <div id="drawer">Please fill in the empty fields marked with a <samp style="color:red">red</samp> border.</div> <!-- the form --> <form id="jform" action="#"> <div id="wizard"> <div class="items"> <!-- page1 --> <div class="page"> <h3> <strong>Step 1: </strong> Account Information <em>Please enter your login information:</em> </h3> <ul> <li class="required double"> <label> <strong>1.</strong> FirstName <span>*</span><br /> <input type="text" class="text" name="firstname" id="firstname"/> </label> <label> <strong>1.</strong> LastName <span>*</span><br /> <input type="text" class="text" name="lastname" id="lastname"/><br /> </label> </li> <!-- email --> <li class="required"> <label> <strong>1.</strong> Enter Your Email Address <span>*</span><br /> <input type="text" class="text" name="email" id="email"/> </label> </li> <!-- username --> <li class="required"> <label> <strong>2.</strong> Pick a username <span>*</span><br /> <input type="text" class="text" name="username" id="username"/> </label> </li> <!-- password --> <li class="required double"> <label> <strong>3.</strong> Choose a Password <span>*</span><br /> <input type="password" class="text" name="password" id="password"/> <em>Must be at least 8 characters long.</em> </label> <label> Verify Password <span>*</span><br /> <input type="password" class="text" name="cpassword" id="cpassword"/> </label> </li> <li class="clearfix"> <button type="button" class="next right">Proceed »</button> </li> </ul> </div> <!-- page2 --> <div class="page"> <h3> <strong>Step 2: </strong> Kingdom Information <b></b> <em>Tell us about Your Kingdom:</em> </h3> <ul> <!-- address --> <li class="required double"> <br /> <label> <strong>1.</strong> Kingdom Name <span>*</span><br /> <input type="text" class="text" name="kingdom_name" id="kingdom_name"/> </label> </li> <li class="double"> <label> <strong>2.</strong> Referal <br /> <input type="text" class="text" name="referal" id="referal"/> </label> </li> <h3><strong>Step 3: </strong> Payment Information <b></b> <em>Tell us your Payment Information:</em> </h3> <br /> <li class="required"> <label> <strong>1.</strong> Paypal Email <span>*</span><br /> <input type="text" class="text" name="paypal_email" id="paypal_email"/> </label> </li> <li class="required double"> <label> <strong>2.</strong> Country <span>*</span> <select name="country" id="country"> <option value="">-- please select --</option> <option>PayPal</option> <option>AlertPay</option> <option>MoneyBookers</option> </select> </label> <label> <strong>2.</strong> Payment Method <span>*</span> <select name="payment_method" id="payment_method"> <option value="">-- please select --</option> <option>PayPal</option> <option>AlertPay</option> <option>MoneyBookers</option> </select> </label> </li> <li class="clearfix"> <button type="button" class="prev" style="float:left">« Back</button> <button type="button" class="next right">Proceed »</button> </li> <br clear="all" /> </ul> </div> <!-- page3 --> <div class="page"> <h2> <strong>Step 3: </strong> Congratulations! <b></b> <em>You are now a happy member of the Open Source community</em> </h2> <p> <textarea id="oath" name="oath" cols="50" rows="8" readonly>ajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs d</textarea> </p> <p> <input name="newsletter" type="checkbox" id="newsletter" value="" checked /> <label for="newsletter"> Sign Up for the Monthly Telegram.</label> </p> <li class="required"> <p> <input name="agree" type="checkbox" id="agree" value="" /> <label for="agree"> I Swear To Obey the Oath Held Before Me.</label> </p> </li> <p style="margin-top:30px"> <button type="button" class="prev" style="float:left">« Back</button> <input name="send" id="send" type="submit" style="float:right"/> </p> </div> </div><!--items--> </div><!--wizard--> </form> <script> $(function() { var root = $("#wizard").scrollable(); // some variables that we need var api = root.scrollable(), drawer = $("#drawer"); // validation logic is done inside the onBeforeSeek callback api.onBeforeSeek(function(event, i) { // we are going 1 step backwards so no need for validation if (api.getIndex() < i) { // 1. get current page var page = root.find(".page").eq(api.getIndex()), // 2. .. and all required fields inside the page inputs = page.find(".required :input").removeClass("error"), // 3. .. which are empty empty = inputs.filter(function() { return $(this).val().replace(/\s*/g, '') == ''; }); // if there are empty fields, then if (empty.length) { // slide down the drawer drawer.slideDown(function() { // colored flash effect drawer.css("backgroundColor", "#FEA7A7"); setTimeout(function() { drawer.css("backgroundColor", "#FEA7A7"); }, 1000); }); // add a CSS class name "error" for empty & required fields empty.addClass("error"); // cancel seeking of the scrollable by returning false return false; // everything is good } else { // hide the drawer drawer.slideUp(); } } // update status bar $("#status li").removeClass("active").eq(i).addClass("active"); }); // if tab is pressed on the next button seek to next page root.find("button.next").keydown(function(e) { if (e.keyCode == 9) { // seeks to next tab by executing our validation routine api.next(); e.preventDefault(); } }); }); </script> </body> </html>
  10. Sorry i thought i put code tags in, i can't find where to edit the post though
  11. Hi i am trying to develop my registration page it is a combination of multistep (tabs) with real time validation which is sort of working ok, it validates on entry which is really good, however when i include the script JavaScript / DHTML / AJAX Syntax (Toggle Plain Text) <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script> which is for the form validation, for some reason the next button for the tabs do not work, when i take it out the next buttons work but the form validation does not. Any ideas? All the code for the next button is at the bottom of the code below, the code for the validation is in a seperate file and is pretty big, so ask if you want me to include it. Thanks for the help JavaScript / DHTML / AJAX Syntax (Toggle Plain Text) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <!-- This is a jQuery Tools standalone demo. Feel free to copy/paste. http://flowplayer.org/tools/demos/ Do *not* reference CSS files and images from flowplayer.org when in production Enjoy! --> <head> <title>jQuery Tools standalone demo</title> <!-- include the Tools --> <script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script> <script type="text/javascript" src="registration_validation.js" charset="utf-8"></script> <!-- standalone page styling (can be removed) --> <link rel="stylesheet" type="text/css" href="standalone.css"/> <link rel="stylesheet" type="text/css" href="scrollable.css"/> <!-- a little more standalone page styling --> <style> body { padding-top:5%; } </style> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- twitter style notification bar for validation errors --> <div id="drawer">Please fill in the empty fields marked with a <samp style="color:red">red</samp> border.</div> <!-- the form --> <form id="jform" action="#"> <div id="wizard"> <div class="items"> <!-- page1 --> <div class="page"> <h3> <strong>Step 1: </strong> Account Information <em>Please enter your login information:</em> </h3> <ul> <li class="required double"> <label> <strong>1.</strong> FirstName <span>*</span><br /> <input type="text" class="text" name="firstname" id="firstname"/> </label> <label> <strong>1.</strong> LastName <span>*</span><br /> <input type="text" class="text" name="lastname" id="lastname"/><br /> </label> </li> <!-- email --> <li class="required"> <label> <strong>1.</strong> Enter Your Email Address <span>*</span><br /> <input type="text" class="text" name="email" id="email"/> </label> </li> <!-- username --> <li class="required"> <label> <strong>2.</strong> Pick a username <span>*</span><br /> <input type="text" class="text" name="username" id="username"/> </label> </li> <!-- password --> <li class="required double"> <label> <strong>3.</strong> Choose a Password <span>*</span><br /> <input type="password" class="text" name="password" id="password"/> <em>Must be at least 8 characters long.</em> </label> <label> Verify Password <span>*</span><br /> <input type="password" class="text" name="cpassword" id="cpassword"/> </label> </li> <li class="clearfix"> <button type="button" class="next right">Proceed »</button> </li> </ul> </div> <!-- page2 --> <div class="page"> <h3> <strong>Step 2: </strong> Kingdom Information <b></b> <em>Tell us about Your Kingdom:</em> </h3> <ul> <!-- address --> <li class="required double"> <br /> <label> <strong>1.</strong> Kingdom Name <span>*</span><br /> <input type="text" class="text" name="kingdom_name" id="kingdom_name"/> </label> </li> <li class="double"> <label> <strong>2.</strong> Referal <br /> <input type="text" class="text" name="referal" id="referal"/> </label> </li> <h3><strong>Step 3: </strong> Payment Information <b></b> <em>Tell us your Payment Information:</em> </h3> <br /> <li class="required"> <label> <strong>1.</strong> Paypal Email <span>*</span><br /> <input type="text" class="text" name="paypal_email" id="paypal_email"/> </label> </li> <li class="required double"> <label> <strong>2.</strong> Country <span>*</span> <select name="country" id="country"> <option value="">-- please select --</option> <option>PayPal</option> <option>AlertPay</option> <option>MoneyBookers</option> </select> </label> <label> <strong>2.</strong> Payment Method <span>*</span> <select name="payment_method" id="payment_method"> <option value="">-- please select --</option> <option>PayPal</option> <option>AlertPay</option> <option>MoneyBookers</option> </select> </label> </li> <li class="clearfix"> <button type="button" class="prev" style="float:left">« Back</button> <button type="button" class="next right">Proceed »</button> </li> <br clear="all" /> </ul> </div> <!-- page3 --> <div class="page"> <h2> <strong>Step 3: </strong> Congratulations! <b></b> <em>You are now a happy member of the Open Source community</em> </h2> <p> <textarea id="oath" name="oath" cols="50" rows="8" readonly>ajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs dajsdnja daj da dh aj dja dj ajd ajhs d</textarea> </p> <p> <input name="newsletter" type="checkbox" id="newsletter" value="" checked /> <label for="newsletter"> Sign Up for the Monthly Telegram.</label> </p> <li class="required"> <p> <input name="agree" type="checkbox" id="agree" value="" /> <label for="agree"> I Swear To Obey the Oath Held Before Me.</label> </p> </li> <p style="margin-top:30px"> <button type="button" class="prev" style="float:left">« Back</button> <input name="send" id="send" type="submit" style="float:right"/> </p> </div> </div><!--items--> </div><!--wizard--> </form> <script> $(function() { var root = $("#wizard").scrollable(); // some variables that we need var api = root.scrollable(), drawer = $("#drawer"); // validation logic is done inside the onBeforeSeek callback api.onBeforeSeek(function(event, i) { // we are going 1 step backwards so no need for validation if (api.getIndex() < i) { // 1. get current page var page = root.find(".page").eq(api.getIndex()), // 2. .. and all required fields inside the page inputs = page.find(".required :input").removeClass("error"), // 3. .. which are empty empty = inputs.filter(function() { return $(this).val().replace(/\s*/g, '') == ''; }); // if there are empty fields, then if (empty.length) { // slide down the drawer drawer.slideDown(function() { // colored flash effect drawer.css("backgroundColor", "#FEA7A7"); setTimeout(function() { drawer.css("backgroundColor", "#FEA7A7"); }, 1000); }); // add a CSS class name "error" for empty & required fields empty.addClass("error"); // cancel seeking of the scrollable by returning false return false; // everything is good } else { // hide the drawer drawer.slideUp(); } } // update status bar $("#status li").removeClass("active").eq(i).addClass("active"); }); // if tab is pressed on the next button seek to next page root.find("button.next").keydown(function(e) { if (e.keyCode == 9) { // seeks to next tab by executing our validation routine api.next(); e.preventDefault(); } }); }); </script> </body> </html>
  12. Hi, i have added a section to my website where it loops each record, and it does this pretty well, however i want to add a button that if pressed closes the record, like an ignore button, would this require a database where it stores the record closed so that it never opens it to the user again. Any ideas you have about this i could use. Heres my code for the loop. <?php while($row = mysql_fetch_assoc($sql_cpa)) : ?> <?php extract($row);?> <div class="offers"> <div class="picture"><img src="images/images.jpg" width="125" height="125" /></div><!----end picture----> <div class="offer_content"> <div class="offer_info"> <h6><?php print "$name";?></h6><p><?php print "$description";?></p> <p><?php print "$requirements";?></p> </div><!----end offer_info----> <div class="offer_tools"> <h6><?php print "$penny_value";?></h6> <p>Pennies</p> <h6><a href="<?php print "$url";?>user_id=<?php print "$id";?>&offer_id=<?php print "$offerid";?>">Begin</a></h6> <h6>CLOSE</h6> </div><!----end offer_tools----> </div><!----end offer_content----> <div class="cpa_footer"> <p>Payout: <?php print "$payout";?> || Difficulty: <?php print "$difficulty";?> || <?php print "$free";?></p> </div><!----end cpa_footer----> </div><!----end offers----> <?php endwhile ?> The close button is located in the offer_tools div. Thanks for your help
  13. Hi, i have been learning to build websites for the past year and mainly focus on server side coding, however for my next website i want to concentrate on the client side usability and search engines. I was wondering what the best way is to design a website before adding all the php etc... I usually build the website first in photoshop, slice it then export as web and devices, i then add the php after in dreamweaver. I was wondering if there was a better way to create better functionality and better results to search engines. Also, are most of the big websites built in this way also or are there alternatives. Thanks for your help.
  14. Ok thanks for the help, i am looking at it now, looks more confusing than i thought it would be, but i will give it a shot. Thanks
  15. Hi iam currently writing some code for my website and i have a number of records that i simply want to display in a table format, i have done this in a while loop and it works well, however i only want to display a maximum of 10 records per page as my div needs to be a fixed height and was wondering how i could include a next button that would act as like a page number. The thing is at any given point there could be from 1 record to display to 500, so i need a way of allowing the user to quickly navigate to the other records. How can i do this without using mulitple pages. Hope this makes sense. Heres my code <?php echo"<table width='100%' border='1' align='center'><tr><th>Referal Name</th><th>Amount Received</tr>"; while ($row = mysql_fetch_array($sql_info)) { extract($row); echo "<tr><td align='center'>".$username."</td><td align='center'>".$cumulative_referral."</td></tr>"; } echo "</table>"; ?> Thanks for your help
  16. Hi, yes i do have columns in my database with those names, i managed to fix it, for now. Heres my final code not sure what i done, just played around with it. Thanks for your help $upgrade_rank = mysql_query("SELECT rank FROM user_info WHERE id='$id'"); $user_array = mysql_fetch_assoc($upgrade_rank); $real_rank = $user_array['rank']; $upgrade_balance = mysql_query("SELECT balance FROM user_info WHERE id='$id'"); $user_array = mysql_fetch_assoc($upgrade_balance); $real_balance = $user_array['balance']; var_dump($real_rank); var_dump($real_balance); if(($real_rank == 'merchant') && ($real_balance > 500)){ $n1x = '<a href="upgrades_info.php?userid=$id&rank=noble"><img src="images/noble.jpg" width="170" height="200" /></a>'; } else { $n1x = '<img src="images/noblex.jpg" width="170" height="200" />'; }
  17. Hi, i just tried changing the $id in the if ststement to an actual id (36) and it still displayed the variables as being NULL. Not sure what to do
  18. Hi, thanks for the help They show NULL NULL Thanks
  19. Hi, i have written a section of code for my website and i have been trying to get it to work but whatever i try it will not work Here is the code $upgrade_user = mysql_query("SELECT * FROM user_info WHERE id='$id'"); while($row = mysql_fetch_array($upgrade_user)){ $real_balance = $row["$balance"]; $real_rank = $row["$rank"]; } echo $real_balance; if($real_rank == 'merchant' && $real_balance > '500'){ $n1x = '<a href="upgrades_info.php?userid=$id&rank=noble"><img src="images/noble.jpg" width="170" height="200" /></a>'; } else { $n1x = '<img src="images/noblex.jpg" width="170" height="200" />'; } It should outbut the first if, but instead it keeps displaying the else, i have checked the $real_rank and it matches merchant and the $real_balance is over 500. Any ideas? I am guessing its a simple error in the way i have written it, but i can't seem to get it to work. Thanks
  20. Hi, i thought about what you said and i think i found an easier way to do this by adding the username field to the referrals table, that way i don't have to keep searching for the id, i can use the referal variable already stored in the code higher up in the script. Heres the new code but it still does not work if($referal_check > 0) { mysql_query("UPDATE referrals SET no_of_referrals = no_of_referrals + '1' WHERE username = '$referal'"); } I tested the query in the sql query page in phpmyadmin changing the $referal to the referal a user would enter and it worked, but for some reason it is not working when i add the query to my site. Any other ideas, thanks
  21. Hi, i am just adding the last component to my registration page, but i am having a little trouble with it. Basically my website includes a referal based system, wherebye when the user signs up they can add a referal that benefits the referal later on. The code i am trying to add is to increase the number of referals a member has by 1. It might sound a bit confusing and trust me its taken a few hours to get my head around it, but my code must find the information of the referal and update their number of referals by 1. The code i have below is what i think should work, but it does not update the number of referals by 1. if($referal_check > 0) { //Select everything from user_info where the username is the same as the referal entered by registering user $sql_referal = ("SELECT * FROM user_info WHERE username = $referal"); $result = mysql_query($sql_result); $referal_fetch = mysql_fetch_array($result); //Select everything from referrals table where the id in the table is the same as the id from user from $sql_referal query $sql_referrals = ("SELECT * FROM referrals WHERE id = $id"); $result_referal = mysql_query($sql_referrals); $referrals_fetch = mysql_fetch_array($result_referal); //Update referrals table setting the no_of referals to + 1 where the id is the same as the id from $sql_referrals mysql_query("UPDATE referrals SET no_of_referrals = no_of_referrals + '1' WHERE id = $id"); } The referal_check is a query to find whether the referal exists in the system, the code is below $sql_referal_check = mysql_query("SELECT username FROM user_info WHERE username='$referal'"); $referal_check = mysql_num_rows($sql_referal_check); Sorry if this is a bit confusing, please ask if you need some more clarification on the code. Thanks
  22. Yes i am using IPv6, its not a concern at the moment as i am still on testing the website locally, when i start testing on the actual internet, then i think i will get a better idea of if it is a concern. Thanks for your help
  23. Thanks for your help, i must be up too late, i normally would write it like that, and good news is that it works and inserts into the new table aswell. Rather than creating a whole new thread and just out of curiosity, is there any reason why the ip_address field is showing as ::1 in my database and not an actual ip address, is it because i am using the computer? Thanks
  24. i am currently in the process of creating a registration page for my website, i have managed to make it work and it adds the user to my main table user_info, however i also have other tables that i want the system to insert the user into when they join, such as a log for their ip address, the problem is i thought it would be a simple cas of selecting the user info and then inserting the fields into the ip_address table, but i keep getting the error "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 'terminated')' at line 1" Anyway here is the code that i just added that created the error $sql_id = ("SELECT * FROM user_info WHERE username = '$username'"); $result = mysql_query($sql_id); $sql_result = mysql_fetch_array($result); $sql = mysql_query("INSERT INTO ip_log (id, ip_log) VALUES ('$id', '$ipaddress'") or die (mysql_error()); And the code below is the code for the whole registration page. Thanks <?php if (isset ($_POST['firstname'])){ $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $username = preg_replace('#[^A-Za-z0-9]#i', '', $_POST['username']); // filter everything but letters and numbers $email = $_POST['email']; $password = $_POST['password']; $cpassword = $_POST['cpassword']; $paypal_email = $_POST['paypal_email']; $country = $_POST['country']; $kingdom_name = $_POST['kingdom_name']; $kingdom_motto = $_POST['kingdom_motto']; $referal = $_POST['referal']; $email = stripslashes($email); $password = stripslashes($password); $cpassword = stripslashes($cpassword); $email = strip_tags($email); $password = strip_tags($password); $cpassword = strip_tags($cpassword); // Connect to database include_once "connect_to_mysql.php"; $emailCHecker = mysql_real_escape_string($email); $emailCHecker = str_replace("`", "", $emailCHecker); // Database duplicate username check setup for use below in the error handling if else conditionals $sql_uname_check = mysql_query("SELECT username FROM user_info WHERE username='$username'"); $uname_check = mysql_num_rows($sql_uname_check); // Database duplicate e-mail check setup for use below in the error handling if else conditionals $sql_email_check = mysql_query("SELECT email FROM user_info WHERE email='$emailCHecker'"); $email_check = mysql_num_rows($sql_email_check); // Error handling for missing data if ((!$firstname) || (!$lastname) || (!$username) || (!$email) || (!$password) || (!$cpassword) || (!$paypal_email) || (!$kingdom_name) || (!$kingdom_motto)) { $errorMsg = 'ERROR: You did not submit the following required information:<br /><br />'; if(!$firstname){ $errorMsg .= ' * Firstname<br />'; } if(!$lastname){ $errorMsg .= ' * Lastname<br />'; } if(!$username){ $errorMsg .= ' * Username<br />'; } if(!$email){ $errorMsg .= ' * Email<br />'; } if(!$password){ $errorMsg .= ' * Password<br />'; } if(!$cpassword){ $errorMsg .= ' * Password Check<br />'; } if(!$paypal_email){ $errorMsg .= ' * Paypal Email<br />'; } if(!$kingdom_name){ $errorMsg .= ' * Kingdom Name<br />'; } if(!$kingdom_motto){ $errorMsg .= ' * Kingdom Motto<br />'; } } else if ($password != $cpassword) { $errorMsg = 'ERROR: Your Password fields below do not match<br />'; } else if (strlen($username) < 4) { $errorMsg = "<u>ERROR:</u><br />Your User Name is too short. 4 - 20 characters please.<br />"; } else if (strlen($username) > 20) { $errorMsg = "<u>ERROR:</u><br />Your User Name is too long. 4 - 20 characters please.<br />"; } else if ($uname_check > 0){ $errorMsg = "<u>ERROR:</u><br />Your User Name is already in use inside of our system. Please try another.<br />"; } else if ($email_check > 0){ $errorMsg = "<u>ERROR:</u><br />Your Email address is already in use inside of our system. Please use another.<br />"; } else { // Error handling is ended, process the data and add member to database //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $email = mysql_real_escape_string($email); $password = mysql_real_escape_string($password); // Add MD5 Hash to the password variable $db_password = md5($password); // GET USER IP ADDRESS $ipaddress = getenv('REMOTE_ADDR'); // Add user info into the database table for the main site table $sql = mysql_query("INSERT INTO user_info (firstname, lastname, username, email, password, country, sign_up_date) VALUES('$firstname','$lastname','$username','$email','$password', '$country', now())") or die (mysql_error()); $id = mysql_insert_id(); // Create directory(folder) to hold each user's files(pics, MP3s, etc.) mkdir("members/$id", 0755); //////////////////////////////////////////////////////////////////////// ///////////////BUILDING THE USER PROFILES/////////////////////////////// $sql_id = ("SELECT * FROM user_info WHERE username = '$username'"); $result = mysql_query($sql_id); $sql_result = mysql_fetch_array($result); $sql = mysql_query("INSERT INTO ip_log (id, ip_log) VALUES ('$id', '$ipaddress'") or die (mysql_error()); include_once 'registration_success.php'; exit(); } // Close else after duplication checks } else { // if the form is not posted with variables, place default empty variables so no warnings or errors show $errorMsg = ""; $firstname = ""; $lastname = ""; $username = ""; $email = ""; $password= ""; $cpassword = ""; $paypal_email = ""; $kingdom_name = ""; $kingdom_motto = ""; $referal = ""; } ?>
  25. Hi, thanks for the reply, i done what you said and it seems to work slightly, it adds the payout to the balance and updates it, but when i tried it again, it should add the payout to the balance but it doesn't. In other words the first time i tried it the balance went from 0 to 1 because the payout is 1, however the second time i tried it the balance remained at 1 and did not change. It should have gone to 2. I am not sure what is not working in the code, any ideas? Thanks for the help.
×
×
  • 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.