Posts
 
Reputation
Joined
Last Seen
Ranked #191
Strength to Increase Rep
+9
Strength to Decrease Rep
-2
98% Quality Score
Upvotes Received
158
Posts with Upvotes
139
Upvoting Members
62
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
43 Commented Posts
9 Endorsements
Ranked #207
Ranked #219
~218.57K People Reached
Favorite Tags

330 Posted Topics

Member Avatar for ianhaneybs

Since Dani did the best standard-correct answer I will do the botch-job answer: $('table#list tfoot .grand-total').text('£'+parseFloat(grand_total).toLocaleString('en-gb', {style:'decimal',maximumFractionDigit:2})); $('[name="amount"]').val('£'+parseFloat(grand_total)); may also want to use &pound; to display in html, but you need £ to display in basic text elements like <input> Also a simple trick to format currency is times it …

Member Avatar for gottaloveit
0
71
Member Avatar for juan_35

Emailing became more restrictive in the last year, so when you have a PHP server with no emailing setup the emails often fail completely now as there is so much wasted bandwidth on spam emails that these get turned down instantly. I solved it on my hosting with the [PHPmailer](https://github.com/PHPMailer/PHPMailer) …

Member Avatar for Biiim
0
314
Member Avatar for Mr.M

This is what i'm using for AJAX requests - it needs jQuery: var data = []; data.var = 'test'; $.ajax({ type: "POST", data: {data:data}, url: connectProtocol+"://"+currentHost+"/linkToAjaxFile.php", success: function(msg){ responseData = $.parseJSON(msg); console.log(responseData); if(responseData['status'] == 'success'){ //do something $('#someModalWindow').modal('hide'); }else{ alert(responseData['message']); } } }); I guess the direct answer would be …

Member Avatar for Dani
0
91
Member Avatar for Mr.M

Normally you would use the value property as well, I have actually never seen the id attribute being used like that before. <select class="form-control select2" style="width: 100%;" id="managsel"> <option value="" SELECTED>Select Department</option> <option value="opa">Accountant</option> <option value="opb">Training</option> <option value="opc">Operations</option> <option value="opd">IT</option> </select> and then in vanilla JS just use something like …

Member Avatar for Biiim
0
130
Member Avatar for rasputin009

Here's the code I've been using for about 15 years now - but a bit more simplified: function dbConnect($type = ''){ $conn = mysqli_connect( DBHOST, DBUSER, DBPASS, DBDB); if (!$conn) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; echo "Debugging …

Member Avatar for Biiim
0
71
Member Avatar for ianhaneybs

You got a `GROUP_CONCAT()` in the SELECT statement so the query will group everything as one, since no GROUP BY was specified. You don't want GROUP_CONCAT anything in tblorders if you want to view all the orders for that Customer. Add to the bottom after the WHERE clause: `GROUP BY …

Member Avatar for gottaloveit
0
84
Member Avatar for SolidSolutions

Wheres the function! function checkLastChar(string){ return string.charAt(string.length-1); } console.log(checkLastChar('testing')); function removeTrailingDot(string){ if(string.charAt(string.length-1) == '.'){ return string.slice(0, -1); }else{ return string; } } console.log(removeTrailingDot('something.')); console.log(removeTrailingDot('something')); If you find yourself repeating the same code your doing it wrong. Probably not an absolute truth but it is a pretty workable rule.

Member Avatar for Biiim
0
5K
Member Avatar for david.tigner

In your code where you write `mail($to,$subject,$message,$headers);` if you want to get error messages or "do something if it fails" you need to alter it a bit to something like: if(mail($to,$subject,$message,$headers)){ //if successful do something }else{ //if error do something else } //or var_dump(mail($to,$subject,$message,$headers)); //or $tmp = mail($to,$subject,$message,$headers); var_dump($tmp); I …

Member Avatar for Dani
0
397
Member Avatar for nander

logically, it would be because `WHERE variable_name = :variable_name` matches 1 row in your table maybe try a `var_dump(str_replace(':variable_name',"'some_value'",$sql));var_dump($records);`? run the sql on whichever way you use to access your DB directly I don't use PDO so i'm not too familiar on how it returns results, either way you will …

Member Avatar for Chris_103
0
129
Member Avatar for Dani

I realise this has been marked as solved, but I wanted to make it known that the HAVING clause runs on the returned result set of your query, which as you say has no indexes on it as it is just a temporarily created result set - but has the …

Member Avatar for toneewa
0
788
Member Avatar for jayashree10

1. Your Hosting server (CPU, RAM, HDD) 2. Your Hosting server's internet bandwidth 3. Your Client computer(CPU, RAM, GPU, HDD) 4. Your Client computer's internet bandwidth Check the size of the files in your browsers developer tools - Network - should tell you how long it takes to download and …

Member Avatar for Biiim
0
79
Member Avatar for jayashree10

if you use javascript, or any programming language, you can cut out a lot of processor time by being smart in the program logic. eg. if you do a loop, work out data you can before the loop eg. $.each(myArray, function(item){ var now = moment(myDate); //do something with now }) …

Member Avatar for Biiim
0
65
Member Avatar for FarrisFahad

You can use an anchor tag still just use href="javascript:" so it doesn't do anything on click. <a href="javascript:" onclick="loadMore(this, '.Memes', 'ex/more.memes.php');">Load More Content</a> It will get some default styles added to it, so you might want to add style="text-decoration:none;" and overwrite the other defaults for an anchor tag. I …

Member Avatar for Dani
1
154
Member Avatar for tarun Nagar

Only ever heard of POST and GET. The others either have no use or is very specialised. a GET request puts the variables in the URL link - so the data is very visible. a POST request puts the data hidden in the headers of the request You use GET …

Member Avatar for Gulshan_6
0
147
Member Avatar for borobhaisab

How does this work for you? foreach($test as $v){ if (strpos($v, '_point') !== false) { echo $v; } } I didn't test it

Member Avatar for Dani
1
121
Member Avatar for borobhaisab

I use bcrypt passwords which look exactly like that. The first part of the string says how complex the hashing is, then followed by the salt then the hash. It generates completely different each time so you have to evaluate it with the verify function each time. Its designed to …

Member Avatar for Biiim
0
307
Member Avatar for riccardo.farabi

> I have this number 1726.16723958045672098127. How Can I register in my db MySql. Why is the number truncated? should be a column type decimal, DECIMAL(24,20) would store the number you just mentioned without truncating. 24 - how many digits in the number 20 - how many digits are after …

Member Avatar for riccardo.farabi
0
169
Member Avatar for larry29936

This should be what you are looking for: <div style='overflow-x:hidden;max-width:800px;'></div> Use bootstrap if it's not too complicated for you to get it set up. Bootstrap is very good [Bootstrap 5 Columns](https://getbootstrap.com/docs/5.0/layout/columns/) Bootstrap makes it responsive and is fully mobile compatible, so they stretch to fit the screen size and you …

Member Avatar for mtyide
1
592
Member Avatar for Intan Farizatul

I just use curly brackets around the variables, and you don't need \` marks in the array reference later on. You also want to screen the GET input to make sure someone isn't going to drop your database. I also try not to use key words for table names, like …

Member Avatar for Biiim
0
283
Member Avatar for Mr.M

a bit messy but you could use a subquery to filter it out, something like: SELECT user_id, message_time, status, message, `etc` FROM `table` t LEFT JOIN (SELECT user_id, MAX(message_time) last_message FROM `table` GROUP BY user_id) `sub_table` st ON t.user_id = st.user_id AND t.message_time = st.last_message WHERE st.user_id IS NOT NULL …

Member Avatar for Biiim
0
145
Member Avatar for KirovEli

If I was doing it I would use Google Analytics but if you really need to do it manually for your project you basically have to set up a database with a programming language - like PHP - that writes into the database when a user does a specific action …

Member Avatar for Arun_47
2
318
Member Avatar for emsanator

Missing a `</div>` at the end Document.getElementById("item_variation_size").innerHTML += '<div class="custom-control custom-control-inline custom-control-size mb-2"><input type="radio" class="custom-control-input" name="sizeRadio" id="sizeRadio_' + itemData.item.v.variationData.sizes + '" value="' + itemData.item.v.variationData.sizes[i] + '" data-toggle="form-caption" data-target="#sizeCaption"><label class="custom-control-label" for="sizeRadio_' + itemData.item.v.variationData.sizes[i] + '">' + itemData.item.v.variationData.sizes[i] + "</label>";

Member Avatar for Biiim
0
112
Member Avatar for timlab55

PHP is a server side script. It is a module attached to a web server, it takes the code and "Pre-processes" it and outputs the result hence PHP (Pre- Hypertext Processing or Hypertext pre-processor). The code executes linear, from top to bottom. The script dies if it hits a fatal …

Member Avatar for Biiim
0
103
Member Avatar for Vaske_1

This is a bit of a bootstrap question really, I hashed together a quick idea of what you could do. Keep in mind the concept behind bootstrap is RESPONSIVE - so you don't want to start defining exact sizes for the images etc as it scales with mobile devices and …

Member Avatar for ishu_1
0
202
Member Avatar for rabbit07

also could be `mysqli_fetch_assoc` instead of `mysqli_fetch_array`. `mysql_fetch_array` may not return the associative column names as the key values

Member Avatar for Biiim
0
450
Member Avatar for Battlecode10

function newgame() { writeOutput("I'm thinking of a number between 1 and 100..."); var answer = Math.floor(Math.random() * 100 + 1); var guessCount = 0; // TODO: use the randomNumber function to pick an answer for this game. } You need to remove the "var", this makes the variables local inside …

Member Avatar for Biiim
0
133
Member Avatar for cosmo13

My guess on it saying "Your Password is Incorrect!" is that when you refresh a page that has been "post"ed to it will ask if you want to confirm resubmitting the form data, if you say yes it will send the post data again. Otherwise based on your code it …

Member Avatar for Biiim
0
178
Member Avatar for Pocokos

The way I would do that is to have an array that stores the ID's of played songs then shuffle through finding the songs that have not played yet. I added the concept in jQuery as that is what I used to do it in my projects. var played_songs = …

Member Avatar for Biiim
0
164
Member Avatar for darkbox

Check out momentJS, I use [momentJS](https://momentjs.com/) for anything date & time related. You include the JS file in a script tag `<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js">` you generally put this inside the `<head>` tag Then put the actual script AFTER the html divs where you want to do the conditional, as the …

Member Avatar for Biiim
2
376
Member Avatar for Eugene_15

Not familiar with Siema, I did get the bug you have on your codepen though. When I commented out the first gallery-image on the first slider it started working for me. I also fixed the canonicalised PHP code in the javascript `&lt;?php` and `?&gt;` whatever it is for, I just …

Member Avatar for Dani
0
252
Member Avatar for Sananil

I would put some var_dump's in to help debug. My guess is the variable type is not what you expect on something. <?php var_dump($Row); if ($Row->logged_in == '0') { var_dump('condition 3 fired'); if ($Row->last_login != '0000-00-00 00:00:00') { var_dump('condition 1 fired'); ?>Last Login : <?php echo date('d M Y ,H:i …

Member Avatar for Emmason
0
445
Member Avatar for Sananil

What I do is this: (you probably want the part inside `success: function(msg){` $.ajax({ type: "POST", data: {data:data}, url: connectProtocol+"://"+currentHost+"/analytics/ajaxProfileData.php", success: function(msg){ var responseData = $.parseJSON(msg); if(responseData['status'] == 'success'){ $('#div_dashboardContactsHomeProfileName').html(responseData['data']['first_name']+' '+responseData['data']['last_name']); if(responseData['data']['profImage'] == 'null'){ $('#div_dashboardContactsHomeProfileImg').attr('src',connectProtocol+"://"+currentHost+'/includes/images/profile_images/default.png'); }else{ $('#div_someidtoProfileImg').attr('src',connectProtocol+"://"+currentHost+'/fileUploads/images/'+responseData['data']['profImage']); } }else{ } } }); Then the PHP page has something like this: …

Member Avatar for Biiim
0
4K
Member Avatar for texelbee

$resultSet = $mysqli->query("SELECT `AIRCRAFTREGISTRATION`,`USEABLESEATS` FROM ACTIVE"); <?php while($rows = $resultSet->fetch_assoc()) { $acreg = $rows['AIRCRAFTREGISTRATION']; echo "<option value='$acreg'>$acreg - Seats:{$rows['USEABLESEATS']}</option>"; } ?> Looks like what you are asking. Is AIRCRAFTREGISTRATION the unique key for that table? You usually refer to unique ID refs in a drop down and use that programmatically. …

Member Avatar for Biiim
0
312
Member Avatar for larryson

Where it says `Firstname < 6` needs to be `Firstname.length < 6` Same goes for Lastname and Username. Those variables are strings so will error trying to evaluate them to a number

Member Avatar for pandglobal
0
290
Member Avatar for jonsan32

You mean like popovers? [Bootstrap Popover](https://www.w3schools.com/bootstrap/bootstrap_popover.asp) Then you could play around doing something extra onclick with `visibility:hidden` or `display:none` or even modifying the html content on click `$(this).html('');`

Member Avatar for jonsan32
0
841
Member Avatar for larry29936

Hey Larry, This function is a javascript function and you can't run PHP code in javascript. (PHP is server-side & javascript is client-side) Here is a simple function in javascript I use to open a url: function openPopup(url,name,h,w){ var newWindow = window.open(url,name,'height='+h+',width='+w); if(window.focus){newWindow.focus();} } so you would do: <a href="#" …

Member Avatar for Biiim
0
541
Member Avatar for Abardean

Not familiar with the language you are using but looking at the code my guess would be that it runs through one last time with an undefined input. ie. in your example you give it 5 values then you exit and it runs the "do" code one last time when …

Member Avatar for Reverend Jim
0
218
Member Avatar for Lev_3

Missing a lot of data on what you are working on. However in HTML there is a CSS property called 'z-index' which is like the 3rd dimension on a web page, you know X for length, Y for height and Z is depth. So in theory if you get the …

Member Avatar for Biiim
0
124
Member Avatar for Ryan_42

possibly because the 'href' property needs to be a full URL? This works for me in my browser console `window.location.href = 'https://www.google.co.uk';`

Member Avatar for Biiim
0
2K
Member Avatar for larry29936

Hey Larry, I'm not that familiar with the glob function but as Grant Baker said here: > Lastly, you really don't need to use foreach here. glob() will return an array of filepaths to the files that match the search paramaters. You also don't need download/ in the url, because …

Member Avatar for Dani
1
2K
Member Avatar for Biiim

I've been working on a project using Morris JS and since there was no solution out there for the Y axis scaling that I could find I wanted to posted where I got. Note you will need [morris JS](https://morrisjs.github.io/morris.js/) & [Moment JS](https://momentjs.com/) to run it. You just need a div …

0
1K
Member Avatar for Xozz

I haven't used this program myself, I would go through this guide on the Openelement Wiki: [Wiki Openelement Publishing Settings](https://wiki.openelement.com/en/index.php?title=Publishing_Settings) PHP code is a scripting language ran on the webserver(Pre-Hypertext Processing, IE it processes Hypertext(HTML) before it is sent to the browser), so you will have to upload it to …

Member Avatar for Biiim
0
447
Member Avatar for jonsan32

Where is the javascript code that is attached to `#starttour`? Put that in the window.onload function.

Member Avatar for Biiim
0
2K
Member Avatar for SimonIoa

You seem to be going about this the wrong way. An SQL query returns a result of COLUMNS & ROWS, you can't have 3 rows with different column names mixed with another 3 rows of different columns. The query result has to have the same columns for all the rows, …

Member Avatar for Biiim
1
1K
Member Avatar for halovalo

Your 2 queries look identical, can you do `var_dump($query);` after each of them so you can see the computed strings that are being sent. The only difference I can see is `$id_pictures = 1;` would be stored as a integer but PHP should add this into the string no problem.

Member Avatar for halovalo
-1
826
Member Avatar for Biiim

I come across this problem every so often and end up having to do work arounds when I would prefer to keep it in the database. I have a query where the data in the query updates frequently so the query won't stay in the cache but I don't need …

Member Avatar for Biiim
1
1K
Member Avatar for SoulTravel

With the GDPR laws this became pretty strict, you want to contact a data providing company. This is one that I remember from way back, [Emailmovers](https://www.emailmovers.com/email-data) You have to keep very specific records for B2C emailing to prove they have opted in for what you are sending them.

Member Avatar for Dani
0
277
Member Avatar for Lighterning

I have extracted the mysqli connection commands from my files here and done a quick query based on your tables, hopefully you can work out using the data in the `$data` array. (something like `<?php foreach($data as $key->$value){echo $value['Department'];}?>`) <?php $connection = mysqli_connect($host,$username,$pass,$database) or die(mysqli_connect_error()); $query = "SELECT dept.id `dept_id`, …

Member Avatar for Biiim
0
263
Member Avatar for Денис_2

I use config files to set the host name for the site as well as other site wide settings. To be specific, config.php which sets the hostname & database details then all web files refer to config.php for the host name & login details - hopefully he has these files …

Member Avatar for Денис_2
0
826
Member Avatar for Marinos_1

This looks like a mis-understanding of PHP, the code you want is a javascript solution: <script type='text/javascript'> var price = <?php echo $price;?>;//make it global outside the function function getval(sel){ var singleValues = sel.value; var thisPrice = price * singleValues; alert(thisPrice); document.getElementById('selectedItem').innerHTML = sel.val+' Selected. Price: '+thisPrice; } </script> <select …

Member Avatar for Biiim
0
344

The End.