mike2 Posted May 12, 2014 Share Posted May 12, 2014 How would I get a logo to appear within my search page? I have this png file it is called the following: wvb-logo-slogen.png the png file is located under the /mnt/www/html directory. Here is the code that I am trying to use to get this logo to be displayed on my web page: <?php if (!isset($_POST['q'])) { ?> <!-- begin logo --> <div id="logo"> <a href="home"><img src="/mnt/www/html/wvb-logo-slogen.png" border="0" /></a> </div> <!-- end logo --> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form> <?php } else { ?> <h2>Search Results</h2> <?php try { // create object // $swish = new Swish('/usr/local/apache/htdocs/swish/index.swish-e'); $swish = new Swish('/var/www/html/pdf2/index.swish-e'); // get and run query from command-line $queryStr = htmlentities($_POST['q']); $result = $swish->query($queryStr); ?> Found <?php echo $result->hits; ?> match(es) for '<?php echo $queryStr; ?>'. <?php // iterate over result set // print details for each match while($r = $result->nextResult()) { ?> <p> <?php echo $r->swishreccount; ?> <strong> <a href="<?php echo '/pdf2', ltrim($r->swishdocpath, '.') ; ?>"> <?php echo $r->swishdocpath; ?> </a> </strong> (score: <?php echo $r->swishrank; ?>) <br/><?php echo $r->swishdocpath; ?> </p> <?php } } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } } ?> </body></html> My questions are the following: Why isn't my logo displaying? Is it the right format? Are there special html or php items that I need to put in order for my logo to be displayed right above the word "Search"? Any assistance would truly be appreciated because I have no experience using php. Quote Link to comment https://forums.phpfreaks.com/topic/288442-logo-help/ Share on other sites More sharing options...
Ch0cu3r Posted May 12, 2014 Share Posted May 12, 2014 The file path is most likly wrong the png file is located under the /mnt/www/html directory. Is the html directory your document root? If so the image path should be like <img src="/wvb-logo-slogen.png" border="0" /> Quote Link to comment https://forums.phpfreaks.com/topic/288442-logo-help/#findComment-1479225 Share on other sites More sharing options...
mike2 Posted May 12, 2014 Author Share Posted May 12, 2014 The file path is most likly wrong Is the html directory your document root? If so the image path should be like <img src="/wvb-logo-slogen.png" border="0" /> What do you mean is the html directory of my document root? Are you asking is it assigned under the root user? yes it is. Or are we talking about logical volumes here? -rw-r--r--. 1 root root 10077 May 8 15:24 wvb-logo-slogen.png How would I go about changing it to root? I tried putting that code like this and I am still not getting it to appear: <html> <head></head> <body> <?php if (!isset($_POST['q'])) { ?> <img src="/wvb-logo-slogen.png" border="0" /> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/288442-logo-help/#findComment-1479229 Share on other sites More sharing options...
mike2 Posted May 12, 2014 Author Share Posted May 12, 2014 The file path is most likly wrong Is the html directory your document root? If so the image path should be like <img src="/wvb-logo-slogen.png" border="0" /> To answer your question no it is not root. I think I just found it hold on. But I want to make /mnt/www/html the root for apache. Is it possible to change the configuration file because I have to do that next. Quote Link to comment https://forums.phpfreaks.com/topic/288442-logo-help/#findComment-1479232 Share on other sites More sharing options...
ginerjm Posted May 12, 2014 Share Posted May 12, 2014 More likely you want to move the file so that is reachable by your html code. Changing the root (is that possible?) could end up breaking your other code (if you have any) by making your relative paths no longer correct. Quote Link to comment https://forums.phpfreaks.com/topic/288442-logo-help/#findComment-1479235 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.