Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/288442-logo-help/
Share on other sites

 

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>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/288442-logo-help/#findComment-1479229
Share on other sites

 

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.

Link to comment
https://forums.phpfreaks.com/topic/288442-logo-help/#findComment-1479232
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.