Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Formating Echoed Table


How would I format the table with borders backgrounds etc.

printf("<table>");

do
{
$myrow = pg_fetch_row($result_set,$rows);
printf("<tr>");
for ($i=0; $i < $count_ch; $i++)
{
printf("<td>");
printf($myrow[$i]);
printf("</td>");
}
printf("</tr>");

$rows++;
}
while($rows < $rowsnum);
}




View Complete Forum Thread with Replies

Related Forum Messages:
Being Echoed
I have following html before head of html in my page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

View Replies !
HTML Echoed Out
Does anyone have any idea why when I echo HTML it doesn't parse the HTML but outputs the code? I even added two <h2> tags manually and it works, so it's just from pulling it out of the database.

PHP Code:

<?php
//The <h2>s work fine but the array variable being outputted doesn't parse the HTML
echo "<h2>".$profile['biography']."</h2>";
?>

View Replies !
HTML Echoed
I have the notion that everything is more secure if everything is in php, and nothing is in html. Perhaps I am mistaken in my understanding. But, because I believe that everything would be more secure in php, I am trying to take an html form, and find a way to ECHO it in php.

It is an example form that I found in google.  It works just fine as HTML, and it is a submit to a php script which will receive the data through $POST. But, I am trying to build all the HTML in $form and then echo it. I am not having much success. Code:

View Replies !
Last Twelve Hours Echoed
I am so tried but can someone help and show me a basic way to only display the last twelve hours of results from the MySQL? I have a column with the time, how do I only show the last tweleve hours?

View Replies !
Echoed The MySQL Query
I'm currently building a time booking system, and what I have done is created a few tables in my database and populated these with some test data.

The problem I'm having is that I know for a fact that when I click on the 1st Sept for example the first couple of time slots have been taken,so for a test I've used the word 'booked', this works, if the time slot is not taken then it should say 'available', this doesn't do it.

I have echoed the MySQL query and I've test this on the MySQL console and it works, but yet it says 'booked' when its really not.

View Replies !
Variable In A Php Echoed Form
At the moment it prints " /> and I lose the variable.

<?php
echo '<form action="formt.php" method="post">
<input type="hidden" name="uname" value="$_SESSION["username"]" />
<input type="submit" label="submit"></form>'
?>

View Replies !
Saving Result Of Function Without Being Echoed
I am trying to save the function "rand(1, 1000000)" in a variable but when I am for example trying:

$randomnumber = rand(1, 1000000);

it is executing it right ahead while when i try

$randomnumber = "rand(1, 1000000)";

or

$randomnumber = 'rand(1, 1000000)'

It is saving rand(1, 1000000) as variable.

But what I need is a variable saving the result of rand(1, 1000000) so the number does not change either.

Any ideas how I would do this?

View Replies !
Accessing Session In A Php Page Echoed By Fstream
if I load a php page from controller.php like this:

$handle = fopen("http://localhost/MvCphp_1.0/View/maincatgory.php", "rb");
               echo stream_get_contents($handle);
               fclose($handle);

then the created session, in the file where I am running the above code,  for instance $_Sesssion['hr']='ge'; will not be accessible in echoed file above "maincatgory.php" I don't know why? and I want to know how can I access...?

View Replies !
Get A Database Stored Date Echoed On A Website
I'm trying to get a database stored date echoed on a website. The problem is it won't show up. This is the code piece getting the rows:

$row3 = mysql_fetch_array($result);

This is the piece declaring date to $actualdate:

$actualdate = $row3['date'];

This is the piece echoing the date:

echo $actualdate;

I'm sure I'm doing some damn mistake here, it's probably really easy for you other guys to solve.

View Replies !
How To Create A Hidden Field Variable From An Echoed PHP Figure?
I have a PHP script on a shopping cart summary page that creates an invoice number and then echoes it to the page. This page, when submitted, will go to the shopping cart processor.

The echo portion of the script is working properly, it generates the number as intended.

My problem is that, not being very experienced in PHP, I want the invoice number not only echoed (which it is doing properly now), but also to populate a value in a hidden field that is submitted to the shopping cart processing page. My question is how do I populate the hidden field with the figure that is now being echoed in the script below?

The script that generates and echoes the invoice number is as follows:

<?php
echo "SA"; //department code
echo date ("mdy"); //date generator
// begin counter this reads figure from "count_file.txt"
if (file_exists('count_file.txt'))
{
$fil = fopen('count_file.txt', r);
$dat = fread($fil, filesize('count_file.txt'));
echo $dat+1;
fclose($fil);
$fil = fopen('count_file.txt', w);
fwrite($fil, $dat+1);
}
else
{
$fil = fopen('count_file.txt', w);
fwrite($fil, 1);
echo &#391;'
fclose($fil);
}
// end counter
?>

The hidden field is as follows:

<input name="Invoice_Num" type="hidden" id="Invoice_Num" value=" ">

I would like the value in the above to reflect the invoice number that is echoed by the above PHP script.

View Replies !
Csv Formating
how to take a CSV file from a URL and display it in a webpage. Only displaying 4, 6, 8, 11 fields each line in reverse (lastest ontop or first)

$row = 1;
$handle = fopen("123456.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>
";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "
";
}
}
fclose($handle);

View Replies !
Formating A String
I am using php4 and was wondering how to have php cut down a string automatically.

for example I have:
/cfvl/about/index.php
or
manyDirs/endlessDirs/cfvl/about/index.php

I want php to cut down this string so that it will only say:
"/index.php "

Does php have the functionality to do this?

View Replies !
Formating Numbers?
I'm wanting to format numbers with ','

e.g.
100 => 100
1000 => 1,000
10000 => 10,000

and so on...

View Replies !
Formating Time
I have a form and in it it contains the ability for someone to choose the date. I used drop-down boxes to do this...

Drop-down1 contains the months(december, etc), drop-down2 contains the days (1,2,3,etc.), and drop-down3 contains the years (2003, etc.) So, after they make their selection the date would be formated as follows: Month/Day/Year => December 29, 1979

I need to submit this date to my mySQL database and have it convert itself into the format that mySql uses.

View Replies !
Formating PDF Files
The following code does generate a PDF file. My problem is that I have a sql blob with html content that I need to parse through and format my pages correctly. As a second request, the code I currently use send the PDF directly to the browse, which is what I was wanting for testing, however for production I would like to actually compress the file and send it to the browser to save. PHP Code:

View Replies !
Formating This String
I receive string like this:
"aaa.bbb.ccc.com <20000>"

I need to get only number 20000.
How can I get numbers betwwen the "<>"

View Replies !
Php Code Formating
For debugging purposes of handling evaled code I first write it to a temp
file and then use include. The problem is, is that the code is not formatted
and is very hard to follow.

Is there a php library out there that will format php code so that its
readable?

that is, I want to take a string of php code and add white space and line
feeds to make it readable.... my simple method of adding newlines after ;'s
and {'s don't work well cause some strings contain substrings with code in
it that should not be parsed.



View Replies !
Formating Date
I know how to get, format and display the current date but what I cant do is to format and display a date that has been retrieved from mySQL DB. Example 2007-07-18 (YYYY-MM-DD) How will I format it to display July 18, 2007?

View Replies !
Date Formating
I have a variable $date that holds the value of a the date of a business meeting I get from a database. Currently it outputs the date in "YYYY-MM-DD" format when I type:

echo "<td>$date</td>";

but I'd much rather have it the other way around DD-MM-YYYY. I'm sure there is a very easy way of doing this, but when I try the date() function I get the date 1970 (something to do with the UNIX timestamp).

View Replies !
PHP To MySQL Formating
I encountered this little problem though. How do I format data thats entered into a MySQL database (Or just anything for that mater) so it appears the same way that it was entered when its been called for again. You all know what i'm talking about right? Like a commenting system that holds formats of text data.

View Replies !
Formating Dates
I have 2 values, a date format and an actual date. eg. User specifies their date format is dd/mm/yyyy but I need it in yyyy-mm-dd so I want to compare the 2 values. so my idea was to split on the separator (which I have to figure out too heh)but once I'd got that part my idea was to do something like:

$date = array($dateFormat[0] => $data[0], $dateFormat[1] => $data[1], $dateFormat[2] => $data[2]);
$date['yyyy']."-".$date['mm']."-".$date['dd']

how to split on an unknown separator and secondly, can anyone think of a better way to do what I'm trying to do.

View Replies !
More Formating Date
I have a date field (for example): PHP Code:

$event_date = &#55614;&#57159;/03/04'

and I need it to output as 04/03/2007

I have tried using explode, but that doesnt work as I understand my date is already "exploded", I've also tried "flattening" it as a unix date and then explode it, but I get date results from another time dimension it seems. any idea pls?

View Replies !
Number Formating
I need to remove all trailing zeros without using an interger field in the DB. Example: 4.50000

I am inserting into a varchar field and this field preserves the original number. I need to strip these trailing zeros before insert or update without using number_format(), floor(), ceil() or round().

View Replies !
Formating Mail
my mail function works just fine but the textarea being emailed arrives unformated no line brakes, no carriage returns. how to solve this?

View Replies !
Conditional Formating
im working with a calendar script called phpicalendar, my install is here. I'm trying to get the cell background to change according to the text in the days event.

ie different class for cell bg I have figured out how to change the html in the template but im not sure how to carry this accross. Code:

View Replies !
Date Formating PhP MySQL
<?
$Query = "Select *";
$Query = $Query . ", DATE_FORMAT(eFrom , '%m/%d/%Y') as eFrom";
$Query = $Query . ", DATE_FORMAT(Thru , '%m/%d/%Y') as Thru";
$Query = $Query . ", DATE_FORMAT(FirstBillable , '%m/%d/%Y') as FirstBillable";
$Query = $Query . " FROM episodedata WHERE MR = '" . $MR . "' ORDER BY 'eFrom' DESC";
$Result = mysql_query($Query,$Link);
$Num = mysql_numrows($Result);
{
$i=0;
while ($i < $Num)
{
$eFrom=mysql_result($Result,$i, 'eFrom');
$Thru=mysql_result($Result,$i,"Thru");
$Status=mysql_result($Result,$i, "Status");
$Firstb=mysql_result($Result,$i,"FirstBillable");
$ID=mysql_result($Result,$i,"EpisodeID");
++$i;
?>
<tr>
<td width="150" class="List"><center><a href="episode_detail.php?EpisodeID=<?= $ID?>"><?= $eFrom?></a></center></td>
<td width="150" class="List"><center><a href="episode_detail.php?EpisodeID=<?= $ID?>"><?= $Thru?></a></center></td>
<td width="150" class="List"><center><?= $Firstb;?></center></td>
<td width="150" class="List"><center><?= $Status;?></center></td>
</tr>
<?
if ($i < $Num) {
$eFrom=mysql_result($Result,$i,"eFrom");
$Thru=mysql_result($Result,$i,"Thru");
$Status=mysql_result($Result,$i, "Status");
$Firstb=mysql_result($Result,$i,"FirstBillable");
$ID=mysql_result($Result,$i,"EpisodeID");
?>
<tr>
<td width="150" class="List2"><center><a href="episode_detail.php?EpisodeID=<?= $ID?>"><?= $eFrom?></a></center></td>
<td width="150" class="List2"><center><a href="episode_detail.php?EpisodeID=<?= $ID?>"><?= $Thru?></a></center></td>
<td width="150" class="List2"><center><?= $Firstb;?></center></td>
<td width="150" class="List2"><center><?= $Status;?></center></td>
</td>
</tr>
<?
++$i;
}
}
}
?>

Here is the problem!:
Normaly when i DATE_FORMAT() the sql query it formats my date with the arguments, it works on all other 15 of my pages but for some reason it just wont work here. The only difference between this page and all the other pages is the fact that im using the MYSQL_NUMROWS and then instead of $Variable=$Row['Var'] im using the $Variable=mysql_result($Result,$i,"Var"); Is the way im doing this wrong? I would think that the select would pull all the data and the numrows only counts the rows so i can pull the number to use my while statement. I wouldnt think it would affect the formating of my data. But it just returns the values in the standard mysql format with no formatting at all.

I'have also tried:

View Replies !
Formating Text Retrieved From A Db
I have a database that stories entries of short stories for a writers
website. I can easily input the data into MYSQL but my trouble lies in
retrieving the data.

the story in just cut and pasted from a WP into the TEXTAREA on the form.
When I look at the story in the DB I can see it retains all the paragraph
spacing etc. but when I try and read that cell when retrieving data all the
text is crammed into one paragrapgh. What am I missing? and how would I
retrive the story text formatted?

Should a parce the test before storing it out after?
Here's the code I use to retrieve....

View Replies !
Formating A MySQL Timestamp?
In a MySQL database I have a table called 'date' and it is a timestamp, now my problem is that I want to format that timestamp but everything I try does not seem to work?

I'm trying to get this:
20030905042059

To look like this:
Tuesday, September 2, 2003, 1:32pm

I have tryed this but it just does not work?
getdate ( [$newsrow[date]]);

View Replies !
Formating External Text
I have a quick question about the formatting of external text files.

I am trying to make a webpage for a local church that will display what
is on in the coming weeks. I have done this using an external text file
so that the future users will never have to modifiy the page itself.

If left as plain text, it shows on the page in default format. I know I
can format the text within the text file using standard HTML, but is
there a way of formatting regular text outside of the text file? Kind
of post processing it? The file format will always be something like

Monday 19th
09:00 Add event here
12:00 Add event here

Tuesday 20th
09:00 Add event here
10:00 Add event here
13:00 Add event here

etc...

The number of events on each day is variable, and not every day may
feature (could be monday events then thursday events). I would like to
make the Day and date bold, the times italic...well you get the idea!

I have an idea that I will need to impose a structure on the file,
however I am unsure of how to do this. If this is the case, then I
would appreciate it if someone could post a link to a decent tutorial
or guide so I can learn it!

View Replies !
Formating Html Tables
I'm tring to format output from a mysql table in html table fromat. I'm using the statement below and am having trouble with formating specifically the table width, border width, etc. My code:

View Replies !
Date & Time Formating
How can you make a time stamp that looks like : 20031107161610 better to look at e.g 07/11/2003 16:16:10

View Replies !
Email Output Formating
Just trying to get a clean email output format. I have a form that sends me an email and i need the output to look nice, however when i insert my HTML code, i get parse errors.
PHP Code:

View Replies !
Formating Mysql Datetime
I have a variable $dateTime which is set from a mysql query.  The value will always be datetime as that is how the mysql column is set. I want to change the formating of the variable to return a value like august 19 at 3:30 pm.

View Replies !
Formating Numbers For Currency
I believe I need to store data with no commas in mysql. When I display a variable that is a number, I want the commas in. But I dont have a function that just takes 123455678 and makes it $123,455,678.00, You know type $, like I stated, I could write it, but figure it’s out there in php land.

View Replies !
Formating Time Passed
when i insert new date into mysql im adding a timestap as well. im trying to format how old the row is when i output it.

convert this:
20050612231933

to this:
2 days, 19 hours ago

should timestamp be used for this or should i use datetime? any ideas?

View Replies !
Number Formating 1 To &#3901;'.
I am tryin to format a number from, for example, 1 to &#3901;'. How is this done?

View Replies !
Formating Output Of Fwrite
I want to output lines, line by line to a text file and am using fwrite with an array and a loop. I want to place quotation marks around the word. so the output would be like so:

"pig"
"dog"

but I am getting

"pig
""dog
""horse

my fwrite line is:

fwrite($fh,"" .""".$name[$i].""") ...

View Replies !
Date Formating Issue
I am using a javascript imput date calendar to search events by date. When you select a date, an input text field gets filled up imediatly with the value selected in the calendar. So, if I pick a date of the calendar, the textflied lists the selected date as: DD/MM/YYYY. which is perfect as it is a UK website. The problem is that all dates in my database have been inputed as YYYY/MM/DD .

So when I click on the "Search button" I would need to have my date: DD/MM/YYY Y converted" to YYYY/MM/DD so the database can be searched properly and return the matching value. Do you know what I mean? Is there a way to create a function to do that?

View Replies !
Formating String To Date In PHP
this seems to be silly part for me to ask you anyone plz help me...

$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];

if
day = 12
month = 6
year = 1976
entered in form

how to format it into a date in php. I know its really silly . as im new to PHP i'm stumbling even at slightest pieces like this.

View Replies !
Formating Filesize In Bytes
i want to format the bytes into megabytes, can somebody give me the exact codes

<?

function getUsedMemory($login)
{
// HAAL ALLE LINKS VAN EEN BEPAALDE PERSOON EN BEKIJK GROOTTE
$sql = 'SELECT bestand FROM uploads WHERE lid ="'.$login.'"'
$resultSet = mysql_query($sql) or die(mysql_error());
$memory = 0;
if(mysql_num_rows($resultSet) != 0)
{
while($row = mysql_fetch_row($resultSet))
{
// row[0] is de url naar een bestand dat geupload is door gebruiker
$memory += filesize($row[0]);

.......................

View Replies !
Parsing/formating XML Results
i have a php file that makes a request to an outside server and returns xml output into a variable in the php file.

// Get the result, a native PHP type, such as an array or string
$result = $proxy->GetCategoryList($parameters);

// Displaying result
echo($result);

The results are XML and I need to be able to parse and format it before I echo it out. Had thought about using XSL but the results come back and I can't add the link to the style sheet (can;t figure out how to do that anyway). have tried to use the xml parser function but I have not had any luck with that.

I have been able to use a php script called Unserialize.php. While it will parse out the information and display it as text and xml I can't figure out how to format it becuase even that is all stored in a single variable. any ideas or other things I might try?

View Replies !
Formating Month In Date()
Script to show file creation date is as follows

$filename = "file.txt";
if (file_exists($filename)) {
echo "<p class="ftime">Dodano: " . date ("d F Y H:i:s.", filemtime($filename))."</p>";
}

it outputs something like

01 January 2001

How can i replace january with month in my language. i searched but couldn't find the answer.

View Replies !
PHP Input String Formating
Using an input form where users can input text, I'm formating it using 'trim' and 'nlbr2'. I've noticed my formating still does not hold all the users input formating
say I input the following:

Hello!
This is my test.

but when viewing it I see this.

Hello!
This is my test.

What do I use to hold onto the users entire input format? This would include tabbing and so forth. Would that be utf8encoding? I suspect most of this problem comes from the 'trim' function.

View Replies !
Perserve Formating Of Text
I am creating a small site, that will have content that is uploaded by multiple people, These people will not have knowledge of html so I need to find a way to perserve the formating that they use when they enter the content into the text box, I was going to use the <pre></pre> tags, but when I use them if they do not put a break in then the line will spill over the container that it is in.

I am using divs, but I have noticed it does the same thing with tables. My content has a dynamic width so I can't use wordwrap() to set a certain char limit. What would be the best way to handle this? Would it be better to have a script check for line breaks in the submission and add a <br> tag to it.

View Replies !
Html Formating And Databases..
I'm creating my first (1st) dynamic website, and one of the elements I'm including is news articles. Now, I can get the query join I need for topics, authors, and everything. Now, I just need to be able to enter and then display the content of the article.

right now, entering the article dosen't retain page breaks. i.e. I lose my paragraphs. Can anyone point me to a resource that'll teach me how to retain page breaks from the entry form, and how to format them when retrieved for display?

View Replies !
Formating Of Php Values In Html Email
I have been trying to send HTML formated emails with the mail() fuction, read php manual and threads here on the subject. I got them to work fine except that the php values that are supposed to "print" in the emails either dont or I get an error.

For instance part of my $message = PHP Code:

<tr>
    <td height="25" valign="top" class="bluetext"><strong>Event</strong></td>
    <td width="349" height="25" valign="top"> $sub_category &gt; $style &gt; $event_name</td>
  </tr>

is supposed to print the values for $sub_category , $style and $event_name in the sent email. Instead it simply write $sub_category etc. in the email. This works fine in plain text email but not in the HTML fomated one. I have also tried using the echo tags but no luck. What format should those variables be written?

View Replies !
Formating Xml Results Passed From A Php Parser Script
How can i format my results when parsing xml to PHP? At the moment the value for $data is not formated. I was wanting to put line breaks after each <slide>. PHP Code:

View Replies !
Code Which Can Cater To All Types Of Mail Formating
I was searching the net for code which can cater to all types of mail formating and found this: PHP Code:

View Replies !
Email Formating Problems Caused When Adding Input Type
I am not too good a php - even though my site is all php - need to find some reliable. Here's my problem:

I tried adding email response forms and they are giving me wierd responses: This is blowing up in ways that I can't describe: Code:

View Replies !
Find All Of The Rows In The Primary Table That Doesn't Exist In The Foreign Table
i have 2 databases, one uses the primary key of another as the foreign key. I want to find all of the rows in the primary table that doesn't exist in the foreign table. e.g:

table jobs:

job_id
company_id
job_name
job_text
date
...

table companies
company_id
company_name
...

from the example above i want to find all companies that have NOT had any jobs between one date and another.

View Replies !
Create A Mysql Query That Will Look In A Table And Come Back With The Most Used Phrase In A Certain Cell In The Table?
How can I create a mysql query that will look in a table and come back with the most used phrase in a certain cell in the table?

4|Truck|Chevy
5|Car|Honda
6|Car|Toyota
7|Van|Chevy
8|Car|Mitsubishi
9|Truck|Toyota

I want a print out from mysql to be like this:

Car 3
Truck 2
Van 1

Is there any way to have it count up how many of each unique things there are in a cell in a table, and have it decending from the first one being the highest number?

View Replies !
Integrate A VBulletin Board User Table With Another Software Projects Table.
I'm trying to figure a simple query out but for some reason I can't think of how to do it? It's been a while since I've played with the two and I couldn't even find anything on Google either. What I'm trying to accomplish is fairly simple. I'm trying to Integrate a vBulletin board user table with another software projects Table.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved