I have a website that gets a lot of visitors a month. And the server cannot handle the traffic. I have a dedicated server. How can I run the site on multiple dedicated servers?

Member Avatar
Member Avatar
+0 forum 16

Hey guys, I have the following code... And what I want it to do but cant get it to do is add up all the price fields and change the sum every time a number is changed or a new line is added... but its not working? Can anyone see my problem? And can help me fix this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="./jquery-1.7.min.js"></script> <script type="text/javascript"> function calculateSum() { var sum = 0; $("#price").each(function() { //add only if the value is number if(!isNaN(this.value) && this.value.length!=0) { sum …

Member Avatar
Member Avatar
+0 forum 4

Hello to all, I am trying to execute a mysql query for selecting * rows from the table where user name = [one of the usernames stored in an array]. Ok. Sorry if I am not clear. Now I have an array naming $users[]. I want to select all the users listed in $users[] from a mysql table. Please tell me how can I do that.

Member Avatar
Member Avatar
+0 forum 5

Hello guys, its been some time now i have been strugling with this error, evertime i submit my form it give me this error "Column count doesn't match value count at row 1 " and i cant find a way around this. Any help would be very appreciated!!! <?php if($_POST['phpfunction'] == 'createUser') { createUser(); } if($_GET['phpfunction'] == 'verifyUser') { verifyUser(); } function createUser() { $FirstName = $_POST['firstName']; $LastName = $_POST['lastName']; $AddressLine1 = $_POST['addressLine1']; $AddressLine2 = $_POST['addressLine2']; $PostCode = $_POST['postCode']; $City = $_POST['city']; $Email = $_POST['email']; $Password = $_POST['passWord']; $verificationCode = substr(md5(uniqid(rand(),true)), 16,16); include "../include/config.php"; $sql = "SELECT * FROM `User` …

Member Avatar
Member Avatar
+0 forum 1

hello guys. I'm here to ask about margin and position properties with tow example : the first is a misalignment (vertical --margin-- and horizontal --align-text-- ) of select tag, the problem is that I add align-text and margin-top properties in the CSS style, but it is invisible for the select tag, and visible for all other input tags. in the second project you gonna notice, that when I make the four div in position absolute and I put left 0, the left div and top 0, the top div .... , and I put the input (search class) in -vertical-align: …

Member Avatar
Member Avatar
+0 forum 6

i am getting this problem `URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.` any solution?

Member Avatar
Member Avatar
+0 forum 5

Hi guys, I am trying to implement my first carousel on my website. I have 5 images with the same dimensions with the following HTML markup: <div id="myCarousel" class="carousel slide"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> <li data-target="#myCarousel" data-slide-to="3"></li> <li data-target="#myCarousel" data-slide-to="4"></li> <li data-target="#myCarousel" data-slide-to="5"></li> </ol> <div class="carousel-inner"> <div class="item active"> <img src="/pictures/home1.jpg" alt="CASHS" > </div> <div class="item"> <img src="/pictures/home4.jpg" alt="SWAROVSKI"> </div> <div class="item"> <img src="/pictures/home2.jpg" alt="MARQUIS" > </div> <div class="item"> <img src="/pictures/home3.jpg" alt="ORREFORS" > </div> <div class="item"> <img src="/pictures/home5.jpg" alt="WATERFORD" > </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev"> <span class="glypicon glypicon-cheveron-left"></span> </a> <a …

Member Avatar
Member Avatar
+0 forum 6

hi, I am created 3 tables for 1> category 2> subcategory 3> projectdetail In my website folder structure root-index.php, header.php footer.php folder- about -index.php and other files folder - project- index.php folder - err- 404.php In my php page project/index.php i make left column dynamic, i.e call value from table e.g School project ( this is category) and href link is project/School project xyz (subcategory) and href link is project/xyz abc and href link is project/abc College project www yyy I want do like when click on link project/School project It should display that project but id gives me error …

Member Avatar
Member Avatar
+0 forum 22

hi im attempting to update a php srcipt and fixing errors and i have a error in the following block but cannot work out where if($_SERVER['REQUEST_METHOD']=='POST' && isset($_POST['smcomplete'])){ if(empty($_POST['abouth'])) $err_h = $aboutherorhis; elseif(strlen($_POST['abouth'])<6) $err_h = $datashort; else{ ERROR ON THIS LINE>>> $match = ($_POST['matchsame']=='on')?1:0;slBodyType'], $_POST['slHeightfrom'], $_POST['slHeightt $data = array($_POST['rdgender'], $_POST['slagefrom'], $_POST['slageto'], $_POST['slDatingInterest'], mysqli_real_escape_string($link,$_POST['abouth']), $_POST['slMarital'], $_POST['slReligion'], $_POST['slEducation'], $_POST['o'], $_POST['slSmoking'], $_POST['slDrinking'], $match); if(!yourmatch($data, $_SESSION['user_temp'])) $error = $errordata; else{ $_SESSION['memberid'] = $_SESSION['user_temp']; $_SESSION['memberemail'] = $_SESSION['email_temp']; unset($_SESSION['user_temp']); unset($_SESSION['email_temp']); mysqli_close($link); header('Location: '.$base_url.'members/myaccount.php'); exit(); } } } Ive attempted to put $_POST['slHeightt']; in but it doesnt solve error any ideas or solutions much appreciated many thanks …

Member Avatar
Member Avatar
+0 forum 1

I'm using `file_get_contents()` to parse data of a JSON file within a `foreach()` loop onto my page. <?php $url = 'data/gigs.json'; $data = file_get_contents($url); $gigs = json_decode($data, true); foreach ($gigs as $gig) { echo '<tr>'; echo '<td><time>' . $gig['date'] . '</time></td>'; echo '<td>' . $gig['event_venue'] . '</td>'; echo '<td>' . $gig['location'] . '</td>'; echo '<td><a class="btn btn-primary external" href="' . $gig['tickets_url'] . '">Buy</a></td>'; echo '</tr>'; } ?> This works fine and I also want to parse this data onto the homepage, but this time I only want to parse let's say the first 5 records of the JSON array. I …

Member Avatar
Member Avatar
+0 forum 1

Looking for conceptual help... I am writing a program in C++ to handle socket connections, eventually to be a websocket server. However, the rest of my stack uses PHP for serving up page. Is there a way to use PHP as an intermediary between the client (JS) and the application (so I don't have to keep track of session data or state in the database to retrieve with each incoming socket request)? I understand I can't pass the resource (a socket) to the application from PHP, but could I do a 302 with the request from the client? Could I …

Member Avatar
Member Avatar
+0 forum 3

hi... this is my index page... include("config.php"); session_start(); if($_SERVER["REQUEST_METHOD"] == "POST") { // username and password sent from form $myusername=addslashes($_POST['username']); $mypassword=addslashes($_POST['password']); $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $sql="SELECT id FROM admin WHERE username='$myusername' and passcode='$mypassword'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $active=$row['active']; $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1) { session_register("myusername"); session_register("mypassword"); $_SESSION['login_user']=$myusername; header("location: welcome.php"); } else { $error="Your Login Name or Password is invalid"; } } ?> im getting the error as undefined index username and password at the lines 10 and 11 please help me to solve this error

Member Avatar
Member Avatar
+0 forum 9

Hi All, I have a PHP code which do some changes to the POST variables it receives and redirect the page to some other page. This PHP code was initially designed to work without Ajax. So there wasn't any problem with the redirect function and it perfectly handles the POSt variables and redirect the user to another page. So now I want to use the same PHP code with Ajax... :) I tried it and and it did not gave me the results I was expecting. Problem is with the redirect function. Other PHP lines execute perfectly fine( it stores …

Member Avatar
Member Avatar
+0 forum 8

Hey everyone, I have a JSON array that pulls data, its an immense amount of data that i use. It is a multilevel array eg: dateTime: 2018-12-04T10:30:45:222z comments:"" +Driver[0] [0] fname: John lname: Doe driverCode: DOEJ [1] fname: Mary lname: Smith driverCode: SMIMA more info etc I am trying to access dateTime, as well as driver.fname, driver.driverCode etc... here is what i have tried so far... var json = results; var li; for(var i; i=0; i < json.length; i++){ for (var j; j=0; j < json[i].driver.length; j++){ var stTime = new Date(json[i].dateTime); var status = json[i].status; var id = json[i].id; …

Member Avatar
Member Avatar
+0 forum 5

Hi DW. I am able to purchase from my online store but I don't seem to be able to get the pass through data which whould be sent to my notify_url. Payfast is my payment gateway and now it does call my notify_url because two files are created after I try to purchase but the files are blank and what I want is to get the posted variables and their values, but I'm not sure if the variables are posted on call or because even if I try to trap the `$_POST` I don't get any data. Here is my …

Member Avatar
+0 forum 0

I have a code that pulls a JSON response, and I need to compare times from now() and a previous when the timestamp was created. I am able to pull the info and have it display. However, when i try and get the comparison to work it just sits there and doesnt display anything. Here is my code "use strict"; var endDate = new Date(); endDate.setHours(endDate.getHours()); var startDate = new Date(); startDate.setHours(- 12); api.call("Get", { "typeName": "DutyStatusLog", "search": { "fromDate" : startDate, "ToDate" : endDate, "statuses" :['ON'] } }, function(results){ console.log(results); for(var i=0; i<results.length; i++){ var stTime = results[i].dateTime; var …

Member Avatar
Member Avatar
+0 forum 1

I want to associate a REST API end point to two urls, "manager" and "manager/". So I added two path entries in the urlpatterns with these urls. But it seems something that can be handled with some kind of configuration. Is there such a configuration with django? thanks

Member Avatar
Member Avatar
+0 forum 1

Hello I am needing some assistance with setting up a function to check if a user is logged in or not with Passport.js using the local and slack strategy. I have a localstrategy which works fine but I also want to implement a sign in with slack as well. I have added my app to slack and set the redirect URL. Everything is working fine however regardless if a user signs in or not they can still access the main page from the URL. Example I have my login page 123.456.7.891:3000/login and when a user logs in through the local …

Member Avatar
+0 forum 0

I work in VB.net only. I cal read an entire file in one statement, sort it with another statement and write it bacl in another. Three statements to sort a csv file! This is aswome, but I wan to know how to sort the file on different columns. Here is my code, Dim codes(), Saveline As String ' 'Read/Write file data ' codes = File.ReadAllLines(FileName) ' 'Save sorted copy ' Saveline = codes(0) codes(0) = "" Array.Sort(codes) codes(0) = Saveline ' File.WriteAllLines(FileName, codes) What I want to do is use array.sort(codes,2) where the 2 is column 2 or any other …

Member Avatar
Member Avatar
+0 forum 3

This may sound confusing but I have a textbox which is a cell number textbox and I want when the max length of 10 has been reached then fire the php code which is inside the same html page as form and this php code will then get the value or data which has been keyed in to this text box. I've tried Javascript and the problem I'm having with javasacript is to now display this data so that why I've deiced to change to php because I know how to display the php session data within the textbox with …

Member Avatar
Member Avatar
+0 forum 20

Question, I have a `$each(array, function());` and within that statement, i have a` for` loop , Is it safe to be doing this? and could this be the reason that i am getting the same values multiple times returned even though the object array length is 8, i am getting basically doubled up results, sometimes its more. if you need to see my code, i can post it.

Member Avatar
Member Avatar
+0 forum 6

$count1 = array(); $count1[0] = " 1"; $count1[1] = " 2 1"; $count1[2] = " 3 2 1"; $count1[3] = " 4 3 2 1"; $count1[4] = " 5 4 3 2 1"; $count1[5] = " 6 5 4 3 2 1"; for ($b = 1;$b <= 6;$b++) { echo $count[$b]; echo "<br>"; } why does this not work? it just goes on forever. How do i use the $b to up the count of $count[]?

Member Avatar
Member Avatar
+0 forum 1

[B]The following problem comes from an old JavaScript Textbook, JavaScript – First Edition, by Patrick Carey and Frank Canovatchel. This problem is not used in the Second Edition, making the question I shall ask a fair question. The problem is Case Problem 2, Chapter 9, pages 519-20. Here are the files:[/B] [COLOR="Red"]merchant.htm:[/COLOR] [code] <html> <head> <script type="text/javascript" src="merchant.js"></script> <title>Merchants Market</title> </head> <body onload="checkAcct()"> <h2>Account Processing Page</h2> <div id="registration_form"> <form name="market" action="merchant_acct.htm" onsubmit="return handleAll()" method="post"> <table> <tr> <td align="right">First Name:</td> <td><input name="first" size="25" /></td> </tr> <tr> <td align="right">Last Name:</td> <td><input name="last" size="25" /></td> </tr> <tr> <td align="right">Mailing Address:</td> <td><input name="add" size="30" …

Member Avatar
Member Avatar
+0 forum 12

The End.