[Solved] Uploading files are very slow in my PHp project

[ad_1] Did you investigate what the real bottleneck is? This is all about upload speed, and the most obvious cause is that the clients have not enough bandwidth. Even if they use a fast ADSL, they could still have low upload speed (the “A” in ADSL stands for “Asymmetric”, i.e. fast download, but slow upload). … Read more

[Solved] Prevent SQL Injection In This PHP Code

[ad_1] You can ask the database to secure your table and column names, using quote_ident(), before you create the query you want to execute. You need something like this: <?php $table=”table name”; // unsafe $column = ‘column name’; // unsafe $result = pg_query_params($connection, ‘SELECT quote_ident(CAST($1 AS text)), quote_ident(CAST($2 AS text));’, array($table, $column) ); $table = … Read more

[Solved] Php Preg Match, how can i do this [closed]

[ad_1] Try to solve an HTML problem with a regular expression, and soon you have two problems. But if you really want to do this with a dirty regular expression, it can be done. You shouldn’t rely on it. The simplest regex is something like: preg_match_all( “/<td class=bilgi_satir width=\”..%\”><b>(.*)<\/b>/i”, $your_html_here, $m ); This returns roughly … Read more

[Solved] Laravel 5.4 Credit, Debit and Balance Calculation

[ad_1] In your Controller : $transaction = DB::table(‘transaction’)->get(); In your Blade : <?php $tbalance=0; ?> @foreach($transaction as $trans) <tr> <td>{{$invaccstatements->ref_no}} </td> <td>{{number_format($invaccstatements->credit, 2)}}</td> <td>{{number_format($invaccstatements->debit, 2)}}</td> <td align=”right”><?php $chkbala = $invaccstatements->credit – $invaccstatements->debit; echo $tbalance += $chkbala; ?></td> </tr> @endforeach 1 [ad_2] solved Laravel 5.4 Credit, Debit and Balance Calculation

[Solved] Block system in anonymouse chat system [closed]

[ad_1] The reason you seem to be getting down votes is that there is no proper way to do what you want. Either you allow anonymous messages, or you get a working block system (and even most authenticated messaging systems have a hard time getting a 100% safe blocking mechanism). To be able to block … Read more

[Solved] Error PHP Twitter share [closed]

[ad_1] You either need to escape all of the single quotes in that string or don’t use PHP to output that code (recommended): <?php //some php code ?> <a href=”https://twitter.com/share” class=”twitter-share-button” data-via=”User” data-size=”large”>Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?”http’:’https’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+’://platform.twitter.com/widgets.js’;fjs.parentNode.insertBefore(js,fjs);}}(document, ‘script’, ‘twitter-wjs’);</script> <?php // more PHP code ?> Escaped quotes: <?php echo ‘<a href=”https://twitter.com/share” class=”twitter-share-button” data-via=”User” data-size=”large”>Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\’http\’:\’https\’;if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\’://platform.twitter.com/widgets.js\’;fjs.parentNode.insertBefore(js,fjs);}}(document, \’script\’, … Read more

[Solved] Continue loop after 8 results – separating into whole new table

[ad_1] Ok so if we assume that $table3[‘body’] has the same count of elements as $table3[‘header’] your code basically starts building the table header fine, but when we get to the body during the first 8 loops you have the table create rowspans? Should this not be colspans? https://plnkr.co/edit/B31QPDamCDHiQANAYpdx?p=preview <table width=”100%” border=”1″ cellspacing=”0″ cellpadding=”0″> <thead> … Read more

[Solved] Email not displaying HTML [closed]

[ad_1] This as per your original post https://stackoverflow.com/revisions/36426850/1 Here’s the deal. Your code has a missing > for <h1HELLO WORLD!</h1> so that’ll need to be changed to <h1>HELLO WORLD!</h1>. Edit: Ah, now you edited that in now https://stackoverflow.com/revisions/36426850/2, yet the following still applies. Then the “chain link” broke in $headers = “MIME-Version: 1.0” . “\r\n”; … Read more

[Solved] PHP how to make complex large array simple [closed]

[ad_1] I got to say that the result array doesn’t look very useful. Since there’s not much info about the objectives of this task I’ll just provide my take on how it can be done.. $arr = array( ‘collection’ => array( array( ‘type’ => ‘col’, ‘name’ => ‘2016 fw’, ‘url’ => ‘blabla1’ ), array( ‘type’ … Read more

[Solved] php explode on xml file

[ad_1] If what you are looking for is a way to cleanup the corrupt XML file, you can just add the string that gets missing when the explode is run. It is all a bit hackish, but it works. $file=”/Users/jasenburkett/Sites/jobsark/feed.xml”; $data = file_get_contents($file); $split = “</JobSearchResults>”; // Split on this $parts = explode($split, $data); // … Read more

[Solved] Create MySQL query from URL GET parameters [duplicate]

[ad_1] First you need to process the URL using PHP by assigning the URL parameters to PHP variables: $cat = $_GET[‘cat’]; $subcat = $_GET[‘subcat’]; $color= $_GET[‘color’]; Then you can use these variables to create a MySQL query string: $queryString = “SELECT a.p_id, a.p_name, a.p_prize, b.p_id b.color, b.category, b.subcategory FROM products a INNER JOIN details b … Read more