Sponsored Content
Full Discussion: PHP: problem with index.php
Top Forums Shell Programming and Scripting PHP: problem with index.php Post 37948 by perleo on Wednesday 2nd of July 2003 04:42:52 PM
Old 07-02-2003
okay, i have a table named stories. it has 1 picture.
i have the db done fine

how do i just get the text from it and display it and align the pic to the right top side of the text.
i have this but will it work

$conn = db_connect();


$sql = "select * from stories
where page = '$page'
and published is not null
order by published desc";
$result = mysql_query($sql, $conn);

while ($story = mysql_fetch_array($result))
{
print '<h2>'.$story['headline'].'</h2>';
if ($story['picture']) {
$size = getImageSize($story['picture']);
$width = $size[0];
$height = $size[1];
print "<img src=\"".$story['picture']."\" height=\"$height\" width=\"$width\" align=\"left\" />";

}
print $story['story_text'];

}
 

7 More Discussions You Might Find Interesting

1. Linux

PHP problem

Hi frnds I installed phpmyadmin for OTRS but when ever i tried to open the phpMyAdmin-2.6.2/index.php page i m getting the following error " urldecode the db name if (isset($lightm_db)) { // no longer urlencoded because of html entities in the db name // $db =... (8 Replies)
Discussion started by: naik_mit
8 Replies

2. Filesystems, Disks and Memory

why the inode index of file system starts from 1 unlike array index(0)

why do inode indices starts from 1 unlike array indexes which starts from 0 its a question from "the design of unix operating system" of maurice j bach id be glad if i get to know the answer quickly :) (0 Replies)
Discussion started by: sairamdevotee
0 Replies

3. Shell Programming and Scripting

Index problem with awk

Hello, I have this code: #!/bin/sh awk -v val="........." 'BEGIN{FS=OFS=" ";c=0} NR==FNR&&d==0{a=$0; c++;next} FNR==(NR-c){b=val;next} {if(1234 in a){print "okay"}} {print $1}' listi fpr.11 grn that is working (awk find the value in the table "a" and return "okay" followed by 1234) ... (2 Replies)
Discussion started by: jolecanard
2 Replies

4. Web Development

I can't open my index.php page after insert php code

Hello guys, Does anyone can help me? I've just made my simple index.php without any code, but after insert session code to check if any user is authenticated, my index.php doesn't work anymore. Any fresh eyes could help me to see what and where the code is wrong? <? if... (6 Replies)
Discussion started by: metalfreakbr
6 Replies

5. UNIX for Advanced & Expert Users

Running multiple php scripts into one php only, cron mail alert problem...

hi, while separated they produce the usual mail alert and i can see the output... if i write into the php script: <?php system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script1.php'); system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script2.php'); system('php -f... (0 Replies)
Discussion started by: 7stars
0 Replies

6. Red Hat

Update php 4.3 RPM to php 5.3.3 php

Dear All, My redhat version is: # cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 4) # # uname -a Linux cotapplication3.cot.com 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux # I want to update my php from: # php... (1 Reply)
Discussion started by: monojcool
1 Replies

7. Shell Programming and Scripting

Running php index.php as shell in webpage

so i have a bit of a unique situation. i have an encrypted index.php file that that can't be run the normal way that a web browser would run it. if it is run the normal way, the php script will show only gibberish on the web browser, instead of the actual php code. when run from the command... (8 Replies)
Discussion started by: SkySmart
8 Replies
MPICTURES(6)							   Games Manual 						      MPICTURES(6)

NAME
mpictures - picture inclusion macros SYNOPSIS
troff -mpictures [ options ] file ... DESCRIPTION
Mpictures macros insert PostScript pictures into troff(1) documents. The macros are: .BP source height width position offset flags label Define a frame and place a picture in it. Null arguments, represented by "", are interpreted as defaults. The arguments are: source Name of a PostScript picture file, optionally suffixed with (n) to select page number n from the file (first page by default). height Vertical size of the frame, default 3.0i. width Horizontal size of the frame, current line length by default. position (default), or to left-justify, center, or right-justify the frame. offset Move the frame horizontally from the original position by this amount, default 0i. flags One or more of: ad Rotate the picture clockwise d degrees, default d=90. o Outline the picture with a box. s Freely scale both picture dimensions. w White out the area to be occupied by the picture. l,r,t,b Attach the picture to the left right, top, or bottom of the frame. label Place label at distance 1.5v below the frame. If there's room, .BP fills text around the frame. Everything destined for either side of the frame goes into a diversion to be retrieved when the accumulated text sweeps past the trap set by .BP or when the diversion is explicitly closed by .EP. .PI source height,width,yoffset,xoffset flags. This low-level macro, used by .BP, can help do more complex things. The two arguments not already described are: xoffset Offset the frame from the left margin by this amount, default 0i. yoffset Offset the frame from the current baseline, measuring positive downward, default 0i. .EP End a picture started by .BP; .EP is usually called implicitly by a trap at frame bottom. If a PostScript file lacks page-delimiting comments, the entire file is included. If no %%BoundingBox comment is present, the picture is assumed to fill an 8.5x11-inch page. Nothing prevents the picture from being placed off the page. SEE ALSO
troff(1) DIAGNOSTICS
A picture file that can't be read by the PostScript postprocessor is replaced by white space. BUGS
A picture and associated text silently disappear if a diversion trap set by .BP isn't reached. Call .EP at the end of the document to retrieve it. Macros in other packages may break the adjustments made to the line length and indent when text is being placed around a picture. A missing or improper %%BoundingBox comment may cause the frame to be filled incorrectly. MPICTURES(6)
All times are GMT -4. The time now is 09:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy