php-general Digest 1 Nov 2003 08:47:33 -0000 Issue 2389
Topics (messages 168234 through 168254):
Re: php temp table question (for mysql)
168234 by: Marek Kilimajer
168248 by: Curt Zirzow
Php processor and return window
168235 by: Robb Kerr
168244 by: Robert Cummings
IRC
168236 by: Jonathan Villa
168237 by: Jon Kriek
168238 by: Nathan Taylor
Windows & PHP
168239 by: mohamad taghlobi
Re: help!
168240 by: Haseeb Iqbal
Generating Numbers from Strings
168241 by: John Ryan
168242 by: Thomas Seifert
168243 by: John Ryan
168246 by: Filip de Waard
Templates/Separate content from presentation
168245 by: Pedro Pais
168247 by: Greg Donald
168249 by: Robert Cummings
168250 by: Greg Beaver
Array maybe? Or many SQL insert queries
168251 by: Jake McHenry
Beginner
168252 by: Jason T. Davidson
168253 by: Justin French
XML Validate
168254 by: Cosmin
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Session should not have any influence. Perhaps Keep-alive connection,
then by closing the browser the connection ends. If you would wait
enough the connection will be closed anyway.
But certainly this is valueable knowledge.
Larry Brown wrote:
I'm now finding that persistent connections is allowing the temp table to
remain. I have a sql query that creates the table and another that joins
the temp table to another for a result set that I use. If I press refresh on
the browser window I get an error that the sql query creating the table
fails. I prepend a query that removes the table before the sql that creates
it and then hit refresh and the query works. If I close the browser thus
ending the session and reopen the browser and log in, the script fails to
remove the temp table since it hasn't been created yet (and must have been
removed). I changed my method of connecting to use mysql_connect instead of
mysql_pconnect and removed the drop temp sql and it loads and reloads fine.
Perhaps it is the combination of mysql_pconnect with sessions that creates
this problem.
-----Original Message-----
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 4:43 PM
To: Larry Brown; PHP List
Subject: Re: [PHP] php temp table question (for mysql)
From: "Larry Brown" <[EMAIL PROTECTED]>
Does anyone know whether the use of persistent connections with php will
allow a temp table created by a script to linger around
No, the table will still be removed at the end of the script whether you use
persistant connections or not.
and cause a problem
with the next execution of the script when it tries to create the temp
table
Temporary tables are unique for that specific question. So you can have the
same script creating the "same" temporary table and 100 people hit it
without issues. Each script creates it's own temporary table with a unique
name that only that connection has access to.
---John Holmes...
--- End Message ---
--- Begin Message ---
* Thus wrote Larry Brown ([EMAIL PROTECTED]):
> I'm now finding that persistent connections is allowing the temp table to
> remain. I have a sql query that creates the table and another that joins
> the temp table to another for a result set that I use. If I press refresh on
How are you creating the temp table?
> the browser window I get an error that the sql query creating the table
> fails. I prepend a query that removes the table before the sql that creates
> it and then hit refresh and the query works. If I close the browser thus
> ending the session and reopen the browser and log in, the script fails to
> remove the temp table since it hasn't been created yet (and must have been
> removed). I changed my method of connecting to use mysql_connect instead of
> mysql_pconnect and removed the drop temp sql and it loads and reloads fine.
> Perhaps it is the combination of mysql_pconnect with sessions that creates
> this problem.
If this is the case it most likey is a mysql issue not a php one.
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
--- End Message ---
--- Begin Message ---
I am just learning PhP. When I was teaching myself Lingo (Macromedia
Director's programming language) I found an object called the MESSAGE
window quite helpful. This window allowed you to execute little snippets of
code and get the results without having to execute your entire script. For
instance, you could create a variable and give it a value then run an
if/then statement or loop on it and quickly see the results. This is quite
convenient when you're learning the language because you can test your
syntax line-by-line instead of having the whole script fail and not knowing
exactly where the error occurred.
Does anyone know about anything like this for PhP?
Thanx,
--
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org
--- End Message ---
--- Begin Message ---
On Fri, 2003-10-31 at 14:53, Robb Kerr wrote:
> I am just learning PhP. When I was teaching myself Lingo (Macromedia
> Director's programming language) I found an object called the MESSAGE
> window quite helpful. This window allowed you to execute little snippets of
> code and get the results without having to execute your entire script. For
> instance, you could create a variable and give it a value then run an
> if/then statement or loop on it and quickly see the results. This is quite
> convenient when you're learning the language because you can test your
> syntax line-by-line instead of having the whole script fail and not knowing
> exactly where the error occurred.
>
> Does anyone know about anything like this for PhP?
Absolutely, it's called the browser window. Grow your scripts from small
working blocks, and you can test in exactly the same way.
Cheers,
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. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Are there any PHP IRC that anyone is aware of?
--- End Message ---
--- Begin Message ---
server: irc.freenode.net
channels: #phpfreaks, #php, #binaryphp
--
Jon Kriek
http://phpfreaks.com
"Jonathan Villa" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Are there any PHP IRC that anyone is aware of?
--- End Message ---
--- Begin Message ---
--- End Message ---
--- Begin Message ---
Thank you very match, James LOBLEY !
For your answer to my previous message.
I would also like to know WINDOWS support(bear), PHP. Otherwise, you would have an
idea of what it is necessary to make?
---------------------------------
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Testez le nouveau Yahoo! Mail
--- End Message ---
--- Begin Message ---
in php.ini (that will be in wondows folder or in wondows/systems folder)
search for "cgi.force_redirect" and the set it to 0
HTH
Haseeb
----- Original Message -----
From: "Mårten Palm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 01, 2003 12:11 AM
Subject: [PHP] help!
> I have installed PHP 4.3.3 with the installer.
> i am runnig a PWS server on my Windows Me.
> I have turned the cgi.force-redirect to 0.
> When ii try to install acces a certain php script (the install script for
> PHPBB2 forum)
> i get an error which says:
>
> Security Alert! The PHP CGI cannot be accessed directly.
> This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means
> that a page will only be served up if the REDIRECT_STATUS CGI variable is
> set, e.g. via an Apache Action directive.
>
> what is the problem???
>
> _________________________________________________________________
> Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I've a bit of a problem, I want a random keyword pulled from my database.
But I dont want it random all the time. I just want it random to each page.
So I have the filename variable of the page. How do I somehow generate a
'constant' random number from this string that is constant to each file???
TIA
--- End Message ---
--- Begin Message ---
On Sat, 1 Nov 2003 00:37:32 -0000 [EMAIL PROTECTED] (John Ryan) wrote:
> I've a bit of a problem, I want a random keyword pulled from my database.
> But I dont want it random all the time. I just want it random to each page.
> So I have the filename variable of the page. How do I somehow generate a
> 'constant' random number from this string that is constant to each file???
>
> TIA
md5(__FILE__) ?
Thomas
--- End Message ---
--- Begin Message ---
I've done that, but how do I generate a number out of that that's in a
certain range?
"Thomas Seifert" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 1 Nov 2003 00:37:32 -0000 [EMAIL PROTECTED] (John Ryan) wrote:
>
> > I've a bit of a problem, I want a random keyword pulled from my
database.
> > But I dont want it random all the time. I just want it random to each
page.
> > So I have the filename variable of the page. How do I somehow generate a
> > 'constant' random number from this string that is constant to each
file???
> >
> > TIA
>
> md5(__FILE__) ?
>
>
> Thomas
--- End Message ---
--- Begin Message ---
On Sat, 2003-11-01 at 01:37, John Ryan wrote:
> I've a bit of a problem, I want a random keyword pulled from my database.
> But I dont want it random all the time. I just want it random to each page.
> So I have the filename variable of the page. How do I somehow generate a
> 'constant' random number from this string that is constant to each file???
Could you refrase your question? I understand a part of what you are
trying to do, but i'm missing the whole picture.
On Sat, 2003-11-01 at 03:14, John Ryan wrote:
> I've done that, but how do I generate a number out of that that's in a
> certain range?
mt_rand($start, $end); generates a 'random' number between two given
numbers.
Filip de Waard
--- End Message ---
--- Begin Message ---
Hi!
I've coded in PHP for a while, but I had to leave it for some time. Now
I'm back, and I'd like to know what's currently being used to separate
content from presentation, besides Smarty (that seems to be Google's top
choice)?
Thanx
--- End Message ---
--- Begin Message ---
> I've coded in PHP for a while, but I had to leave it for some time. Now
> I'm back, and I'd like to know what's currently being used to separate
> content from presentation, besides Smarty (that seems to be Google's top
> choice)?
I tried Smarty for several weeks and found it was more than I needed, so I
went back to my simpler template system.
I have templates that look like this for example:
> cat userImage.tpl
<!-- userImage Template -->
<tr>
<td><a href="index.php?i=$imageID"><img
src="thumbnail.php?i=$imageID" $imageHeightWidth border="0"
alt="$imageAltText" title="$imageAltText" /></a></td>
<td nowrap="nowrap">$userType</td>
<td align="center">$commentsCountHTML</td>
<td align="center">$totalPoints</td>
<td align="center">$timesRated</td>
<td align="center">$averageRating</td>
</tr>
<!-- End userImage Template -->
Then in my php scripts I call a template like this:
$userImage = getTemplate("userImage");
eval("\$userImage = \"$userImage\";");
$html .= $userImage;
The function being:
function getTemplate($template){
global $Site;
$html = '';
$file = $Site['TemplatePath'] . '/' . $template . '.tpl';
if($handle = fopen($file, "r")){
while(!feof($handle)){
$html .= fgets($handle, 4096);
}
fclose($handle);
$html = str_replace("\\'","'", addslashes($html));
} else {
die('Fatal: cannot open template ' . $file . '<br />\n');
}
return $html;
}
Of course I have no template caching system like Smarty has, but I use
TurkeMM Cache: http://www.turcksoft.com/ and query caching from MySQL 4. I
also clean my html before output, removing all tabs and newline characters,
and I have zlib.output_compression enabled. Seems to work well.
--
Greg Donald
http://destiney.com/
--- End Message ---
--- Begin Message ---
On Fri, 2003-10-31 at 22:23, Pedro Pais wrote:
> Hi!
>
> I've coded in PHP for a while, but I had to leave it for some time. Now
> I'm back, and I'd like to know what's currently being used to separate
> content from presentation, besides Smarty (that seems to be Google's top
> choice)?
TemplateJinn, part of the InterJinn framework. Absolutely fantastic
(bias warning :) Too much to properly give credit in a single email,
feel free to check out the very full docs at the link below:
http://www.interjinn.com/documentation/templateJinn.phtml
Cheers,
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. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Hi Pedro,
try http://www.phpsavant.com
Regards,
Greg
Pedro Pais wrote:
Hi!
I've coded in PHP for a while, but I had to leave it for some time. Now
I'm back, and I'd like to know what's currently being used to separate
content from presentation, besides Smarty (that seems to be Google's top
choice)?
Thanx
--- End Message ---
--- Begin Message ---
Hi everyone, here's what I'm doing.
As of right now, I don't have anything implemented, but here's what I
need to do.
I have a web page, with a drop down list of hotels, an input box for
the users frequent hotel number, and a add button. At the bottom of
the page is a update and continue button to move the user to the next
page with more options.
What my boss wants is, when someone puts in a number, and clicks add,
he wants it to take that number and put it below the box, all on the
fly. I know I could do this through repeated sql insert querys, but I
was wondering if I could just put them into an array, then update the
database with one query after the user clicks the update and continue
button at the bottom, to get them to the next page?
I will need to use this same outline for the this page, plus the next
2 pages in sequence for car and flyer numbers.
Or, if anyone has a better way of an array or sql queries, that will
work as well. :-)
Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com
--- End Message ---
--- Begin Message ---
I am new to php and seeking some help. I have a couple of books and maybe I
just am not seeing my error. If you go to www.mspartcc.com/test.htm and
look at the source code you will see what I am trying to do. The only
problem is that the date is not displaying.
I really appreciate in advance any help I get.
Jason Davidson
--- End Message ---
--- Begin Message ---
On Saturday, November 1, 2003, at 04:33 PM, Jason T. Davidson wrote:
I am new to php and seeking some help. I have a couple of books and
maybe I
just am not seeing my error. If you go to www.mspartcc.com/test.htm
and
look at the source code you will see what I am trying to do. The only
problem is that the date is not displaying.
Jason,
The fact that you can view the source and see <?php ... ?> is a
tell-tale sign that your file is not even being parsed/touched by PHP.
1. does the server even have PHP on it?
2. usually a server uses .php for flagging files that should be parsed
by PHP -- whilst it's quite possible that your server also supports
.htm, starting with .php would be a good start.
Justin French
--- End Message ---
--- Begin Message ---
Is there a function to validate a XML document(make sure tags are
closed/nested)?
--- End Message ---