-
Posts
969 -
Joined
-
Last visited
Everything posted by Destramic
-
you need a trigger $(document).ready(function() { $('.trigger').click(function(){ $('input.player_search').typeahead({ name: 'player_name', remote: 'mysql.php?query=%QUERY', }); }); }) // the html trigger <button class="trigger">Search</button> i see some big security risks with your php also...your database is open to sql injection, you need to get that sorted before putting your script live. http://php.net/manual/en/mysqli.real-escape-string.php if you used PDO instead of mysqli you probably wouldnt have this problem.
-
Thank you for your help...changing the int to string work perfectly
-
hey guys im tyring to pass a integer to a method and i get this error: when using this code $this->get_model('contract:contracts')->send_verification_pin(070000000000); i could use quotes like so $this->get_model('contract:contracts')->send_verification_pin('070000000000'); but then the integer has the 0 missing at the beginning...this is my debug int(7000000000) /^07\d{9}$/ ["Phone Number: Invalid phone number."] where is this missing 0 please guys? thank you
-
i wouldnt of thought of that...thank you barand for your time and effort
-
well the tablet would't have a verfication pin...but i planned on having 1 table ie. network_contracts to hoild users contratcs such as sim only, mobile and tablet. the verification pin is for when a user adds sim only / mobile, a pin is then sent to users phone number which needs to be verified.
-
hey guys im wanting to check if a row exists then update, else insert. i've been trying to get this query to work, but i'm not having much luck...i know some of you will say to use ON DUPLICATE KEY and make column phone_number primary key but that won't work as contract type column could be TABLET which has no phone number. IF EXISTS (SELECT network_contract_id FROM network_contracts WHERE phone_number = 123456 AND user_id = 1) UPDATE network_contracts SET verification_pin = 9891 WHERE user_id = 1 ELSE INSERT INTO network_contracts(user_id, phone_number, contract_type, verification_pin) VALUES (1, 123456, 'Sim Only', 7676) any help/advise would be greatly appreciated. thank you guys
-
thank you kicken for the useful information...i've look into purchasing a GSM Router and hopefully will go ahead with setting up my own gateway, but firstly i need to speak with the mobile network providers in the UK to ensure i'm not breaking any the T&C's by doing this. seems like a simple process to set up the hardware, also i see some scripts online that can process the AT commands to the com device....not sure if this is any good though. https://drive.google.com/file/d/0B0NgcxAkZSCHS2MzUEtQMWZYWUc0QmF0RzNBMUItck8wZUtR/edit thanks again
-
hey guys, im wanting to send sms via php, but have no real know how or experience with it....and don't want to be throw my money into the wrong places. i see there is a lot of companies out there where i can buy text bundles from and then use thier api to send an sms, which is great...but is there a way to cut the middle man out? if not could someone recommend me a company? thank you
-
Oh also Cross Site Scripting Attacks...hackers will have a field day on your server
-
You need to check $_GET['id'] exists...also your code is vulnerable to Cross-Site Request Forgery Atacks (CSRF) and SQL Injection I'd suggest to use PHP PDO instead of the mysqli extension.
-
PHP help mysqli_query ()expects at least 2 parameters, 1 given
Destramic replied to akhilkumar332's topic in PHP Coding Help
try what jacques1 said -
PHP help mysqli_query ()expects at least 2 parameters, 1 given
Destramic replied to akhilkumar332's topic in PHP Coding Help
what i also i should of mentioned is that you need to escape all user data using mysqli_escape_string() failure to do so can result in SQL injection $username = mysql_escape_string($_POST['username']); this wouldn't be a problem if you used PDO and prepared queries. -
PHP help mysqli_query ()expects at least 2 parameters, 1 given
Destramic replied to akhilkumar332's topic in PHP Coding Help
seriously?...i just gave you the documentation referring to mysqli_query as well as the code for your first mysql insert $data = mysqli_query ($query)or die(mysqli_error()); should be $data = mysqli_query($con, $query) or die(mysqli_error($con)); i'm more than sure you can work out the other...if not, give up but i would suggest to use PDO http://php.net/manual/en/book.pdo.php -
PHP help mysqli_query ()expects at least 2 parameters, 1 given
Destramic replied to akhilkumar332's topic in PHP Coding Help
mysqli_query($con, $query); as seen here http://php.net/manual/en/mysqli.query.php -
hey guys i wish to make a simple form for users/guest to share my wesbite to friends etc. i'm mostly concerned that this will allow people to spam address from my site...should i be concerned?...if so what is the best approach please? i was thinking about collecting the shared email's to a db? ensuring only 1 ever gets sent...is this enough thank you
-
please use the code tags so it makes things easier for people to read. i can see an error here: if (isset($_REQUEST ["flavour"]) ) { //<input name = "flavor" type = "text"> which should be if (isset($_REQUEST["flavour"])) { //<input name = "flavour" type = "text"> why don't you try something like this? <html> <head> <title> using one page to accept and process data. </title> </head> <body> <h1> using one page to accept and process data. </h1> <?php if ($_SERVER['REQUEST_METHOD'] === 'POST') { print_r($_POST); } else { ?> <form method="post"> what is your favourite ice cream flavor? <input name = "flavor" type = "text"> <br> <br> what is your name? <input type = "text" name = "name" > <br> <br> <input type = submit value = submit > </form> <?php } ?> </body> </html>
-
opencart checkout, select store branch and pick-up date
Destramic replied to Yohanne's topic in Applications
what errors have you got?...also if your storing in the database you want to be using DATE field type -
sorry i after a second glance i saw this...sorry! (no0b) embarrassing
-
my age is displaying as 29 although i'm 30...not complaining but something isn't right. also my dob is correct on my profile thank you
-
the script isn't fully functional but something like this...i guess you have a list of news or whatever it is your listing form the database, which you want to be able to delete but also keep the list in view with successful/error messages. jquery $(document).ready(function(){ $('span[data-delete-news-id]').click(function(event) { var data = { id: $(this).data('delete-news-id') csfr: 'token here' }; $.ajax({ url: 'http://domain/delete', type: 'POST', data: data, dataType: 'text', success: function(result) { //check result and remove for list }, error: function(jqXHR, satus, error){ console.log(status, error); } }); }); }); html news article - php is the best - <span data-delete-news-id="5">delete</span> no need for a form or to reload page...hope this helps...also you going to want to look at stopping cross site forgery attacks hence the csfr: 'token here' parameter
-
There is probably a much easier way but why don't you check the phone make is apple and image is portrait then just rotate? Wouldn't be a bad solution if the script is only for your personal use...although would be nice to make the script universal
-
i'd check the orginal image orientation before uploading...as i can't see anything obvious that would rotate the image before saving the image may have embedded image rotation infomation set by your phone. check for orientation key print_r(exif_read_data($filename)); i come across this function also which may help. function image_fix_orientation(&$image, $filename) { $exif = exif_read_data($filename); if (!empty($exif['Orientation'])) { switch ($exif['Orientation']) { case 3: $image = imagerotate($image, 180, 0); break; case 6: $image = imagerotate($image, -90, 0); break; case 8: $image = imagerotate($image, 90, 0); break; } } }
-
Module name changing causes broken link in phreebook
Destramic replied to dishadcruze's topic in Applications
Check $_GET['xmax'] value as i would say it's empty