Web page with picture, text, php function


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Web page with picture, text, php function
# 1  
Old 03-08-2015
Web page with picture, text, php function

Hello.
I'm trying to create a web page which the presentation is as follows:
1 °) at the top of page an image
2 °) below the text
3 °) to complete a php function that returns information.

I tried different things but none work.

Script 1:
Code:
<!DOCTYPE html>
<html>
<head>
<style>
div {
    padding: 10px ;
    border: 5px solid navy;
    margin: 10px ;
}
img {
    padding: 10px ;
    border: 10px solid cyan;
    margin: 10px ;
}
</style>
<title>THIS IS THE TITLE</title>
</head>
<body>
<div>
<img src="an_image.jpg" alt="stuck-out_tongue.png"
 height="480" width="640" align="middle">
</div>
<div>
<center>THIS IS A TEXT</center>
</div>
<?php phpinfo(); ?>
</body>
</html>

script 2 : the same with small change
Code:
img {
    padding: 10px ;
    border: 10px solid cyan;
    margin: 10px ;
    margin-left: auto;
    margin-right: auto 
}

Code:
<!DOCTYPE html>
<html>
<head>
<style>

img.container1 {
    display: block;
    padding: 10px ;
    border:  10px solid cyan;
    margin:  10px
    margin-left: auto;
    margin-right: auto
}

</style>

<title>THIS IS THE DEFAULT SERVER</title>
</head>
<body>
    <table>
        <tr>
            <td>
                <img class="container1"   src="an_image.jpg" alt="stuck-out_tongue.png" height="240" width="320">
            </td>
        </tr>
        <tr>
            <td>
               A TEXT
                <br>
                ANOTHER TEXT
            </td>
        </tr>
        <tr>
            <td colspan="<?php phpinfo(); ?>">
            </td>
        </tr>
    </table>
</body>
</html>

I the last example :
1°) the align statement in "img" does nothing, the image is always left side
2°) The second row have no horizontal border.

Any help is welcome.




# 2  
Old 03-08-2015
This is invalid:
Code:
        <tr>
            <td colspan="<?php phpinfo(); ?>">
            </td>

Since colspan expects its value to a numeric integer one.
What you probably wanted is:
Code:
        <tr>
            <td colspan=2>
                     <? php phpinfo(); ?>
            </td>

hth
# 3  
Old 03-09-2015
Hello.
Script 1
Code:
<!DOCTYPE html>
<html>
<head>
<style>
div {
    padding: 10px ;
    border: 5px solid navy;
    margin: 10px ;
}
img {
    padding: 10px ;
    border: 10px solid cyan;
    margin: 10px ;
}
</style>
<title>THIS IS THE TITLE</title>
</head>
<body>
<div>
<center>THIS IS TEXT 1</center>
</div>
<div>
<img src="image_1.jpg" alt="stuck-out_tongue.png"
 height="480" width="640" >
</div>
<div>
<center>THIS IS TEXT 2</center>
</div>
<?php phpinfo(); ?>
</body>
</html>

Image is not between text 1 and text 2
Image is not in "it's box"
Image is not in the middle.
Image has no cyan border
Text 2 is not in the middle ( because of the image )

SUSE Paste

============================================
Script 2
Code:
<!DOCTYPE html>
<html>
<head>
<style>

img.container1 {
    display: block;
    padding: 10px ;
    border:  10px solid cyan;
    margin:  10px;
    margin-left: auto;
    margin-right: auto
}

</style>
<title>THIS IS THE TITLE</title>
</head>
<body>
    <table>
        <tr>
            <td>
                <img class="container1" src="image_1.jpg" alt="stuck-out_tongue.png" height="240" width="320" >
            </td>
        </tr>
    </table>

    <div>
        <center>THIS IS TEXT 1</center>
        <br>
        <center>THIS IS TEXT 2</center>
    </div>

    <table>
        <tr>
            <td colspan="<?php phpinfo(); ?>">
            </td>
        </tr>
    </table>
</body>
</html>

Image stay left

SUSE Paste

==================================

script 3
Code:
<!DOCTYPE html>
<html>
<head>
<style>

img.container1 {
    display: block;
    padding: 10px ;
    border:  10px solid cyan;
    margin:  10px;
    margin-left: auto;
    margin-right: auto
}

</style>

<title>THIS IS THE TITLE</title>
</head>
<body>
    <table>
        <tr>
            <td>
                <img class="container1" src="image_1.jpg" alt="stuck-out_tongue.png" height="240" width="320" >
            </td>
        </tr>
        <tr>
            <center>THIS IS TEXT 1</center>
            <br>
            <center>THIS IS TEXT 2</center>
        </tr>
        <tr>
            <td colspan="<?php phpinfo(); ?>">
            </td>
        </tr>
    </table>
</body>
</html>

SUSE Paste

Image stay right
Text is not after image, and not before php function


================================

Script 4
Changing
Code:
 <tr>
<td colspan="<?php phpinfo(); ?>">
</td> </tr>

by
Code:
<tr>
<td colspan=2>
<?php phpinfo(); ?>
</td>
</tr>

Does not make any difference

Thank you for helping
# 4  
Old 03-09-2015
Try

Code:
<style>
.center{
 	text-align:center
}

.container1{
    display:block;
    height:240px; 
    width:320px; 
}
</style>
 <table>
        <tr>
            <td class="center">
                <img class="container1" src="image_1.jpg" alt="stuck-out_tongue.png" />
            </td>
        </tr>
        <tr>
          <td class="center">
            <center>THIS IS TEXT 1</center>
            <br>
            <center>THIS IS TEXT 2</center>
         </td>
        </tr>
        <tr>
            <td>
                 <?php phpinfo(); ?>
            </td>
        </tr>
  </table>


Last edited by Akshay Hegde; 03-09-2015 at 07:53 AM..
# 5  
Old 03-09-2015
Quote:
Originally Posted by Akshay Hegde
Try

Code:
<style>
.center{
     text-align:center
}

.container1{
    display:block;
    height:240px; 
    width:320px; 
}
</style>
 <table>
        <tr>
            <td class="center">
                <img class="container1" src="image_1.jpg" alt="stuck-out_tongue.png" />
            </td>
        </tr>
        <tr>
          <td class="center">
            <center>THIS IS TEXT 1</center>
            <br>
            <center>THIS IS TEXT 2</center>
         </td>
        </tr>
        <tr>
            <td>
                 <?php phpinfo(); ?>
            </td>
        </tr>
  </table>

Image has bad size ( full size not 240x420 )
Text is above picture

SUSE Paste

Thank you for helping
# 6  
Old 03-10-2015
Its weird, i only get the 'proper' (as in expected) output, when removing the styles.

Also, AFAIK, mixing up table and div method to display may cause such similiar issues as we see here.
Though the styles of the last example were/is css method. Smilie

hth
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Using PHP to view syslog in private web page

I am trying to extract data from syslog and view it on a web page. I'm using a php script. This line works from command line tail -n 11 /var/log/_gateway-syslog.log | grep -a iWiSP-Out | awk '{print $8, $9,$10,$11" ",$19," " $15, $16,$17," " $18,$21, $22}' when I put it into... (4 Replies)
Discussion started by: ae4ml
4 Replies

2. UNIX for Advanced & Expert Users

Gmail cannot view picture through web browser through squid proxy server

Hi, forum reader, I have a squid problem. We have 2 squid proxy for two different group staffs, both of them can access gmail for web email access. It used about half year. One day we send out email with image but one proxy group user cannot view that pic but another group can see. Any idea for... (2 Replies)
Discussion started by: justinianho
2 Replies

3. Shell Programming and Scripting

Copy text from web page and add to file

I need help to make a script for Ubuntu to OSCam that copy the text on this website that only contains "C: ip port randomUSERNAME password" and want to exclude the text "C:" and replace the rest with the old in my test.server file. (line 22) device = ip,port (line 23) user =... (6 Replies)
Discussion started by: baxarn
6 Replies

4. Shell Programming and Scripting

Grep text matching problem with script which checks if web page contains text.

I wrote a Bash script which checks to see if a text string exists on a web page and then sends me an email if it does (or does not e.g. "Out of stock"). I run it from my crontab, it's quite handy from time to time and I've been using it for a few years now. The script uses wget to download an... (6 Replies)
Discussion started by: gencon
6 Replies

5. Programming

Need a help in automating the http authenticated web page - via PHP scripting

Hi all, Need a help in PHP scripting. Am automating a process in web page. The process is 1. i have to open that web page using the user credentials (Username and password). 2. select a drop down and click submit button. 3. Then check for the status of the page. Please help me how to... (1 Reply)
Discussion started by: vidhyaS
1 Replies

6. UNIX for Dummies Questions & Answers

Possible to download web page's text to a file?

Hi, Say there is a web page that contains just text only - that is, even the source code is just the text itself, nothing more. An example would be "http://mynasadata.larc.nasa.gov/docs/ocean_percent.txt" Is there a UNIX command that would allow me to download this text and store it in a... (1 Reply)
Discussion started by: Breanne
1 Replies

7. Shell Programming and Scripting

File to web page

Hi all, I am having an XML file. And as per requirement I need to map fields of this file with various field of web page. So how can I use wput command into it ? Regards, gander_ss (3 Replies)
Discussion started by: gander_ss
3 Replies

8. UNIX for Dummies Questions & Answers

Make a Web page

I'm 13 years of age and I am into computers. I am trying to learn how to make a webpage. I could use the help and I would greatly appriciate it. (1 Reply)
Discussion started by: lydia98
1 Replies

9. Shell Programming and Scripting

PHP: display text and picture

Can someone give me a script in php to: Connect to Mysql: DB= content TABLE = message Enter text , about 3000 characters, and put a image either left or right, top or bottom or the text. Please someone make me this script, ive spent several hours trying to figure it out. (1 Reply)
Discussion started by: perleo
1 Replies

10. UNIX for Dummies Questions & Answers

Web page hosting

I built my website based on Dreamweaver, on Windows platform. My server uses Unix, and the page doesn't look too good. Is there any way to solve this problem without too much of a headache? (1 Reply)
Discussion started by: PCL
1 Replies
Login or Register to Ask a Question