php-general Digest 27 Mar 2011 01:51:04 -0000 Issue 7245
Topics (messages 312069 through 312074):
Re: opening a new window from php script
312069 by: Ashley Sheridan
Re: putting variables in a variable
312070 by: Al
312071 by: Daniel Brown
312072 by: Al
Re: Slow sessions.
312073 by: Bostjan Skufca
Re: Array Search - Solved
312074 by: Ethan Rosenberg
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Fri, 2011-03-25 at 18:05 -0700, Tommy Pham wrote:
> On Fri, Mar 25, 2011 at 2:59 PM, Grega Leskovšek <legr...@gmail.com> wrote:
> > I am working on CMS designed to those who are unfamiliar with a
> > computer world and I want to offer a task where on a push of a button
> > it will save current working page in textarea/s and open this page in
> > a new tab or in a new window.
>
> PHP is server side. "push of a button" is client side. Google
> javascript+onClick.
>
> > I googled some, but am still not sure how can I do it.
> >
> > Do I have to use target="_new" - I can not do this - I am working this
> > for my University seminar and it has to be valid HTML5.
> >
> > Please help me improve my plan
> > 1. I check wheter the user is using windows, linux, mac and then show
> > appropriate possibility of all browsers for the targeted platform
> > (WIN:IE,SA,FF,CH,OP, LINUX:FF.CHROMIUM and I need help for the mac
> > also besides SA and FF what does it have among browsers?)
>
> Have you tried to google for browser versions and platform? While
> searching for the same thing long time ago, I found a site that lists
> them. Also, note that since you'll be using onClick for "push of a
> button", beware of Javascript version difference among the browsers.
> IIRC, IE is supports 1.3 and FF supports 1.9. Haven't tested the
> others so couldn't tell you.
>
> > 2. When the browser clicks button with the image of browsers inside
> > anchor I target _new and location of the current file
> >
> > ?1 How can I offer option to open a new window not a new tab?
> > ?2 How can I avoid the target attribute?
> > ?3 How can I make a click on an image to produce action - or what do
> > You suggest me to use - I would prefer img element not button with an
> > image - how can I do this?
> >
> > Once I will finish it I will offer here software to everybody so I
> > will be able to get some response and improve it and this is one of
> > the major problems otherwise it is already functional.
> >
> > Please help me, thanks in advance - or ? You think I could do this better
> > in JS?
> > -- When the sun rises I receive and when it sets I forgive ->
> > http://moj.skavt.net/gleskovs/
> > Always in Heart, Grega Leskovšek
> >
>
> I don't know if you have Flash in your tool belt but have you
> considering using it? It may simply your life with various browsers
> and their versions across different platforms. Note: Flash does tend
> to be sluggish in terms of loading time and how much of what you need
> the Flash to do.
>
> Regards,
> Tommy
>
I'd avoid trying to guess the browser entirely. There are always loads
of fringe browsers that are in use, and things like Wine that allows
people to run IE on Linux, as well as other Windows-based browsers too.
As soon as you're trying to write a script that detects a specific
browser and does something then you're already doing it wrong. Don't
test for the browser, test for the feature that you're using. Javascript
has a useful function called hasFeature which may help here.
The main reason why it's bad to try and detect a browser and act on it
is because you can get many browsers that work across a wide variety of
operating systems such as Fx & Opera, which vary from version to version
and OS to OS.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On 3/25/2011 10:01 PM, David Robley wrote:
Hulf wrote:
Hi,
I am making and HTML email. I have 3 images to put in. Currently I have
$body .="
<table>
<tr>
<td><img src=\"image1.jpg\"></td>
</tr>
<tr>
<td></td>
</tr>
</table>
";
ideally I would like to have
$myimage1 = "image1.jpg";
$myimage2 = "image2.jpg";
$myimage3 = "image3.jpg";
and put them into the HTML body variable. I have tried escaping them in
every way i can think of, dots and slashes and the rest. Any ideas?
Ross
Did you try
$body .=";
<table>
<tr>
<td><img src=\"$myimage1\"></td>
</tr>
<tr>
<td></td>
</tr>
</table>
";
It helps us help you if you can give examples of what you have tried and how
it didn't work as you expected.
Cheers
I'd use:
$imgArray= array("image1.jpg","image2.jpg","image3.jpg");
$body.= "<table>\n";
foreach($imgArray as $image){
$body .= "<tr><td><img src=\"$myimage1\" /></td></tr>\n;
}
$body .= "</table>\n\n";
Watch the <img src=\"$myimage1\" />. <img> is an open tag; so end it with " />"
and it'll be XHTML ready.
--- End Message ---
--- Begin Message ---
On Sat, Mar 26, 2011 at 11:46, Al <n...@ridersite.org> wrote:
You guys know this thread will be three years old on Monday,
right? Interestingly enough, it looks like Ross ('Hulf') had his
client, OS, or mailserver improperly configured, because it shows that
the message to which we've all replied won't even exist until Monday
evening.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
On 3/26/2011 11:57 AM, Daniel Brown wrote:
On Sat, Mar 26, 2011 at 11:46, Al<n...@ridersite.org> wrote:
You guys know this thread will be three years old on Monday,
right? Interestingly enough, it looks like Ross ('Hulf') had his
client, OS, or mailserver improperly configured, because it shows that
the message to which we've all replied won't even exist until Monday
evening.
Hey, Daniel...
You know the old saying: "Better late than never".
--- End Message ---
--- Begin Message ---
Can you strace it's execution and see where your delay is comming from? If
you are using apache, make it create just one child and strace that one when
you generate a request.
b.
On 25 March 2011 19:01, Rob Adams <rad...@circlepix.com> wrote:
> I decided to try changing the session.save_path, and I've had some
> interesting results.
>
> First I changed it to a local directory. Originally it was on a mounted
> directory on our main file server. When I switched to a local directory,
> everything started working fast again on the php 5.2.17 server.
>
> So then I tried switching it to a different server mount. I set the
> session.save_path to a directory mounted on our backup file server. Once
> again, everything ran super fast.
>
> So then I tried switching it to a different mount on the main file server
> again. And it was back to taking at least 30 seconds to load.
>
> So, here's where I'm at:
>
> 4 other php 5.1.6 servers are using \\server1\mnt\phpsess as their
> session.save_path and are working just fine.
>
> My new installation of php 5.2.17 takes 30 seconds to start a session when
> mounting \\server1\mnt\phpsess. It also takes 30 seconds to start a session
> when mounting \\server1\mnt\testSess (a newly created dir).
>
> The php 5.2.17 server loads a session instantly when mounting
> \\server2\mnt\phpsess.
>
> I suppose I could just change the other four servers to use server2, and I
> might end up doing that, but it'd be like claiming defeat. I'd really like
> to figure out why this is happening. Any suggestions?
>
> Thanks.
>
> -- Rob
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
At 01:31 PM 3/25/2011, João Cândido de Souza Neto wrote:
It´s a job to array_key_exists function.
--
João Cândido de Souza Neto
"Ethan Rosenberg" <eth...@earthlink.net> escreveu na mensagem
news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net...
> Dear List -
>
> Here is a code snippet:
>
> $bla = array("g1" => $results[7][6],
> "h1" => $results[7][7]);
> print_r($bla);
> $value = "h1";
> $locate1 = array_search($value, $bla);
> echo "This is locate" ; print_r($locate1);
> if(in_array($value, $bla)) print_r($bla);
>
> Neither the array_search or the in_array functions give any results. I
> have tried it with both h1 and "h1";
>
> $results[7][6] = Wn;
> $results[7][7] = Wr;
>
> This is a chess board where g1 and h1 are the coordinates and the results
> array contains the pieces at that coordinate.
>
> What am I doing wrong?
>
> Advice and comments please.
>
> Thanks.
>
> Ethan Rosenberg
>
++++++++++++
Thank you. It works!!
Ethan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---