how to insert .txt file data into database using php?

I have been inserting .txt file data in my sql-server database using php which is working too but I am getting undefined array error please help me in resolving the same .txt data ankit,ankit@gmail.com swapnil, swapnil@gmail.com shefali, shefali@gmail.com abhishek, abhishek@gmail.com my php code for implementing the same <?php include ‘connection.php’; $open = fopen(’employee.txt’,’r’); while (!feof($open))… Read More how to insert .txt file data into database using php?

PHP how to remove rgb(255, 255, 0); in a string

I want to remove the rgb(number, number, number); in my string using php but I’m not sure what to use <p>asd <span style="background-color: rgb(255, 255, 0);">a12</span>asd<span style="font-size: 8px;"></span></p> that the string contains One of the ways I know is preg_replace but I’m not sure how to remove it without affecting the other number $p =… Read More PHP how to remove rgb(255, 255, 0); in a string

php while loop – html a href inside loop of data

I’m trying to get my while loop to function when fetching data that is equal to input field. The Data set is functional, but I want to add a read, update and delete function to each field of data through an with allocated ID. <tbody>"; while($row=$result->fetch_assoc()){ $output .=" <tr> <td>".$row[‘id’]."</td> <td>".$row[‘fornavn’]."</td> <td>".$row[‘efternavn’]."</td> <td>".$row[‘mail’]."</td> <td>".$row[‘kursistnummer’]."</td> <td>".$row[‘unilogin’]."</td>… Read More php while loop – html a href inside loop of data

While Loop taking ID value for a href

while loop: <tbody> <?php while($row=$result->fetch_assoc()){ ?> <tr> <td><?= $row[‘id’]; ?></td> <td><?= $row[‘fornavn’]; ?></td> <td><?= $row[‘efternavn’]; ?></td> <td><?= $row[‘mail’]; ?></td> <td><?= $row[‘kursistnummer’]; ?></td> <td><?= $row[‘unilogin’]; ?></td> <td> <a href="read.php?id=’. $row[‘id’] .’" class="mr-3" title="View Record" data-toggle="tooltip"><span class="fa fa-eye"></span></a> </td> </tr> <?php } ?> </tbody> when I press the a href for each record it always results in… Read More While Loop taking ID value for a href

PHP regex to check if a string ends with a space and 15 other characters

I’m looking for a PHP regex to check if a string ends with a string that starts with a space then 15 characters which contain only 0-9 and a-f characters (lower case) Match: $myString = "something here 62ffe537a66ddcf"; // space after "here" and then 15 characters No Matches: $myString1 = "something here62ffe537a66ddcf"; // space missing… Read More PHP regex to check if a string ends with a space and 15 other characters

htmlspecialchars – how to use it ith curl?

I wanna use it with Curl to get the customer name from the link (here is curl cmd) curl -F ‘file=@/home/jbaudoux/logbackup-infitarif (3).gz’ http://pc-arp?customer=Name I use it like: $foldername = htmlspecialchars($GET["customer"]) . ”; Any clue of why it’s broke? (It’s error when run for the $GET) >Solution : Ofc u miss type the $_GET that’s just… Read More htmlspecialchars – how to use it ith curl?

How to solve the error "Authentication credentials were not provided" while running a CURL get request in php?

I am trying to hit a CURL "GET" request in php but getting the error as "Authentication credentials were not provided". So I cannot understand for which exact reason, the error is showing. Can anyone help? $api_token = "test"; $question_id = "test1"; $organization_id = "test2"; $thumbnail_file_path = ""; $request_headers=array(); $request_headers[]=’Authorization: f’.$api_token; $request_headers[]=’Content-Type: application/json’; $request_headers[]=’organization_id:’.$organization_id; $url="https//www.xyz.com/{$question_id}";… Read More How to solve the error "Authentication credentials were not provided" while running a CURL get request in php?