Jump to content

TrueMember

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

1 Neutral

About TrueMember

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yes, you can see the proof in the first post. I don't understand why. To try i added the code to controller and it happens again.. $url = "https://www.php.net"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, []); $response = curl_exec($ch); $dom = HtmlDomParser::str_get_html($response); echo '<pre>'; print_r($dom->find(".title")); echo '</pre>'; $dom->clear(); unset($dom); die();
  2. Hi again, I did a simple request and i get right response from curl_exec($ch); but when i call the static method str_get_html my result is always the same. I tried increase the memory memory_limit=2048M but the result is the same. Proof of memory limit: Memory Limit I also tried ->clear(); unset(); but doesn't work. I'm using the following library: kub-at/php-simple-html-dom-parser My code: $url = "https://www.php.net"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER,
  3. Thank you all. Problem solved adding this content to composer: "classmap": ["app/libraries", "app/controllers", "app/models"] For future troubles about this, i leave here a good tutorial about a simple MVC. (1/5 videos)
  4. This is what i do in bootstrap.php but only for content inside libraries folder. I should do the same for controllers? Do you have any example?
  5. I know that, but my ideia is change to work with version with error. But i don't have any ideia to do it.
  6. I'm using this struture to run my application, everything works fine, but i don't like how the controllers are called. If i load the model in construct it will work great again, but i think that is unnecessary. You can see two pieces of code about controller "Post.php", the last one, works great. If i try this: (Posts.php) namespace app\controllers; use app\libraries\Controller; use app\models\User; class Posts extends Controller { public function index():void { //Get posts $user = new User(); $posts = $use
  7. ::1 is the IP address of the client. Maybe what you want is: $_SERVER['SERVER_ADDR']
  8. I don't know what you want to do, you need be more specific. Nobody will work to you, if you want to learn, try by yourself and ask your doubts.
  9. Enable errors and check what's wrong. Print the query and execute directly on database. <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $Title = $_POST['title']; $Price = $_POST['price']; $Author = $_POST['author']; $con = mysqli_connect('localhost', 'root') or die("not connected"); mysqli_select_db($con, 'BRM_DB'); if (!$con) { echo "ERROR: " . mysqli_connect_errno() . PHP_EOL; echo "ERROR: " . mysqli_connect_error() . PHP_EOL; die; } $query = "INSERT INTO book(title,Price,Author)values('$Title',$Price,'$Author')"; $result
  10. U should use $_POST, try the below code: $var_username = $_POST['username']; $message = '<p>Hello</p>' . $var_username . '<p>Please click the following link to activate your account : <a href="' . $var_username . $activate_link . '">' . $activate_link . '</a></p>';
  11. I think this is the result intended. HTML: <label for="firstname"> <i class="fas fa-user"></i> </label> <input type="text" name="firstname" placeholder="Firstname" id="firstname" required > <input type="text" name="surname" placeholder="Surname" id="surname" required > <br> <label id="result"></label> JQUERY: $(document).ready( function() { $("#firstname, #surname").keyup( function() { var firstname = $("#firstname").val($("#firstname").val().toUpperCase()); var surname = $("#surname").val($("#surname").val().
  12. Try this: $fields = array( 'username' => urlencode('xxx'), 'password' => urlencode('xxx'), 'B1' => 'Submit' );
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.