> I want to query an oracle database and push the output to an MS
> Excel spreadsheet . Currently I am dumping it to a csv text file and
> reading into Excel.
> Is there a better way to do this?? Is there a php function for this ??
What I am doing is using PHP to generate an HTML table in
> Two words:
> URL Encode.
Actually, one word: urlencode();
heheheh
Chris
> > If you use the file() function to open up the file, it will
> > put each line of the file into an array. At that point you
> > can say:
> But how can i put into a var $total the total lines that i
> have into the file?
After you've used the file() function as suggestion above,
the total n
If you have PHP compiled with --enable-trans-sid,
are the URLs that are part of the form's action supposed
to be modified to include the SID? So far that's not
been happening and I just want to verify that this is
expected behavior.
thnx,
Chris
> Its my understanding that PHP appends the SID on the
> end of the URL regardless of weather its a form or not. If thats
> not happening for you, check your php.ini and make sure you
> have session.use_trans_sid enabled.
It is enabled. And it's being appended to most URLs (though, not
> Here is what I see in my FORM with --enable-trans-sid:
>
> VALUE="cbf75d263416e77d773b1772f6e1be89">
> PHP is adding the HIDDEN field with the session id. For some
> reason, it also appends it to the SRC attribute of the image submit
> button, but doesn't add it in the ACTION url.
I'm not g
> have you checked your PHP.INI file?
> it sais there what links to rewrite.
This is what is in my .ini.
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" ;
added 3/2/01
Am I missing something here that I should have?
I don't see anything in the docs about the above
Below is the (very) simple form that I'm using to allow users
to upload files to my site:
---
Upload Attachment
Upload File
You are uploading from an unsecure server.
Close
Window
---
The proble
> The problem that I'm experiencing using the above form is that when
> some users (and the problem is consistent for those users) submit the
> above form, *none* of the POST variables are getting passed to the
> receiving page. None of the hidden variables, not the "input
> type = file" variabl
> is there a PHP class/library available anywhere, that supports
> dynamic creation of different graphs? I need 2D bar graph and
> pie graph support.
> i found the VH Graph (http://www.vhconsultants.com/graph/graph.htm),
> but they want $100 for their 2.x version. i'd prefer a free one
> (i'm sure
> > Again, any help would be greatly appreciated!
> could be a browser specific issue. have you checked into the
> possibility that people having problems are all using the same
> browser?
I don't know what all of them are using, but most are using
IE. I don't know how feasable it would be to
>From the manual:
"Handling file uploads Uploading multiple files
Common Pitfalls
Not validating which file you operate on may mean that users
can access sensitive information in other directories. "
What is meant by the above? How would you "validate" that
you weren't operating on the
> Hi,
> How can I calculate days between two dates ?
This should work:
$firstDate = mktime( 0, 0, 0, 1, 12, 2001 );
$secondDate = date( "U" );
$daysInBetween = ( $secondDate - $firstDate ) / 86400;
Chris
> Sorry,
> it doesn't work !!
Why do you say that? I just tested it and it worked.
It returned:
"115.31296296296"
"115" being the number of days
".31296296296" is the fraction of the day that is the
difference of hours between the two times.
mktime() and date( "U" ) return a unix timestamp
> Is there a prewritten function for capitalizing the first
> letter of each word in a string except for the common
> words you wouldn't want to capitalize in a title? Like
> Come Learn the Facts From an Industry Leader
None that I've seen.
But it wouldn't be hard to write a function that take
> How can I use PHP to detect if the visitor wanted MainDomain.com (and
> display MainDomain/index.php) or WidgetWorld.com (and then display
> MainDomain/Widgets/index.php).
I *believe* what you are looking for is $HTTP_HOST.
Chris
> So sprach »Arcadius A.« am 2001-08-31 um 05:27:04 -0700 :
> > $u = $SCRIPT_FILENAME;
> Because you did not define $SCRIPT_FILENAME anywhere. If you want to
> access the global variable, you've got to say so:
> global $SCRIPT_FILENAME;
Or, so you don't have to specify all the variables you are
> > Or, so you don't have to specify all the variables you are using
> > as globals (especially if you are using *alot* of them), you can
> > use:
> > $GLOBALS[SCRIPT_FILENAME];
> What's the gain? 'global ' has 7 characters, whereas '$GLOBALS[]' has
> 10 characters. So, you don't type less. A
> One of the downside of PHP IMHO is, that you do not have to define
> variables. This leads to a lot of errors. At least there should be a
> "option", which forces you to define variables, like maybe so:
> dim $some_var;
I definitely agree there. I've been bitten by this bug more times
> Cool ...
> Now that we're talking about PHP
> I'd like to ask a question
> You know the "overloading" function in C++ Is that
> possible in PHP ?
No, I do not believe so.
> Basically , I'd like to define more than one function having
> the same name but different number of v
> I am trying to get a double data type to display the .00 in a
> "hole" dollar amount (i.e. 432.00 not 432 or $432.00 not $432).
> Can anyone tell me how to do this?
printf(); or sprintf(); is your friend
Chris
> the require(morefunctions.php); will ofcource not work but
> bassicly this is what I want. en all the functions added should
> be able to use VAR1 VAR2 VAR3 (and the other functions that
> are allready in the class)
> is there a why to do this ??
Yes, there is.
Go here:
http://www.php.net
> Then you can use:
> if (mysql_num_rows($result) == 0) {
> stuff here
> }
> This will check the number of rows returned from your query. If zero,
> then do somethingmodify as you need.
What I generally do is this:
if(( !$result ) || ( mysql_errno() > 0 )) {
// error code here
}
OR
Sample code:
$array = array( "one", "two", "three" );
while( list( $key, $val ) = each( $array )) {
if( is_string( $key )) {
echo "Key is a string\n";
}
echo "Key: $key => $val :Val\n";
}
echo "\n\n";
$array = array( "SS" => "one", "15" => "two", "19" =>
> what are you trying to do?
> why do you want to diffirentiate between "99" as a string or
> as a number?
Because if it is a string, more than likely it means that the key
was user defined and is not PHP defined as an element number.
Again, consider the differences between these two arrays:
a
> I would even go for $Something and just $SomethingMore
> with $Something really being $Something-$SomethingElse.
> I don't know if that makes sense.
> Any help would be greatly appreciated.
Take a look at file(); and just loop through the resulting array
and removing all the blank elements.
> I've got to different files of words. One on each line.
> What would be the best way to combine both into one file
> alphabetically?
after you merge the arrays, use asort();
Chris
> i want to send emails with attachements... can I modify the
> mail()-function or how can I perform this?
You can get classes that do this very thing at the following site:
http://phpclasses.upperdesign.com/
Chris
> I'm looking for a function which enables me to allow user
> only to enter those dates which are still to come. In my head
> I have three things... one for day, one for month and
> one for year. In order to prevent the user from submitting the
> form with the date which is in past, I need pr
> What if I want to pad a number with zeros in the other
> direction? I.E:
> 524 becomes 00524
printf() / sprintf() is your friend.
Chris
> Yeah, but what if they don't JUST want to print it...
Umm, have you read the documentation on either of
the functions? They both return a string; they don't
send anything to standard out (like echo or print does).
$myString = printf();
$myString = sprintf();
echo $myString;
Chris
> I want to use the value of a variable in a variable name. For
> instance:
>
> $id = 1;
> $sql_$id = "hey"; //set variable $sql_1 to hey
> print $sql_1; //should print hey
I *believe* (could be wrong) what you want is this:
print ${$sql_1};
Check out variable variables in the dox.
Chris
> > Yes that's what I do but it freeze on netscape 6 ?
> FAFAIK the client's browser can't influence the header() call in
> your script. Are you sure there aren't any errors somewhere else. Eg
> before the header() call or at the start of the page where you
> redirect the user to?
Indeed. A good
> How do I turn off the error messages that appear at the top
> of the page? I have this function below that if an image is
> not there for $url, it give a "warning".
> $size = GetImageSize("$url");
> Example error message below...
> Warning: getimagesize: Unable to open 'http://www.yahoo.com'
> I want PHP parser to warn/fail when I try to use a variable
> not declared before. Like "Option Explicit" on ASP/VBA.
Look here:
http://www.php.net/manual/en/function.error-reporting.php
Chris
> Is there any function in PHP that is similar to alert() or
> confirm() of javascript ? I tried die() but that's not what I need.
What do you want it to do? Remember, though, that
PHP = server side while Javascript = client side. If you
want alert() or confirm() functionality on the client
> How can I search for a certain word in a string?
strpos() ereg() preg() and similar functions.
Chris
201 - 237 of 237 matches
Mail list logo