[Solved] How to find a particular URL inside a domain using PHP?

[ad_1] There aren’t very many practical solutions for what it seems that you are talking about. Brute forcing is the simplest solution if you have the time. I will assume that you are wanting to search the page for certain content here. <?php set_exec_limit(0); ob_start(); $url_prefix = “http://www.example.com?user=”; $search = “FINDME”; $start = 10; $end … Read more

[Solved] Convert PHP Associate Array [closed]

[ad_1] You can do this by encoding the array in JSON format. Here’s the sample code for your better understanding: <?php $names = array( array( “foo”=> “bar”, ), array( “foo”=> “bar”, ), array( “foo”=> “bar”, ), ); $namesJSON = json_encode($names); echo “<pre>”; echo $namesJSON; echo “</pre>”; ?> This will output the JSON array which is … Read more

[Solved] How to insert a div in PHP properly? [closed]

[ad_1] The “best” way (in my opinion) to prevent “spaghetti” style is to differentiate php and html like: <?php while($row = mysqli_fetch_array($result){ ?> <div class=”imagem”> <img src=”<?php echo $row[‘logo’];?>” width=”180px”> </div> <?php } Side note: Next time if your question have a code use the tools <> (html/js) or {} (php and others lang) 1 … Read more

[Solved] syntax error, unexpected ‘(‘, expecting variable (T_VARIABLE) or ‘$’

[ad_1] You’re using Javascript (jQuery to be precise) syntax inside PHP. Hence, the error. syntax error, unexpected ‘(‘, expecting variable (T_VARIABLE) or ‘$’ Those are 2 different animals altogether. Replace <?php with <script> and ?> with </script> and your code will work. 11 [ad_2] solved syntax error, unexpected ‘(‘, expecting variable (T_VARIABLE) or ‘$’

[Solved] MySQL use select for LEFT JOIN ON

[ad_1] Theoretically you can do this. Writing subquery in join statement will have no effect other than filtering the cartesian product of the two tables just like the where condition. But writing query this way makes no sense as we don’t know the context in which you are using it. The above query can be … Read more

[Solved] How to create php class for navigation action

[ad_1] Assume we have the following rewrite rule; RewriteEngine On RewriteRule ^([^/]*)$ /index.php?module=$1 [L,QSA] This will rewrite a request like; http://example.php/index.php?module=about to http://example.php/about Now, let’s see how the Router is done; It’s very basic Can be improved a lot <?php class Router { private $strModule; //Holds the module to load (the page) public function __construct(){} … Read more

[Solved] PHP – What is wrong with this? [closed]

[ad_1] You miss a semicolon at the end of line #28: $data = “<h1>”. $ip . “</h1>”… This kind of error: Parse error: syntax error, unexpected T_ECHO.. usually notifies a certain line number, but when it happens you should always look at the line PRIOR to the one you are getting an error on. Please … Read more

[Solved] What is the error in my query?

[ad_1] In your query, you specify where (MONTH(abc.email_date)=MONTH(NOW()) AND YEAR(abc.email_date)=YEAR(NOW())) But in the subquery (the one returning 18 results), you have 6 emails with a month that is not december 2014. There’s no way that those emails can be returned by a query that explicitly excludes them. You want those emails as well so you … Read more

[Solved] SQL Timestamp format in PHP [duplicate]

[ad_1] Try this should help: $datedb = “2018-03-01 11:54:33”; $date = date(‘d-m-Y’, strtotime($datedb)); echo $date; // will print 01-03-2018 And read about date() function of php: http://php.net/manual/en/function.date.php; https://www.w3schools.com/php/func_date_date.asp 0 [ad_2] solved SQL Timestamp format in PHP [duplicate]

[Solved] How to separating arrays in php? [closed]

[ad_1] I think you just mess up with proper array notation here. Array notation no uses curly braces { or }. So If it is a proper array then you can try like this way using array_chunk() N.B : For array notation we can use two different ways e.g $array = [] or $array=array() <?php … Read more

[Solved] PHP: Passing row values into form to edit

[ad_1] You’re mixing named parameters with variables. You are also not binding the variable to the query. Since you’re not using raw PDO, it will obviously vary a little bit, but here’s what you would do if you were. You’ll just have to adapt it to your $event object: $stmt = $dbh->prepare( “SELECT event_name, event_description, … Read more