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




Convertion Of Results From "size Of Directory" Function


I've fetched the following code from the comments at URL and I want it to report the results in megabytes instead of the default (bytes). PHP Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
'echo "": No Such File Or Directory" Error Using "exec" To Pipe In PHP Script
[TCL]
set php {<? print_r("Hello World"); ?>}
puts $php; # PRINTS OUT <? print_r("Hello World"); ?>
puts [exec "echo '$php' | php -q"]
[/TCL]

When I try this within TCL I get the following error:

Any File Size Limit In <PARAM Name="***" Value="***"> ?
I embed an applet in my php script which has a parameter providing an
input file for the jar. Does this file has size limit?

The code is as follows:
<APPLET ARCHIVE="myapplet.jar" WIDTH=372 HEIGHT=360 VSPACE=0 HSPACE=0
ALIGN=middle>

<?php echo "<PARAM NAME="data" VALUE="myfile.">";?>

when "myfile" is beyond 15M, my applet cannot load sucessfully, but
while this file is limited like 5M or 7M, it works well.

Does anybody know is the reason caused by php script limit, applet
mechanism, or by different browser?

Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP" And "smtp_port" Setting In Php.ini
Warning: mail(): Failed to connect to mailserver at "localhost" port 25,
verify your "SMTP" and "smtp_port" setting in php.ini

in php.ini I have:

SMTP = localhost
SMTP_PORT = 25
SENDMAIL_FROM = NULL
SENDMAIL_PATH = "H:WINNTsystem32" (this is where sendmail.dll is
sitting. H is the drive with w2k)

Other PHP code on that page is working.

What else should I check?

Alphabetize Results Ignoring "and" And "the"
is there a good way to alphabetize results and ignore articles like "the", "and", "a", and "an" so that it will alphabetize by the next word? just wondering...

Why Use "Stripslashes" And "Addslashes" Function
Can someone let me know why one would use strip slashes or add slashes functions. I know what they do but cannot see the exact use for them e.g. if i have a textfield and encase it in an stripslashes function, it will escape any back slashes etc...

Size Of "images" Created By Imagestring
imagestring essentially turns text strings into images. Unfortunately,
these images can be of any size and, as far as I know, an images size
needs to be decided upon before imagestring is called.

So is there anyway the size that imagestring would require could be
calculated before the image was created?

How Do I Do Something Like $color = ("red", "yellow", "blue")[$colornum]?
How do I take an index of a literal array, instead of a variable?

That is, say I want to get the short name of a month. Can I do
something like:

$monthname = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec")[$month];

or do I always have to do:

$blah = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec");
$monthname = $blah[$month];

It seems a shame to have to create a variable specifically for this
one-shot purpose.

"failed To Open Stream No Such Directory Or File" Apache Suse 10.0
<<"failed to open stream no such directory or file>>

Avez vous trouve ? J'ai le meme genre de probleme en essayant
d'installer en local avec SuSE 10 apache2 php4 , il me semble qu'il
manque un package mais lequel ?

Quote:

Can't Install PHP - Keep Getting "Invalid Directory" Error Regarding The Path To Apache Httpd.h
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying
to install PHP 5.1.4. I can not get the ./configure command to work. I
keep getting this error:

configure: error: Invalid Apache directory - unable to find httpd.h
under /usr/local/apache/include

So then I run this command:

find / -name httpd.h

which should find every file on my machine with the name "httpd.h".
These are the results I get:

/usr/local/apache/include/httpd.h
/home/shelley/apache_1.3.36/src/include/httpd.h

So I've rerun the ./configure command, using this first:

--with-apache=/usr/local/apche/include

and since that didn't work:

--with-apache=/home/shelley/apache_1.3.36/src/include/httpd.h

but I get the "Invalid directory" error with both addresses.

Make PHP Find Windows Directory. I Need The Php Equivelant To "%WINDIR%"
I've written a small gui for PHP.ini but I don't know how to make PHP find the windows directory itself. You'll probably understand better when you see the code below.

I'm currently using the line:
Code: $PHP = new Config ("c:windowsphp.ini",";"); And that works fine but only if PHP.ini is in c:windows.
I tried
Code: $PHP = new Config ("%WINDIR%php.ini",";"); but that dowsn't work, I need something that finds windows dir. itself, Any ideas?

You can see an example of it at http://213.152.46.100/gui/php-config.php (Uses a temp PHP.ini so you can't mess nothing up, feel free to play about with it)

How Do You Pass A Variable Via A "pseudo-directory" Or URL Prefix?
I've searched everywhere for this but I'm not sure exactly what to
search for.

What I am trying to do is pass a variable to a php script via the URL.
However, I don't want to use the standard "?name=value format." I want
to either pass the variable as "value website.com" or
"website.com/value" where the script is stored in some directory
"website.com/script/index.php" and the value gets stored in a variable
declared within my php script.

I have seen this done but I just need some guidance on how to go about
doing it.

How Can I Remove Session Files In The "tmp" Directory?
How Can I Remove Session Files In The "tmp" Directory?

I have just started working with "sessions." A Unix server stores a temporary file in a "tmp" directory. The temporary files include a string of numbers for the sessions variable.

I need to devise a way to remove the temporary sessions files from the "tmp" directory on the server. If you would, please respond and indicate:

1). What is the best way to remove the sessions files from the "tmp" directory? or 2). What is the best way to handle the sessions files in the "tmp" directory?

How Do I Figure Out The "full Path" To My Directory
I'm running a script at the moment that requires the full path to my directory.

How do I figure this out?

Preventing Visitors Ability To "re-visit" A Page Via The "back Button"..
I have a rather complex registration/member sign up form.. which gets a little confused, when a visitor "backs" completely out of the form, then for whatever reason returns to the form. The form contains 'cancel' buttons, which naturally cancel the reg process and redirects them to the document just before they started.

JS provides us with the "location.replace()" method, but I can't seem to find a way to coordinate the use of location.replace() with the posting of the form values. In short, I want to "replace" the first step of the form with the "second step".

I think what's making this tricky, is that each step of the form are located within the "same" page (register.php). The document works like so: The first step is the "Member Agreement" when they click "agree" (submit) the system creates a new row in the temporary register table of the db.

It then issues a registration cookie, which carries the row id, and session value. in addition (for those cookie impared users) we carry the row id and session value in hidden elements. So far, as long as the user continues through the process all is fine, but if they (for whatever reason) back all the way out, and click 'agree' again, the process fails.

I guess I have to find a way to force a reload of the 1st step "if they've gone back" OR "replace()" the first step with the second, so as to prevent the user from going "back" to the 1st step of the register page.

<font Size="-1">
I can put out a Word Doc from PHP but if I try and manipulate the font
size in the PHP part it outputs a blank Word Document.

Here is what I have:
<?php
$fname="report.doc";
$handle = fopen( $fname, "rb" );
$buf = fread( $handle, filesize( $fname ));
fclose( $handle );
$len = strlen( $buf );
header( "Pragma: public" );
header( "Cache-Control: private" );
header( "Connection: close" );
header( "Content-Type: application/msword" );
header( "Content-Length: $len" );
header( "Content-Disposition: inline; filename="$fname"" );
print $buf;

Errors Won't Show Up Even With Error_reporting(E_ALL) And Ini_set("display_errors","1")
Here's my code:

<?php

error_reporting(E_ALL);
ini_set("display_startup_errors","1");
ini_set("display_errors","1");

wefw
wefwef=wefwe
2349023909()
;wrgwrg ====232

phpinfo(); ?>

I get a blank page.

If I take out the crap, it prints phpinfo() just fine.

PHP 4.3.something...

Pagnation - Limit Number Of Pages Between "Previous" & "Next" Hyperlinks
Was hoping for some advice with a part of page navigation....

It works at the moment so there is a "Previous" & "Next" Hyperlink underneath the records. In between the Previous & Next links are the number of pages that there is of these records. e.g:

Previous 1234 Next

This is fine if there are only a few pages of records, but when there are hundreds of pages the numbers are listed and they take up half the web page with them.

How can i make it so only limited 10 numbers of pages say appear between the "Previous" & "Next" Hyperlink and as you progress through the pages they are as do the next 10 numbers of pages? Code:

Listing Directory With "grep"
I'm using the readdir function to list in a php page all the files into
my directory,

Is there a function that permit me to list all file grepping the "rom"
word?

I've got:

<?php
if ($handle = opendir('/opt/dir')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file<br>";
}
}
closedir($handle);
}
?>

in shell I would like to have:

ls /opt/dir | grep -i rom

[regex] Stripping Out "name" And "value" Values Out Of Tags, Aaargh
Searched through the site, but couldn't find the right regex syntax I was looking for.

the thing i want is, to extract with preg_match_all the given values in a tag...

ex.

$str = '<input type="text" name="name" value="value">'
$pattern = some magic stuff I need to know
preg_match_all($pattern, $str, $result);

And in result I want to have the values text, name and value AND it's important that the order doesn't matter
so structure of tags can be <input type =name= value=> or <input name= class= value= type=> etc, etc...

Group Mailing, Want To Suppress All The "to" Addresses In The "to:" Field
I want to do a mass emailing for a club.
I don't want all the clubs members to see all the addresses of the
other club members for privacy reasons.

How do I set up the php mail function to not display the recipients
email addresses, just to display something like, "U7 Soccer Club
Team"?

'Parse Error' Problem In "isset" And "empty"
I've been having some problems with a parse error that I can't figure
out (PHP 4.3.11 on Solaris9). Sample code:

<?php
// getting strange parse errors on this
class A {
var $value;
function A() {
$this->value = 1;
}

function getValue() {
return $this->value;
}
}

$a = new A();
if (!empty($a->getValue())) {
echo "success";
}
else {
echo "failure";
}
?>

The result of this is:

Parse error: parse error, unexpected '(', expecting ')' in
/foo/public_html/parse_errors.php on line 15

I also get the same effect with "isset", however, testing with "is_null"
or "is_int" produces the correct ("success"/"failure") result. Any ideas?

Another "Fatal Error: Call To Undefined Function: Mysql_connect()"Question
I am getting the following error when I try to view a test page in my
browser. This test page just reads a table in mysql and outputs the
results.

Fatal error: Call to undefined function: mysql_connect() in
/var/web/public/test.php on line 2

I'm using:
Apache 2
MySQL 4.1.12
PHP 4.4.0

I have tried upgrading PHP to PHP5. I went back down to PHP4. I
verified that mysql.so was being loaded. I tried using the OLD_PASSWORD
feature in mysql. Verified that the PHP module is loaded in apache.

What is weird however (at least I think) is when I run the following via
telnet:

php ./test.php

It pulls up the page, connects successfully to the database and displays
the records. No error message.

Totally Lost! "Fatal Error: Call To Undefined Function: Mysql_connect()"
I'm a noob with a server so keep that in mind :) Been trying to connect
with php to mysql and all I get is:

"Fatal error: Call to undefined function: mysql_connect()"

I've read and read and can't figure out what is wrong. My current set
up is:

# rpm -qa | grep php

php-ldap-4.3.2-23.ent
php-mysql-4.3.2-3mdk
php-imap-4.3.2-23.ent
php-4.3.2-23.ent

# rpm -qa | grep php

php-ldap-4.3.2-23.ent
php-mysql-4.3.2-3mdk
php-imap-4.3.2-23.ent
php-4.3.2-23.ent

On RedHat 3.2ES

Can someone please help? I've been trying for 2 weeks now and I still
don't know what to do.

"copy()" Function Not Working With File Upload
Below is a multiple-file upload script. The form input part works ok. The variables $FileType, $FileName, $FileSize, $TempName, and $FileError work fine. But just after $FileError (which does not output an error message) the script just stops. The problem appears to be with the "copy()" function. I can simplify the script, make it just a single file upload script, use the variable $userfile for the first part of the "copy() function, and it uploads the file just fine.

The problem is when I try to make it a multiple-file upload script like the one below - then the copy function won't work.

I would appreciate if anyone could spot the problem.

PHP Code:

$Admin[UploadNum] = "10";
if($FileUpload) {
for ($Number = 1; $Number <= $Admin[UploadNum]; $Number++){
if ($FileUpload) {
$FileType = $_FILES["userfile"."$Number"]["type"];
$FileName = $_FILES["userfile"."$Number"]["name"];
$FileSize = $_FILES["userfile"."$Number"]["size"];
$TempName = $_FILES["userfile"."$Number"]["tmp_name"];
$FileError = $_FILES["userfile"."$Number"]["error"];
echo "File Type: $FileType<p>"; // $FileType prints out fine.
echo "File Name: $FileName<p>
"; // $FileName prints out fine.
echo "File Size: $FileSize<p>
"; // $FileSize prints out fine.
echo "Temporary Name: $TempName<p>
"; // $TempName prints out fine.
echo "Error Message: $FileError<p>
"; // Does not output error message - appears to work fine.
// ------------ The script stops working right here ------------
if (copy ($_FILES['userfile'.'$Number']['name'], "users/".$_FILES["userfile"."$Number"]["name"]."")) {
    echo "Your file was successfully uploaded!<p>
";
} else {
    echo "Your file could not be copied.<p>
";
}
}
}
unlink ($userfile);
}else{
echo "<form action="$PHP_SELF" enctype="multipart/form-data" method="post">
";
for ($Number = 1; $Number <= $Admin[UploadNum]; $Number++){
echo "<input name="userfile"."$Number" type="file" size="25">
";    
}
echo "<input name="FileUpload" type="submit" value="Upload Files"></form>
";
}

Client-side Function To Resize ".jpg" Images
Does anyone know where I can find a client-side function I can reference from within an
HTML/JavaScript web page? I'm currently using the core "imagecopyresampled()" PHP function to do
this, but I'd rather do it on the client-side and not have to upload the large raw image to the
server.

Inserting Php Code With "eregi Replace" Function
A little background...Rather than using an iframe in FCKeditor within my CMS system I located the line of code where I can directly place text that outputs to the correct place within the whole site.(templates stay intact and so forth)

I found this...which BTW is within php tags - also <% main %> is element in seperate template file.

$template = eregi_replace("<% main %>", "$main", $template);

and replaced $main with this and it correctly shows on the site.

$template = eregi_replace("<% main %>", "ABC testing content", $template);

I can also insert image tags to display those as well...but the main thing I want to be able to do is build a seperate page in php (say a calendar for ex.) and include it above between the quotes. I tried the usual include method without any success...so I am sure there might be some syntax I am missing although I didn't get any parse errors.

I can post more code if need be, but I wanted to see if anyone had any possible solutions as I don't want to have to paste a whole page of coding in between the quotes I would like to just "include" it. (may not be possible with the structure of the template var)

Echo "<!--#include File="top.html" -->";
I have a search script which returns a page of results, however I'd like the returned page to be in the same format as the rest of my site.
To do this I've tried adding the HTML for my site to my PHP page with echo" " commands. This works for the plain HTML, but my regular pages also use SSI to do other stuff (some of them even execute other PHP scripts to generate tables of data etc). I've tried

echo "<!--#include file="top.html" -->";
but it doesn't work as I get a parse error. My question is, how do I go about doing this properly? Is this possible at all? And if not have you guys got any suggestions to get around this?

How To Do PHP "require()" Or TCL "source" In Bash Script
I can't figure out how to explain this any better than
this.

In PHP we have a command "require()" that obtains a file and logically
places it into another file.

I cannot figure out how to do this in bash script as the requirement
is necessary for a migration script to obtain the code from a .cfg
file and then be able for the "parent" script to run the code it
"imported" from the .cfg file, much like PHP's require() or TCL's
"source".

This is what I have so far and it fails:

if [ -f ivc.cfg ]; then
cat ivc.cfg
fi

Anyone really know bash script well please help, it's a barrier for me
not to be able to get just this one piece working.

Problem: Mail() Function "seems" 2 Work But Doesn't
ok... here is the code:

<?php

if (!$_POST[submit]) {

?>

!--- HTML CRAP HERE ---!

<?php

} else {

$mail_to = "myemailaddress@mydomain.com";

$headers = "From: $_POST[sender_name] <$_POST[sender_email]>";
$headers .= "X-Mailer: PHP 4.x";
$headers .= "Errors-To: $mail-to";

$time_sent = date("m.d.Y @ H:i:sa");

$msg = "From: $_POST[sender_name]:<$_POST[sender_email]>
";
$msg .= "--------------------------------------------------
";
$msg .= nl2br($_POST[message]);
$msg .= "

";

$msubject = "$_POST[msg_priority]_:_$_POST[subject]_SENT on ($_POST[time_sent])";

mail($mail_to,$msubject,$msg,$headers);

echo ("<div align=center><h1>Thanks, $_POST[sender_name], for emailing us, we will be in contact soon!</h1></div>");

}
?>

for some reason it "seems" to be working, but isn't actually sending mail... I have my php.ini set to my SMTP server (mail.comcast.net) and email set to my main email address... it goes through the script and I get the correct return of the echo after it "seems" to send the email... but I don't actually get the mail... I'm a little new to this, please bear with me

also if it helps... running latest stable apache (2.0.47) and php4.3.3 on WinXP. I have ZoneAlarm pro... but apache has permissions, and it does the same even if I disable ZApro.

thanks in advance for any help you can give me!

p.s. ISP is NOT blocking port 25 and since I originally asked this on phpbuilder.com forum, I have added a rule to ZAPro allowing apache all rights to port 25 specifically. I also have not getting any bounces to the error-to: $mail_to address.

"Call To Undefined Function Pg_query_params() ..."
To start off, I'm running Apache 2.0.54, PostgreSQL 8.0.3 and PHP
5.0.3 on Windows XP and yes, libpq.dll is my system32 directory.
I'm trying to do some queries using pg_query_params(), but I keep
getting a fatal error, which is in the subject. I'm not sure what's
going on, though. The functions pg_connect() and plain, old pg_query()
work fine, and the PHP Manual says pg_query_params() is indeed in PHP 5
with no indication that it may even be experimental, but... no luck.
Is the PHP manual wrong, or can someone shed a little more light on
my situation?

"include Path" Doesn't Function The Way I Thought It Would
I have a PHP script that resides in a public directory. The real directory is something like this (directory names changed but nesting level holds true):

/usr/top/public/the-script.php

This is the path that is shown if I print __FILE__. I have an include directory that lives here:

/usr/top/hidden

I do the following with ini_set:

ini_set("include_path", ".;/usr/top/hidden");

However if I try to include a file that resides in /usr/top/hidden using just the file name:

require_once("file-in-hidden-dir.php");

I get a fatal error saying the file could not be found, with the include path I set showing in the error dump as the correct include_path.

If I try opening up the file using an explicit full path declaration:

require_once("/usr/top/hidden/file-in-hidden-dir.php");

It opens without error. What could I be doing wrong to have this problem?

Empty "From: " Messes Up Mail() Function...
I've been trying to send HTML-rich mail using the mail() function, and as long as I enter something in the 'additional_headers' field of the function, it works... but when I send anonomous mail, the HTML tags are displayed as text. CODE:

Coding "init" Function For An Extension...
Another question about writing PHP 5 extensions. What's the difference in
PHP_MINIT() / PHP_MSHUTDOWN() and PHP_RINIT() / PHP_RSHUTDOWN()? When would
a "per request" init be made?

Wordwrap() - "Call To Undefined Function"
Fatal error: Call to undefined function: wordwrap() in spec.php3 on someline.

PHP version: 4.0.1pl2
MySQL version: 3.23.10-alpha
Apache: 1.3.12

Any ideas on why wordwrap isn't working?

Function Doesn't Return If "load" Is An Array Value
I have created a simple function to load an array with name / value pairs, and return the array. Most of the time it works as expected, but one particular name / value pair causes the function not to return. No errors are reported.

My system details:

OS: Windows XP SP2 ("Windows NT OFFICE 5.1 build 2600" reported by phpinfo)
Server: XAMPP for windows (apache)
PHP Version: PHP Version 5.1.4

The function: Code:

Error In Page When Checking Http_get_vars("myvar") And "myvar" Was Not Passed In URL String
PHP, coming from ASP coding

if (HTTP_GET_VARS['b']==1){
print "Yes";
}else{
print "No";
}

when "b" is not passed via
(http://www.mydomain.com?b=1

an error occurs and the "NO" is printed but an error is printed too.

How can I check for the value of "b" so that no error occurs if b is
not passed??

example

http=www.mydomain.com

$myvar=HTTP_GET_VARS['b']

causes an error because
"b" does not exist (ie. its not passed in the URL string.

$myvar maybe evaluated as NULL or Empty but the error is printed in
the page, anyway.

How Do I Put A "for" Loop In A Function/Class?
Below is a class that I am trying to get to work. What I want to do is loop through the "for" loop and output the number of text boxes that is assigned to the $Paragraphs variable (five in this case).

Does anybody see how I might get the below function or class to work?

PHP Code:

$Paragraphs = "5";
class FirstClass {
    var $TextBoxes;
    function SetBoxes($n)
        {
        $this->TextBoxes = $n;
        }
    function SayBoxes()
        $TextBoxes = "$Paragraphs";
        for($i=1; $i<=$TextBoxes; $i++)
          {
            echo "<textarea rows="3" cols="40" name="Textfield""."[$i]"."></textarea><p>"."
";
          }
    }
$ObjectOne = new FirstClass();
$ObjectOne->SetBoxes("$Paragraphs");
$ObjectOne->SayBoxes();

"Force Download" Function
I've built a website that uses a force-download php script that's triggered by an on-click javascript event.

The script works fine when fired via javascript, but I'm trying to tweak it into an includable function that's generically portable and is triggered by an input button within an "empty" form - nothing's between the form tags but the input button and two hidden fields which feed the file name and directory path of the file to the download function.

The input trigger works, and the file name and path are passed succesfully, but I get a bunch of "can't modify header information" warnings.

The force-download script does have a bunch of header information in it.

Anyway, is there a way to make this work without using javascript?

Problems With "mail" Function
I cannot seem to send emails. What does it mean when the return value
from the "mail" function is an empty string? I'm using php 4.3.11 on
a Yahoo! hosting environment. Here is the code:

Function "isset()" Needed In 4.3.5 But Not 4.3.0
We are currently changing our web server and, in the process, updating PHP
version from 4.3.0 to 4.3.5. The problem we've got is that our PHP
applications generate errors saying that some of the variables are
Undefined.

I didn't use "if(isset($myVar))" to validate if a variable has been passed
from a HTML form but instead "if($myVar)".

Is there a way to make it work without changing the code?

Function "previously Declared"?
I'm trying to create a function that adds tabs to the HTML output so that it looks easier to read when you look at the source code of the page.

However, I get an error: "Fatal error: Cannot redeclare tab() (previously declared in C:Program Filesxampphtdocsparserfunctions.php:3) in C:Program Filesxampphtdocsfunctions.php on line 30" (where line 3 is the first line of this function and line 30 is the last one).

I don't know if there are any other mistakes in my code that might make it crash after solving this one, but I'd need help at least with this issue.
Here is the source of the function: Code:

Coding "NEXT" And "PREVOIUS" Buttons
Hi

I am stuck here. I am doing a form which dispalys details of client companies. My query includes this statement:

.... WHERE CompanyName LIKE %$name% ....

What I need is following: if a query returns more then one result I what to "flip" through result with NEXT and PREVIOUS buttons.

Mysql/php - "LIMIT" And "ORDER"
In the following fragment of code, I am querying a database that in order to display a list of films. The list is very long and I would like to offer the possbility to restrain the range of results showned by page keeping in mind that the user should be able to browse forward or backward data if applicable. I know that I have to add the LIMIT method in the MySQL query but I have a hard time figuring how not to get lost in setting it dynamically in the PHP script.

Then I have a second question. Is there a more elegant / straightforward way to deal with the display order of the data (cf. $ot, $od and $oy)? Code:

Sticking "if" Or Changes Within A MySQL "where" Array?
I'm not exactly sure how to even ask the question, and I know my terminology
is not good as I'm a SQL beginner, but, here goes.

I need to find a way to make an if statement within an array...or, the
"while" portion of a recordset.

The best way I can ask is show what I mean.
http://oscarguy.mechphisto.net/awardbrowse.php
If you go there and select an award (like Best Picture), leave the year
field alone, and select YES and submit, you'll see a lot of results. And I
have HR's dividing each entry.

What I need to do is group all the entries of the same year, or at least
only put HR's between the blocks of years.
So, I'd have all the entries for 2002, an HR, then all for 2001, an HR, etc.

Here at the bottom I'll include my PHP code I'm using so far.
But I have no idea where to even start looking for an answer...if it's even
possible.
If someone can just give me the name of the function or process or
technique, then I can go Web/book searching myself...I just need a direction
of where to go.

PHP:------------------------------------------------------------------------
------
$query_RS_award = "SELECT * FROM $award WHERE id != &#391;' ORDER BY year DESC,
w DESC";
//$query_RS_award = "SELECT * FROM $award WHERE year =
"$year"";
$RS_award = @mysql_query($query_RS_award, $connection) or
die("Couldn't query: " . mysql_error());
$totalRows_RS1 = mysql_num_rows($RS_award);
while ($row_RS_award = mysql_fetch_assoc($RS_award)) {
$award_id = $row_RS_award['id'];
$award_tblid = $row_RS_award['tblid'];
$award_award = $row_RS_award['award'];
$award_year = $row_RS_award['year'];
$award_category = $row_RS_award['category'];
$award_won = $row_RS_award['w'];
$award_film = $row_RS_award['film'];
$award_nominee = $row_RS_award['nominee'];
$award_note = $row_RS_award['note'];
if (!($award_category)) {
$award_category = "n/a";
} else {
$award_category = $award_category;
}
if ($award_won == "1") {
$award_won = " - Award Winner";
} else {
$award_won = "";
}
$display_block_Award .= "YEAR:&nbsp;<span
class='normalText12White'>$award_year</span><br>FILM:&nbsp;<span
class='normalText12White'>$award_film</span><br>CATEGORY:&nbsp;<span
class='normalText12White'>$award_category</span><br>NOMINEE:&nbsp;<span
class='normalText12White'>$award_nominee</span><span
class='normalText12BoldWhite'>$award_won</span><br><blockquote><span
class='normalText12White'>$award_note</span></blockquote><hr>";
}

Cookies And "include" Or "require"
i'm having a problem with my setcookie() instructions. Although there are absolutely
no html tags in front of them,for some reason PHP3 sends me back the message "oops...php3_SetCookie called after header has been sent"...

I do however use two "require" calls, one to a file with a .php extension, and one to a file with an .inc extension. At the beginning of each files there's a Could the cookie failure and the include functions be related ?

In my text, I have even wiped out any HTML tags such as "bold, paragraph, line break" tags, even in "echo" commands, but to no avail what am i doing wrong ?

FTP_login + $pass="" And $user=""
I use the following scrit in an Intranet with the user name = "" and
the password = "" :

<?php
$ftp_server = "192.168.25.25";
$ftp_user = "";
$ftp_pass = "";

$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to
$ftp_server");

if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
echo "Connected at $ftp_user@$ftp_server
";
} else {
echo "Can't connect with $ftp_user
";
}
?>

I have the following message :

Connected to 192.168.25.25
Warning: ftp_login(): 'USER': Invalid number of parameters in
E:www est_ftp.php on line 26

I tried to : ftp_login($conn_id, "", "") but i have the same result...

Function Like "in" In Delphi?
Is the such a function like IN in delphi:

if( $somechar in ["a", "b", "d"])
dsafsakjldg;

where true is for the characters mentioned above.

How To Use "mail" Function
I was trying to use the mail function, however, all I got was the following message:

Warning: Failed to Receive in c:apachehtdocsccis
etrieve_password.php on line 107

All I had on my code was:

mail("u3297231@anu.edu.au", "My Subject", "Line 1
Line 2
Line 3");

Can anyone tell me what's wrong??? I am running PHP ver4.0.2 (CGI) under Windows XP OS.

Using The "include" Function
I can use
<?
@Include'http://somedomain.com/test.htm'
?>
and include the entire contents of a page in the middle of the page carrying the this code but I can't figure out how to specify only copy part of the page contents from "widget" to "arbuckle" (for instance).


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