[Solved] Prevent hacking my website from hackers [closed]

[ad_1] First of all, change your FTP details. Then check your FTP files for any JS that could be interrogated, or file upload forms? Remove them. You could try contacting your Web Hosting provider and inform them of what’s happening, and supply them with IP addresses if you have them. They may be able to … Read more

[Solved] PHP wont connect to mysql database

[ad_1] If you are getting a connection error, chances are your problem will be found on this line: $con = mysqli_connect(“localhost”,”username”,”password”,”database_name”); Are you sure you have got the correct host address, username, password and name of your database schema? You may also want to check that you have the mysqli php extension installed on wherever … Read more

[Solved] PHP: Breaking a string into multiple lines and manipulating each line separately [closed]

[ad_1] Simply use the explode() function with PHP_EOL constant as delimiter: $lines = explode(PHP_EOL, $original); After you can iterate the returned array to parse lines, for example: foreach ( $lines as $line ) { echo ‘<span>’.$line.'</span>’; } 3 [ad_2] solved PHP: Breaking a string into multiple lines and manipulating each line separately [closed]

[Solved] When to use $this and when simple variable

[ad_1] In OOP:$this->name is property of the object which is defined by the class and is accessible globally within the object.$name is variable used inside the class method and is accessible locally only within the object method (a function) Very briefly: class myClass{ private $name = “record.log”; function myMethod(){ $name=”this exists only in the method … Read more

[Solved] Sorting arrays manually in php without using sort() [closed]

[ad_1] here is the solution using bubble sort <?php $item = array(2, 1, 4,3,5,6); $item_length = count($item); for ($counter = 0; $counter < $item_length-1; $counter++) { for ($counter1 = 0; $counter1 < $item_length-1; $counter1++) { if ($item[$counter1] > $item[$counter1 + 1]) { $temp=$item[$counter1]; $item[$counter1]=$item[$counter1+1]; $item[$counter1+1]=$temp; } } } //you can print the array using loop … Read more

[Solved] Access a database without a password? [closed]

[ad_1] There are only two ways to connect to SQL Database: 1) Using SQL Password where you need to specified the credentials 2) or using domain authentication, where the credentials are same as you logged in your pc: Option 1: Data source=localhost; initial catalog=master;trusted connection = true Option 2: Data source=localhost; initial catalog=master;Integrated security=SSPI But … Read more

[Solved] How do i format this project

[ad_1] If you want to show the complete data in first row you can do this: $i = 0; while($job = $result->fetch_object()){ if( $i == 0 ) { echo ‘<tr>’; echo ‘<td>’ . $job->JobDate .'</td>’; echo ‘<td>’ . $job->ReportTime.'</td>’; echo ‘<td>’ .$job->StartTime.'</td>’; echo ‘<td>’.$job->CustomerName.'</td>’; echo ‘<td>’.$job->EmployeeName.'</td>’; echo ‘<td>’.$job->EquipmentNumber.'</td>’; echo ‘<td>’.$job->JobDescription.'</td>’; echo ‘<td>’.$job->JobNotes.'</td>’; echo ‘</tr>’; } … Read more

[Solved] Is there anyway we could use the data from rfid to fetch something from another website? [closed]

[ad_1] You need to have some kind of storage on your backend side, which will map RFID IDs to some website. Then you could redirrect user to that website with HTTP codes 301 or 302. Here is a pseudocede example for client and server: # Client rfid_id = get_rfid_id() make_request_to_server(rfid_id) # Server storage = { … Read more

[Solved] Build dynamic WHERE clause in mySQL

[ad_1] Something like this? $query .= “WHERE 1=1 AND e.id=p.employee_id AND p.office_id=o.id AND (o.office_name=””.mysqli_real_escape_string($officeName).”” OR o.office_name=””.mysqli_real_escape_string($firstName).”” OR o.office_name=””.mysqli_real_escape_string($lastName).””) “; I used mysqli_real_escape_string() here as an example, you should use the correct and necessary precautions to avoid SQL injection in your system. 5 [ad_2] solved Build dynamic WHERE clause in mySQL

[Solved] recurring system my sql query [closed]

[ad_1] Make another table called payments which has – id of payment – userid of user – date they last paid – length of payment Then, to check when a user’s set to expire, SELECT date+length as expy FROM payments WHERE userid = $userid ORDER BY date DESC LIMIT 1 Store dates & lengths as … Read more

[Solved] How to limit items from for loop?

[ad_1] Dont know what you mean there. But here is what I understand from your question <?php for ($i=0; $i< count($contentdinamit[“chart”][“songs”][“song”]); $i++ ) { if(($i+1)<=10){//limit your item by 10 echo'<li class=”up”><a href=”‘ .$contentdinamit[“chart”][“songs”][“song”][“$i”][“artist_name”].'”><strong>’ .$contentdinamit[“chart”][“songs”][“song”][“$i”][“song_name”].'</strong></a><br /><a href=”‘ .$contentdinamit[“chart”][“songs”][“song”][“$i”][“artist_name”].'”>’ .$contentdinamit[“chart”][“songs”][“song”][“$i”][“artist_name”].'</a></li>’; } } ?> 6 [ad_2] solved How to limit items from for loop?

[Solved] PHP Include not working – php too complex? [closed]

[ad_1] My guess: Your “html” file is actually named something.html, which causes the webserver to not recognize it as PHP. Rename it into something.php. To verify that this was the problem, check the source of your HTML page, you should see the literal PHP code displayed there. [ad_2] solved PHP Include not working – php … Read more

[Solved] how to include php variable in mysqli statement [closed]

[ad_1] Sure, you just wrap the variable name with curly braces: $sql=”insert into table (value1) values (‘value_{$value}’); But on this stage of learning you should learn and get used to PDO prepared statements to avoid the risk of mysql injections. [ad_2] solved how to include php variable in mysqli statement [closed]