| Displaying files from database |
|
 |
Index ‹ php-general
|
- Previous
- 1
- [PHP] Add Reply-To to this list(s)<009001c3b37c$db91d4f0$0b01a8c0@green>
Dave G:
> This is, I suppose, a completely off topic thread. However, I just
> read the web page
> http://www.unicom.com/pw/reply-to-harmful.html
> and I was completely unconvinced.
Yes, I do use OE which is completely broken. And no I don't have to. Oh
well. I still agree with that web page, and while I was partly convincedd
that reply-to should be added that page really changed my mind. In OE, to
break the reply-to rule - it's called reply-to. That means you're supposed
to reply to that. - I must manually copy and paste the headers. Of course,
I use the news server anyway so this doesn't apply to me. But even so.
--
Comex
- 2
- Free HardwareHey, check out this site that is giving away totally free hardware! I
joined and I think you should, too. It's a completely legitimate offer,
and this company has already given away lots of free stuff. All you
have to do is join, complete an online offer, and refer friends to do
the same. That's it!
http://www.hardware4free.com
- 2
- Problem installing PHP with system provided HTTP serverThis is a multi-part message in MIME format.
I don't have any problems installing PHP with my own custom installed
apache HTTP server (I build it from the source and I am running 2.2.3
version) located in /usr/local/bin/apache2 but when I try to install it
with the one that is system provided (it's 2.0.51) located at
/usr/sbin/httpd it does not seem to work.
I use following procedure to install PHP on system default HTTP:
1. cd php-source-directory/
2. ./configure -with-apxs2=/usr/sbin/apxs -with-mysql
3. make
4. make install
I also do the rest of required steps from the PHP installation page at
http://www.php.net/manual/en/install.unix.apache2.php and I perform
necesseary modification to the httpd.conf file, but when I restart HTTP
server I do not get any *.php files displayed. Server is running and I
get everything else except for the *.php files which makes me think I
did not install PHP correctly.
Do I have to do something differently when installing PHP on system
provided, default HTTP server?
Dzenan Causevic
Software Web Developer
NaviSite, Inc.
Syracuse, NY
(315) 453-2912 x5346
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I don’t have any problems installing PHP with my own
custom installed apache HTTP server (I build it from the source and I am
running 2.2.3 version) located in /usr/local/bin/apache2 but when I try to
install it with the one that is system provided (it’s 2.0.51) located at
/usr/sbin/httpd it does not seem to work.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I use following procedure to install PHP on system default
HTTP:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>1. cd php-source-directory/<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>2. ./configure –with-apxs2=/usr/sbin/apxs –with-mysql<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>3. make<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>4. make install<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I also do the rest of required steps from the PHP
installation page at <a
href="http://www.php.net/manual/en/install.unix.apache2.php">http://www..php.net/manual/en/install.unix.apache2.php</a>
and I perform necesseary modification to the httpd.conf file, but when I
restart HTTP server I do not get any *.php files displayed. Server is running
and I get everything else except for the *.php files which makes me think I did
not install PHP correctly.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Do I have to do something differently when installing PHP on
system provided, default HTTP server?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 color=gray face=Arial><span style='font-size:
7.5pt;font-family:Arial;color:gray'>Dzenan Causevic</span></font><o:p></o:p></p>
<p class=MsoNormal><em><i><font size=1 color=gray face=Arial><span
style='font-size:7.5pt;font-family:Arial;color:gray'>Software Web Developer</span></font></i></em><o:p></o:p></p>
<p class=MsoNormal><font size=1 color=gray face=Arial><span style='font-size:
7.5pt;font-family:Arial;color:gray'>NaviSite, Inc.</span></font><o:p></o:p></p>
<p class=MsoNormal><st1:place w:st="on"><st1:City w:st="on"><font size=1
color=gray face=Arial><span style='font-size:7.5pt;font-family:Arial;
color:gray'>Syracuse</span></font></st1:City><font size=1 color=gray
face=Arial><span style='font-size:7.5pt;font-family:Arial;color:gray'>, <st1:State
w:st="on">NY</st1:State></span></font></st1:place><o:p></o:p></p>
<p class=MsoNormal><font size=1 color=gray face=Arial><span style='font-size:
7.5pt;font-family:Arial;color:gray'>(315) 453-2912 x5346</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
- 2
- [PHP] Web page excerpt editor
On Sun, 2008-05-04 at 10:12 -0500, Mike Potter wrote:
> Does anyone have any experience with something else? Alternately, has
> anyone written something they'd be willing to share under GPL?
FCKEditor, TinyMCE and a host of others. All JS based, so not really
relevant on a PHP list though
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
- 4
- private, protected, static vars
Could somebody please inform me what the difference between setting a
variable as private is compared to protected within a class? I can't
see the difference and would appreciate a brief example. I suspect
this has more to do with subclassing but it eludes me... Also, when is
it appropriate to set a variable to *static* ? Examples are welcome.
Thanks in advance.
--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche
- 4
- (http://nike-jordan.photo.163.com) is the biggest wholesales Jordan 1-23 outlet shoes in China , Cheap wholesale men Jordan shoes, women Jordan shoes , kids Jordan shoes, cheap wholesale Jordan 1, 2 , 2 1/2 , 3 , 3 1/2 , 4 , 5 , 6, 7, 7 1/2, 8 , 9 , 9 1/2,10,.11, 12, 13, 14, 15, 16, 17, 18, 19, 20,(http://nike-jordan.photo.163.com) is the biggest wholesales Jordan
1-23 outlet shoes in China , Cheap wholesale men Jordan shoes, women
Jordan shoes , kids Jordan shoes, cheap wholesale Jordan 1, 2 , 2
1/2 , 3 , 3 1/2 , 4 , 5 , 6, 7, 7 1/2, 8 , 9 , 9 1/2,10,.11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 21 1/2, 22, 23 outlet shoes and
JordanFusion shoes( J3+AF1, J4+AF1, J5+AF1,J10+J12, J12+AF1,
J23+AF1) , whoesale Jordan big size us 14, size us 15..
with the jordan shoes is newest most greatly, is completest,directly
comes from the Jordan Factory, since the ultramarine trade opening,
it
with the best price, the best sale
service, and the best safe shipping ,. the product has directly sold
to the world, receives everywhere merchants and the people welcome.
If
friend and the merchant has the need Jordan shoes, please as soon as
possible do relate with us,
wholesale jordans shoes ( jordans1- jordans23)
website: http://nike-jordan.photo.163.com
The newest T-shirt cheapest wholesale come from brand factory
(http://2008-Tshirt.photo.163.com ) is the biggest wholesales T-
shirts
in China , with theT-shirts is newest most greatly, is
completest,directly comes from the Jordan Factory, since the
ultramarine trade opening, it with the best price, the best sale
service, and the best safe shipping ,. the product has directly sold
to the world, receives everywhere merchants and the people welcome.
If
friend and the merchant has the need Jordan shoes, please as soon as
possible do relate with us,
our website: www.cn-circle.com and http://2008-Tshirt.photo.163.com
The newest T-shirt cheapest wholesale come from china
- 5
- UK PHPer'sI am not sure if this is the right group to post this in, so if its not
please accept my apologies and point me to the right group/forum to post
this in.
I need a PHP/MySQL programmer in the UK to help me develop an idea I have
for a unique subscription based community website.
However I can not afford to pay in cash, so I am offering a percentage in
the company I will set up around the site. (This will all be done once an
agreement is made and before any programming is done).
Please drop me a line at email***@***.com (remove "this" first) if
you are interested.
Please note I will be able to give you an idea of the programming needed but
I will need you to sign a 2 year non disclosure agreement before I can
discuss details of the target community etc.
Many Thanks
Carl
- 5
- [PHP] OOP clarification: Messages between objectsOn Wed, 2003-11-12 at 04:31, Robert Ian Smit wrote:
> I am trying to implement a generic form handler that is capable of
> printing the form and checking the user input.
>
> I want this application to be useful in the end, but I also use it
> to explore OOP in PHP.
>
> The working code at the moment is able to add HTML input elements to
> the page. These fields are all objects that get added to the Form
> object. When the user submits, the Form object tells all elements to
> check their input and create error messages if needed.
>
> So far so good. One of the intended applications is to store
> addresses submitted by visitors to our website. We have users from
> two countries, with two different zip-code systems.
>
> I could ofcourse create a double check in the zipcode-object, but
> this would mean that it would be possible to submit a zipcode from
> the other country without any objection by the application.
>
> I'd like the zipcode object to ask a question to find out what
> country we're dealing with and then apply the check of the input
> depending on the answer.
>
> Although these questions are specific to my application, I guess my
> real question is more general. When you have a containerobject that
> stores different kinds of elements, how do you give the elements the
> ability to learn about their surroundings so they can alter their
> behaviour?
>
> I know have:
>
> $foo = new Form();
> $foo->addToForm(new Element('country'));
> $foo->addToForm(new Element('zipcode'));
> $foo->processForm();
>
>
> I hope I made clear what it is I am trying to do. Hopefully I'll
> receive a few hints to help me on my way.
Give elements the ability to access their own form object. Then they can
request elements belonging to their own form for complex validation. For
instance:
function validateZip( &$element )
{
$form = $element->getForm();
$country = $form->getElement( 'country' );
if( $country->getValue() == 'Some country' )
{
// ZIP must meet format for "Some country".
}
else
if( $country->getValue() == 'Some other country' )
{
// ZIP must meet format for "Some other country".
}
else
{
// Default case.
}
}
HTH,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
- 6
- altAltsex4fun
Online dating site altsex4fun www.altsex4fun.com recently abandoned
its paid model and is experiencing explosive growth since becoming
100% free.This is the new reality . The industry is becoming
increasingly crowded day by day, AdWords CPC's keep going up and up
and up. It's a recipe for disaster for those sites thinking they can
rely on their subscription models. Altsex4fun now relies entirely on
Google's AdSense program to provide revenue and the results so far
have surprised the Altsex4fun team. AdSense is performing well above
our expectations. We will explore other advertising programs in the
future but AdSense is delivering incredible results for us. Altsex4fun
is now positioned for exponential growth as it absorbs those members
who are sick of emptying their wallets for paid sites that offer less.
The online dating industry needs to position itself to combat the rise
of MySpace and Facebook. Sites that think they can offer a service for
$30 a month just to contact other members are dreaming. We are just
glad we woke up to this revolution when we did. It's now full steam
ahead of us. Altsex4fun offers a wide range of services to its members
such as forums, chat, photo voting and the ability to see who has
viewed your profile or voted on your profile. By operating locally in
each of its key markets, Altsex4fun is able to provide a local flavor
with local members. Members in Canada want to see other Canadians,
members in Australia want to talk to Australians. We have segmented
our site so that the user experience is much more rewarding.
Altsex4fun is a global dating site with localized sites in the USA,
Canada, Australia, UK, New Zealand and South Africa. Altsex4fun has a
strong and loyal customer base due to the massive range of features it
now gives away for free. http://www.altsex4fun.com
- 8
- using multibyte functions for asciiHi everyone,
Our library is full of functions that use the string functions. We wish
to change these functions to allow them to use multibyte encodings (our
functions, not the ones in the string library). Obviously using the
multibyte string functions would be the way to do this, and is
possible, since we're all using php 5.0 (or above). My question is
this:
I want to change all function headers that use string functions to
accomplish their task to include an optional 'encoding' parameter. It
requires to be optional so that the code w ehave already written
doesn't break. What I want to do is, if this parameter is not
specified, pass the ISO latin 1 encoding in as the encoding parameter
for the mb string functions. Therefore using this approach existing
code *should* function exactly the same (correct me please if I am
wrong :) ). What I want to know is if there is a big performance
difference between using the original string functions and using the
newer multibyte string functions with encoding set to ISO Latin 1?
Also, I've seen various references to the 'internal encoding that PHP
uses'. What is this internal encoding?
Thanks
Taras
- 11
- [PHP-DB] Help needed with variable scoping? or mysql problemOh yeah that's the ticket!
I'd "forgotten" that I'd removed the mysql_select_db statement when doing
some earlier 'cleanup'. It just so happens that a few of the mysql metadata
calls (like listing fields/etc.) were inadvertently setting the db...but
only for a brief period of time...wierd.
As I mentioned, I just started using php yesterday, so I'm still learning
some tips/tricks.
But...to php's credit, I gotten a fairly functional rdbms
explorer/browser/editor going in under a day. I had initially planned on
'hardcoding' some rdbms master/detail forms, but after doing just one of
them, and seeing the plethora of mysql calls available, I decided to
genericize the code, and now it's a general explorer/etc. for all of my
databases. Seems pretty speedy too.
Now I just need to add result set 'scrolling'. Returning 2000 records is not
nice...
thanks buddy...
-----Original Message-----
From: email***@***.com [mailto:email***@***.com]
Sent: Thursday, August 14, 2003 8:10 AM
To: Mike Klein
Cc: email***@***.com
Subject: Re: [PHP-DB] Help needed with variable scoping? or mysql
problem
best way to tell is to place .....'or die(mysql_error())' after any call to
mysql_query() to see what mysql is complaining about. personally I
sometimes declare the query first so i can echo that as well after the
msyql_error() function, so i can see the query that has just been
excecuted. helpful with dynamic queries.
$qry = "SELECT * FROM $tableName where $fieldName='$fieldValue'";
$result = mysql_query($qry, $conn) or die(mysql_error() . $qry);
hth
jeff
"Mike Klein"
<email***@***.com To:
email***@***.com
rg> cc:
Subject: [PHP-DB] Help
needed with variable scoping? or mysql problem
08/14/2003 08:58
AM
I've been using JSP for some time now, and thought I'd write a couple of
rdbms explorers (flat tables, simple master/detail paradigm) using other
technologies, like PHP, Cocoon, etc. Well...it's been fun. I have more
working than not. But now I am hung up. I am getting wierd results in a php
script when I simply change the order of some mysql calls.
I'm using php-4.3.2, rh9, and mysql 3.23.
My error is the following (the first line above the Warning below is a dump
of parameters to the showMaster function which is what's bombing):
conn=Resource id #3 databaseName=info tableName=movies fieldName=title
fieldValue=36th Chamber
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /foo/bar/mywebsite/private/database.php on line 107
Line 107 is the <first> mysql_num_rows call below.
function showMaster($conn, $databaseName, $tableName, $fieldName,
$fieldValue)
{
echo "conn=$conn\n";
echo "databaseName=$databaseName\n";
echo "tableName=$tableName\n";
echo "fieldName=$fieldName\n";
echo "fieldValue=$fieldValue\n";
========This code fails when placed here==========
$result = mysql_query("SELECT * FROM $tableName where
$fieldName='$fieldValue'", $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo "numRows=$numRows\n";
========================================
$fields = mysql_list_fields($databaseName, $tableName, $conn);
$numFields = mysql_num_fields($fields);
echo "<TABLE border=1 width=100%>\n";
echo "<tr>";
for($i = 0; $i < $numFields; $i++)
{
printf("<td>%s</td>", mysql_field_name($fields, $i));
}
echo "</tr>";
========The SAME code succeeds when placed here!!!!!==========
$result = mysql_query("SELECT * FROM $tableName where
$fieldName='$fieldValue'", $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo "numRows=$numRows\n";
========================================
while($myrow = mysql_fetch_array($result))
...rest of method...
}
Any ideas on why this is? When I move the lines above (from
$result=...to...echo 'numRows') down a few lines to just before the
mysql_fetch_array, then everything works. Whazzup?!?
mike klein
- 11
- SVG Api in PHPHi,
I am just curious if there is any existing API in PHP for rendering
SVG (Scalable Vector Graphics). A quick search in Google pointed to me
a place in zend.com - http://www.zend.com/zend/trick/tricks12apr.php .
where I feel the support for SVG is not very clear to be exact.
Just curious if there is a library that comes with PHP that can help
us to create PHP without exactly boggling down in the SVG syntax ( XML )
as given in the above mentioned example.
--
Karthik
Humans please 'removeme_' for my real email.
- 12
- anyway to get past browser cache and find out the truth of what is going on?I've got a site on a hosted virtual server. I'd like to know the truth
of what is going on, but I can't get past my browsers cache. There is
some kind of error in my code that occurs on a given line. When I
comment out that one line, everything else seems to work. When I
uncomment that one line, the browser simply shows what was last on
screen the last time the code was working. That is, if I write
echo "hello";
while the line is commented out, then I change the line to
echo "goodbye";
and I uncomment the line and hit the refresh button on my browser, the
word hello will remain on screen. Neither FireFox nor IE will show me
the truth of what they are seeing, either that be nothing or an error
message.
How to get around that?
- 12
- Cookie/Caching ProblemDear all,
We have created a business portal for our organization. The technology
used for that is LAMP.
Our major access management system of the portal is based on cookies.
we set some user level cookies at the time of login; using these
cookies we provide access of our pages to user.
The problem is, sometimes after login process we are getting fatal
errors due to cookies, because of cookies are not set and our files
checking for the that. But the problem we can resolve after cleaning
history, cookies, temp internet files in IE.
I am still not getting the problem and our ad-hoc solution. everytime
we get this problem we simply cleanup the history, cookies and delete
temporary internet files, and system starts working perfectly again.
Can anyone explain what exactly is happning ?
Thanks
Rushik.
- 16
- #39037 [NEW]: Memory leaks when using curl_multiFrom: eugen at id dot com dot ua
Operating system: Fedora Core 5
PHP version: 5.1.6
PHP Bug Type: cURL related
Bug description: Memory leaks when using curl_multi
Description:
------------
Possible memory leaks when using curl_multi_* functions.
I start 10 tasks with curl_multi and at completion of one of them add a
new task. The use of memory is gradually increased thus, although $GLOBALS
has a permanent size approximately.
In particular, at the call of curl_close() or curl_multi_remove_handle()
memory is not freed (I guess it should be...)
Reproduce code:
---------------
http://www.follow.net.ua/bug.phps
(see MEMORY_IS_NOT_RELEASED_HERE string near the end of file).
Expected result:
----------------
Downloading queue of documents with 10 threads
Actual result:
--------------
Gradual increasing of memory usage (sizeof $GLOBALS is *NOT* increasing)
--
Edit bug report at http://bugs.php.net/?id=39037&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39037&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39037&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39037&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39037&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39037&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39037&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39037&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39037&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39037&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39037&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39037&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39037&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39037&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39037&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39037&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39037&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39037&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39037&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39037&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39037&r=mysqlcfg
|
| Author |
Message |
prthomp

|
Posted: 2007-3-29 1:41:23 |
Top |
php-general, Displaying files from database
Hi. I'm storing an uploaded file into a MySQL database. I want the
file to then be downloaded and viewed. Uploading looks like:
<snippet>
if (is_uploaded_file($file) && $filename) {
$handle = fopen ($file, 'r');
$resume["data"] = base64_encode (fread ($handle, filesize ($file)));
fclose($handle);
$resume["type"] = $_FILES['resume']['type'];
$resume["size"] = $_FILES['resume']['size'];
}
</snippet>
It loads into the database fine. If it's a word document, it merely
spits out plain text. If it's a PDF, it says it can't open it.
Downloading looks like:
<snippet>
$app = applications ($_GET["id"]);
header ("Status: 200 OK");
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header ("Content-Length: ".$app["size"][0]);
header ("Content-Type: ".$app["type"][0]);
header ("Content-Disposition: attachment; filename=Resume-".$app
["full"][0]);
echo $app["resume"][0];
exit;
</snippet>
What am I doing wrong?!! =D Thanks in advance.
~Philip
|
| |
|
| |
 |
| |
 |
Index ‹ php-general |
- Next
- 1
- 2
- RegExp for removing text between parenthesisHi,
I have a string like this:
GeboGebo Wiki 0.9.2 (Default branch)
I want to remove the words between the parenthesis. I tried this regexp:
/\([a-zA-Z0-9]\)/ but without success, what is wrong with it ?
Thank you,
--
Colossus
Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/
- 3
- [PHP] Server errorHi dr Nick,
The $_FILES autoglobal contains an error code if something went wrong.
What is the code set to ?
Regards,
boro
Humani Power schreef:
> Hi everybody. I have a Fedora Core 7 with php 5, and I want to upload an
> image.
> The funniest thing is that my script works fine in other computer but not in
> this one.
> I look for the error in /var/log/httpd/error.log and I found this
>
> [Tue Aug 21 15:52:46 2007] [notice] caught SIGTERM, shutting down
> [Tue Aug 21 15:55:32 2007] [notice] suEXEC mechanism enabled (wrapper:
> /usr/sbin/suexec)
> [Tue Aug 21 15:55:32 2007] [notice] Digest: generating secret for digest
> authentication ...
> [Tue Aug 21 15:55:32 2007] [notice] Digest: done
> [Tue Aug 21 15:55:33 2007] [notice] mod_python: Creating 4 session mutexes
> based on 256 max processes and 0 max threads.
> [Tue Aug 21 15:55:33 2007] [notice] mod_python: using mutex_directory /tmp
> [Tue Aug 21 15:55:34 2007] [notice] Apache/2.2.4 (Unix) DAV/2 PHP/5.2.2
> mod_python/3.3.1 Python/2.5 mod_ssl/2.2.4 OpenSSL/0.9.8b mod_perl/2.0.3
> Perl/v5.8.8 configured -- resuming normal operations
>
> I know that this is PHP forum, but dont know if it is related.
> Thanks for your help
>
>
- 4
- [PHP] Possible bug w/ open_basedir?On 09 August 2003 18:02, Dan Brown wrote:
> There is no open_basedir restriction in my php.ini.
> The only place
> this restriction is set (with this path) in httpd.conf is in this
> block:
>
> <Directory /home/e-smith/files/ibays/howtos/html>
> AddType application/x-httpd-php .php .php3 .phtml
> AddType application/x-httpd-php-source .phps
> php_admin_value open_basedir /home/e-smith/files/ibays/howtos
> </Directory>
Is this also inside a Virtual Host? If so, you need to explicitly set open_basedir none in all other VHosts. Even if not, this problem may be related -- it may be worth trying the effect of explicitly setting open_basedir using php_admin_value for other directories, and especially your document root.
The VHosts thing is not regarded as a PHP bug, but a configuration error. However, if you are only setting open_basedir on a per-directory basis, that does sound like a possible bug to me -- might be worth firing off a report at http://bugs.php.net if you can pin it down accurately.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: email***@***.com
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
- 5
- see the most sexiest fight of j.lo vs ashclick here to see
http://sexyhot123.googlepages.com/home
http://livemonster.job.googlepages.com/home
http://www.geocities.com/red_akash/?
http://geocities.com/beta_zeta1/blog.html?
- 6
- Connecting to Linux server from windowsHi all !
I have PHP (4.3.2) running on windows 2k. Now i want to connect to a Linux Server and execute some commands and get the results back to win2k server. How can i achiece this.
Please help me out.
Thanks in advance
Binay
- 7
- (Nevermind)Re: ereg or separator?I figured out that you can use | to separate them. So $domains =
"$domain1.com|$domain2.com|$domain3.com".
Seems to work fine so far.
Thanks,
Max
"Max" <email***@***.com> wrote in message
news:NflNe.25843$email***@***.com...
> Is there a way to separate text in an ereg statement so that it is checked
> against separately?
>
> In other words, I've got the following:
>
> $domains = "domain1.com domain2.com domain3.com";
>
> if (ereg($domains, $variable)) do whatever...
>
> Is there any separator that I can place in between the various domains, so
> that the ereg statement will check if any of the domains is in $variable?
> As is, it checks the entire string with the spaces.
>
> I know I can explode $domains, and have multiple ereg checks in the
> statement like if ereg($domains[0],$variable) || ereg($domains[1])...etc,
> but I'm looking to avoid this so I can have an infinite number of domains.
>
> Is this possible?
>
> Thanks,
> Max
>
- 8
- [PHP-DB] get curent URLGeorgescu Vlad wrote:
> how can I get current URL from php ?
> I want to save this url to cookie and reload later if necessary
> thanks
Take a look at the output from print_r($_SERVER). Everything you need is
in the $_SERVER variable.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals ?www.phparch.com
- 9
- PHP does not parse .PHP filesI have this problem with PHP that someone might be able to help.
With CLI, I am able to execute my .php files. For example, if I type
"php phpinfo.php" , this works fine on my system.
If I put the phpinfo.php file is in /var/www/html and I try to access
it through the browser, I get the content of the file and not the
execution of the file. Instead of display the info of PHP, I got the
text of the file as:
<?php
phpinfo();
?>
Why?
Thanks
- 10
- Falling back to PHP's session handlerHi all,
I've created a custom session handler that saves session data to a
MySQL database. If the database server is down, I'd like to fallback to
PHP's default session handler (files) until the server comes back up.
After calling session_set_save_handler(), is there a way to tell PHP to
ignore this setting and revert to temp files for session storage? If I
try an ini_set on session.save_handler upon detecting that the DB
server is down, it doesn't work because the session is already active.
Thanks
- 11
- [PHP] foreach help in searchHi,
thanks for replying, I am not very good with the "list" function thats why i
use foreach instead.
My new problem is that i also have to take out the PHPSESSID if it exists
and its value otherwise i am getting 2 PHPSESSID's in my url...how can i do
that with your sample code?
Thanks,
-Ryan
> Personally, I like list() + each() + while() combo, like so :
>
> while(list($key,$val) = each($_GET)){
> if ($key == "page")
> {
> $newpage = $val + 1;
> $getstring .= $key&$newpage;
> } else { $getstring .=$key&$val; }
> }
> $url = "page.php?"+$getstring;
>
> As a side note, PHP is not strictly typed. So you aren't getting an
> int per se, just a string that's a number :)
>
> --
> Regards,
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>
- 12
- [PHP] Question about using ftp_put() for copying files
On Thu, May 24, 2007 2:37 pm, Al wrote:
> Can anyone explain what's going on.
>
> If I assign $source= $source_dir . $file;
> $source_dir is the absolute path i.e.,
> /home/xxxxx/public_html/EditPage/
>
> And $dist= $dist_dir . $file;
> $dist_dir is simply relative to $_SERVER[document_root]; i.e., just
> plain /test
>
> To get ftp_put() to work, I must first chdir to the $dist_dir.
>
> ftp_chdir($dist_dir);
> ftp_put($conn_id, $dist, $source, flag];
Similar to 'document_root', FTP has its own idea of where a "root"
directory is for each login/user.
In your case, it would appear by coincidence to match up with
'document_root' -- well, perhaps not "coincidence" since many webhosts
restrict their users' FTP accounts to only be their own web
directories, so they can't go poking around in other people's stuff
quite as easily.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
- 13
- Accessing string arraysHi! I've an array of string like this:
$arraystring["name"]="John";
$arraystring["age"]="50";
$arraystring["work"]="teacher";
$arraystring is global variable.
I'm trying to code a function that get a string as parameter and print
the relative arraystring's value.
function printArrayStr($key)
{
global $arraystring;
echo $arraystring["$key"];
}
What do I wrong?! :(
tnx, people!
- 14
- why can't PHP chmod a file that is already 777?I've a simple script to transfer some files from one domain to
another, with both domains living on the same server. The files in
both directories are already chmod 777. Yet after transfer, I try to
ensure that the file is 777, and I get an error. Why?
for ($i=0; $i < count($transferArray); $i++) {
$fileName = $transferArray[$i];
$commandAsString = "\cp -f /var/www/vhosts/mydomain.com/httpdocs/
site_specific_files/$fileName /var/www/vhosts/theice.org/httpdocs/
site_specific_files/$fileName";
exec($commandAsString);
chmod("/var/www/vhosts/ice.org/httpdocs/site_specific_files/
$fileName", 0777);
if ($i > 0) $resultString .= ", ";
$resultString .= "$fileName";
}
The files copy over just fine, but the line where I try to do chmod, I
get this error:
"Warning: chmod(): Operation not permitted in /var/www/vhosts/
cyberbitten.com/httpdocs/sharedCode/
transferFilesFromCyberbittenToTSR.php on line 33"
The owner and the group of the file change to "www-data" which is
annoying, but which should allow PHP to do anything it wants with the
files. So why would I get an error?
I also tried to end with this line:
exec("chown mgtr /var/www/vhosts/ice.org/httpdocs/site_specific_files/
$fileName");
This doesn't work at all. Why?
I ssh to the server and edited the configuration files to be sure the
open_basedir restriction was off, then I rebooted Apache. That made
no difference, for this particular bug.
- 15
- REMOVE THIS ADDR! Re: [ERR] Re: [PHP] PHP vs ASP.NET "formal opinions" requestPLEASE REMOVE THIS ADDR FROM THE LIST! IT'S NOT LIKE HE/SHE IS GOING TO
BE MISSING ANY MESSAGES!
email***@***.com wrote:
>Transmit Report:
>
> To: email***@***.com, 402 Local User Inbox Full (email***@***.com)
>
>
>
> ------------------------------------------------------------------------
>
> Subject:
> Re: [PHP] PHP vs ASP.NET "formal opinions" request
> From:
> John Manko <email***@***.com>
> Date:
> Sun, 10 Aug 2003 23:12:43 -0400
> To:
> Dan Anderson <email***@***.com>
>
>
> I hate to be the one to break it to you but this isn't the real
> world. It's a senior project, and he has a chance to justify the
> reason to do a project in the language he see's fit, not what the
> political machine wants. I just don't buy the "don't go against the
> tide" mentality, and obviously you don't either cause you are on a php
> mailing list.
>
> -john
>
>
> Dan Anderson wrote:
>
>> I hate to be the one to break it to you but in the real world if a
>> client or the boss says "program in ASP .NET" you program in ASP.NET
>> because, well, that's where the money is. That doesn't mean there isn't
>> room for using better products, but sometimes you don't get an option.
>>
>> -Dan
>>
>> On Sun, 2003-08-10 at 22:45, Douglas Douglas wrote:
>>
>>
>>> Hello everybody.
>>>
>>> I've been doing some research about the PHP vs ASP.NET
>>> debate, because I need to justify the use of PHP in my
>>> graduation work.
>>>
>>> In my University, people in charge of approving the
>>> graduation works advocate Microsoft's technologies.
>>> They don't believe in the free software movement or
>>> the open source movement. Some guys tried to develop a
>>> system using PHP and those people made them change to
>>> ASP.NET. They say because "It's the future". According
>>> to them it's where the money is.
>>>
>>> Well, I only have one year using PHP, but I'll try to
>>> fight. I've read a lot of opinions that have been very
>>> useful to me.
>>>
>>> I collected a lot of those opinions and printed to
>>> show them to the authorities, but they said that I
>>> needed "formal" basis (books, scientific journals,
>>> etc.) to justify the use of PHP. They said that they'd
>>> only allow "BIG COMMERCIAL, IMPARTIAL, RECOGNIZED
>>> WEBSITES" opinions and articles.
>>>
>>> I pretend to use this comparison found in the
>>> Microsoft MSDN website:
>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/phpvsaspnet.asp
>>>
>>> Can you give me some pointers (websites, names, etc)
>>> where I could find this kind of "formal comparison"
>>> about both technologies?
>>>
>>> I've been looking for some book that covers this
>>> issue. I've also been looking for some magazine
>>> article that I could use.
>>>
>>> I'd appreciate any kind of help. Thanks.
>>>
>>> Regards, Douglas.
>>>
>>> __________________________________
>>> Do you Yahoo!?
>>> Yahoo! SiteBuilder - Free, easy-to-use web site design software
>>> http://sitebuilder.yahoo.com
>>>
>>
>>
>>
>>
>>
>
>
>
|
|
|