Note that there are some explanatory texts on larger screens.

plurals
  1. POget the host name from url
    primarykey
    data
    text
    <p>This is the function that get the hostname from the URL: </p> <pre><code>&lt;?php function get_domain($url) { $pieces = parse_url($url); $domain = isset($pieces['host']) ? $pieces['host'] : ''; if (preg_match('/(?P&lt;domain&gt;[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) { return $regs['domain']; } return false; } print get_domain("http://fileflyer.com"); ?&gt; </code></pre> <p><strong>I want to insert this function in my file here:</strong></p> <pre><code>&lt;?php function connect($host,$username,$database,$password){ $to_connect = mysql_connect($host,$username,$password) or die ("UNFinded ".$username. " DB !"); $db = mysql_select_db($database, $to_connect) or die (mysql_error()); return $db; } connect("localhost","idevice2_ariel","idevice2_ariel","ariel123456"); if (!isset($_POST['submit_form'])) { echo '&lt;form name="search_form1" id="form" method="POST" action="search.php"&gt; &lt;input type="text" style="width: 300px; display: block; margin: 0 auto; height: 36px; text-align: center; font-size: 16px;" name="search_name" placeholder="חפש סרט או סדרה.." /&gt; &lt;input type="submit" value="Submit" name="submit_form" /&gt; &lt;/form&gt;'; } else { $search_name = $_POST['search_name']; $query = mysql_query("SELECT * FROM `members` WHERE (`moviename` like '%".$search_name."%')"); $count = mysql_num_rows($query); while($row = mysql_fetch_array($query)) { $fname = $row['moviename']; $lname = $row['links']; **print '&lt;a href="'.**$row['links']**.'"&gt;'.$row['moviename'].'&lt;/a&gt;&lt;br /&gt;'; </code></pre> <p>I want this get the host name from the </p> <pre><code>$row['links'] } } mysql_close($to_connect); ?&gt; &lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; a { } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Can somebody help me?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload