-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
CroNiX last won the day on June 25 2015
CroNiX had the most liked content!
About CroNiX
Profile Information
-
Gender
Male
-
Location
Portland, OR
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
CroNiX's Achievements
-
What is the command similar to implode, explode and etc.
CroNiX replied to tommytx's topic in PHP Coding Help
extract($str) is what you're looking for. Takes an array and breaks it up into individual variables using the keys of the array as the variable names. http://php.net/manual/en/function.extract.php -
The first variable in a query string follows a ?, which you are doing. Subsequent variables get added using the ampersand (&), but you are using a plus (+) which means a space character in URLs. .../pes/mimo.php?rack=1&jobs=0&hosts=1 $rack = $_GET['rack']; $jobs = $_GET['jobs']; $hosts = $_GET['hosts'];
-
Since this is a comparison, you need to use double == here instead of assigning the value: if($_POST['page'] = $total_number_of_page) {
-
Did the owner give you (written) permission to take their copyrighted material and use it for your own purposes?
-
Lots of ways. How about posting your schema? Is everything properly indexed, especially fields that are being joined on, used in WHERE's, etc? 30,000 records is nothing...
-
We need to know what javascript wysiwyg editor you are using on these textareas, and also the js code you are using.
-
http://php.net/manual/en/function.array-unique.php
-
And databases are highly optimized to quickly store/search/sort/retrieve data. That's their sole purpose. It's the right tool for the job. Coding is also about using the right tool for the job. You will make this a LOT more complex if you do it the way you are wanting to as you will not only have to hand code each html page to enter you data (room for error there) but you also now have to read them in and parse the HTML to get the data back out. That's really a waste and prone to error unless everything is perfect. It also has more wasteful overhead, will take longer and consume more memory than just using a database. Again, a database is the right tool for the job you describe... If you are really new to php this will be a lot more challenging for you to get working, especially the parsing of the HTML, than learning the database stuff.
-
What does the css for the class errorPrint look like, which are used in the spans after each input?
-
How to make a request to plop into a modal with AJAX
CroNiX replied to Q695's topic in Javascript Help
Here's a better approach though, that uses more pure jquery than you are using. It also tremendously simplifies things. <div id='dialog' title='Blog Post Viewer'></div> //Just use the href, and create a html data attribute to hold the "url_data". Give them all the same class and jQuery will pick it all up using my function which is automatically invoked. <a href='?a=a&b=b' data-urldata="data a" class="modalize"> link text a</a> <a href='?c=c&d=d' data-urldata="data b" class="modalize"> link text b</a> $(function() { //create a click event for all links with class of "modalize" $('a.modalize').on('click', function(e) { e.preventDefault(); //jQuery equiv for return false for click event var link = $(this); //the clicked link //grab the link href var href = link.attr('href'); //grab the link urldata var urldata = link.data('urldata'); alert('href: ' + href + "\nData: " + urldata); //now do the ajax, open dialog box, etc $( "#dialog" ).dialog({ autoOpen: false }); }); }); Example: https://jsfiddle.net/tagwgLch/1/ -
How to make a request to plop into a modal with AJAX
CroNiX replied to Q695's topic in Javascript Help
Try removing the return false for the onclick event and moving the run_modal() to the onclick event. If you need to you can return false at the end of your run_modal() function. <a href='? $url_data ' onclick='run_modal ( \" $href \" , \" $url_data \" );' > $link_txt </a> -
You can also use array_search() to look for a value in the array and if it exists it will return the associated key (or FALSE if not). You can then use the key to unset the index from the array. if (($key = array_search($value_to_delete, $your_array)) !== false) { unset($your_array[$key]); }
-
File download appearing as data within page - not downloading
CroNiX replied to Jimity's topic in PHP Coding Help
That damn BOM -
Auto update view when theres new data in database
CroNiX replied to dumb2champ's topic in Frameworks
Sure you can use AJAX to retrieve any "new" records and return the data back to your script where you would insert it at the bottom of your table. It's a lot more complex than just using the page refresh method though. You're going to have to do some homework to get this running, and we can help you along the way once you start posting code that you're having problems with. I'll give you the basic steps you'd need. 1) Include the jQuery js framework in your pages. 2) You will need to store the timestamp for each item in your html code so you can use js to get the largest timestamp which will be used to send back to laravel. I would suggest adding a data attribute to each of your <tr> tags that would be the timestamp. Ex: <tr data-timestamp="1234567890"> where 1234567890 is the timestamp from your db. 3) Create a js function that will be called using setInterval() -grabs all data-timestamp data attributes from the <tr>'s, and compares them getting the highest value -use ajax to send the newest timestamp via POST to your laravel controller --in the "success" event of the ajax call, check to see whether any json data was returned and if so use jQuery to create new table elements with the returned json data and insert them after the last <tr> in your <table>. This would just be a javascript array that you'd loop over to create the elements. 4) Create laravel controller, or add a new method to an existing controller, to receive the POSTed timestamp from the ajax call. Use the timestamp to grab all new entries from the db > timetamp, json encode the returned entries and output them so your ajax script can receive them, which will be the "success" event of the ajax call mentioned above. So this will basically just send the latest timestamp every x seconds back to laravel, laravel checks to see if any new entries exist greater than the supplied timestamp and returns them and then your jQuery will insert them into the table. -
Zooming ability of image with slider or + - buttons
CroNiX replied to Ralph2's topic in Javascript Help
There are many jQuery plugins that will do that. here is one: https://github.com/acornejo/jquery-cropbox just google "jQuery image crop" for many others. Most will do zoom in addition to crop and other functions.