Re: [PHP] PHP and javascript

2010-01-19 Thread Rene Veerman
oh, and if you're going to use ajax->non-phphttpd->php->andback, then
check if your dear non-php httpd abuses the CPU while waiting for PHP
to return the results...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and javascript

2010-01-19 Thread Rene Veerman
To do what you want that new httpd server should at least be able to
call up PHP via cli / whatever, and retrieve the output.
It also needs to provide what's in php called $_GET and $_POST.

Assuming you got that covered, then yes, you could route the calls via
ajax (i recommend jquery.com for that) to your non-php httpd, which
then forwards it (and the results back).
What i'd do if it HAD to be done this way, is pass a couple of extra
variables in each call from javascript. It's best to route all the
ajax calls to php to the same script on the non-php httpd, so you'd
need at least the "relative path (from serverside defined absolute
base-path for your php subsystem) to the script being called" (or even
an MD5/SHA256 of this rel path, if you're on the paranoid side; you
then inform (via an array) the non-php httpd about all the scripts
that may be called from javascript, without giving up the scripts
names to spies along the line)

But tbh, whoever thought of changing the type of server used and
thereby giving you this new problem, should have also thought of how
to not-dump tons of existing code. Not to mention developer experience
with a specific language.

If this new httpd is so damn good at something that it has to be used,
it still doesn't mean it has to be used for the entire system either.
You might be giving it more work than it is comfortable with, that
way.

So depending on your backend size (in terms of number of machines
used) & setup, you might even campaign to keep an apache in the
picture and let it perform work on the database / file storage
system..

On Fri, Jan 15, 2010 at 8:07 PM, Andres Gonzalez  wrote:
> How do I call PHP code that will run server side, from javascript code that
> is running client side?
>
> I have a lot of PHP server side code written and working within CodeIgniter.
>  Now, my project
> has changed and (for reasons unimportant to this discussion) we are now NOT
> going to
> use apache and CodeIgniter, but instead, we are going to have to use an http
> server that does
> not support PHP internally.  But I want to reuse my original PHP code. So I
> am thinking that I
> can execute the PHP code via a command line interface using the PHP cli
> interface instead of
> the PHP cgi interface. But, I will have to initiate this serversid call via
> javascript code running
> on the client.
>
> I know...kind of convoluted. But how would one do this if necessary?
>
> -Andres
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and javascript

2010-01-15 Thread Ashley Sheridan
On Fri, 2010-01-15 at 14:07 -0500, Andres Gonzalez wrote:

> How do I call PHP code that will run server side, from javascript code 
> that is running client side?
> 
> I have a lot of PHP server side code written and working within 
> CodeIgniter.  Now, my project
> has changed and (for reasons unimportant to this discussion) we are now 
> NOT going to
> use apache and CodeIgniter, but instead, we are going to have to use an 
> http server that does
> not support PHP internally.  But I want to reuse my original PHP code. 
> So I am thinking that I
> can execute the PHP code via a command line interface using the PHP cli 
> interface instead of
> the PHP cgi interface. But, I will have to initiate this serversid call 
> via javascript code running
> on the client.
> 
> I know...kind of convoluted. But how would one do this if necessary?
> 
> -Andres
> 


I wouldn't recommend doing it this way at all. What you'd essentially
need, is Javascript make an AJAX request to a server script, which would
then call your PHP shell script, which would then return data to the
[other language] server script, that responds back to the Javascript on
the browser.

What sort of server will you be using that you can' support PHP on it?
PHP runs on most web servers out there, and will happily run alongside
other language modules on a single server.

Who's making the decisions about the new server? Someone really needs to
explain to him/her that it's a massive project converting a website from
one language to another (I've had to convert a large ColdFusion one to
PHP before, so I know) and it will probably cost more in the long term
to convert than might be saved on whatever server 'deal' they're
getting.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP and javascript

2010-01-15 Thread Ryan Sun
I don't think you can call php cli from client javascript unless you have a
wrapper http interface

On Fri, Jan 15, 2010 at 2:07 PM, Andres Gonzalez wrote:

> How do I call PHP code that will run server side, from javascript code that
> is running client side?
>
> I have a lot of PHP server side code written and working within
> CodeIgniter.  Now, my project
> has changed and (for reasons unimportant to this discussion) we are now NOT
> going to
> use apache and CodeIgniter, but instead, we are going to have to use an
> http server that does
> not support PHP internally.  But I want to reuse my original PHP code. So I
> am thinking that I
> can execute the PHP code via a command line interface using the PHP cli
> interface instead of
> the PHP cgi interface. But, I will have to initiate this serversid call via
> javascript code running
> on the client.
>
> I know...kind of convoluted. But how would one do this if necessary?
>
> -Andres
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Devendra Jadhav
:)

On Mon, Nov 2, 2009 at 4:56 PM, acetrader  wrote:

>
> lol thank you very much guys :) the escape character worked and now its
> accepting my javascript functions, thank you all very much :)
> :jumping::jumping:
> --
> View this message in context:
> http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156680.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Devendra Jadhav


Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread acetrader

lol thank you very much guys :) the escape character worked and now its
accepting my javascript functions, thank you all very much :)
:jumping::jumping:
-- 
View this message in context: 
http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156680.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Ashley Sheridan
On Mon, 2009-11-02 at 16:51 +0530, Devendra Jadhav wrote:

> Ashley Sheridan:
> > btw: I know I've written onClik wrong but I wrote it this way in this
> forum
> > cause it wouldn't let me post my thread because it regards it as an
> illegal
> > tag lol. B-)B-)
> 
> :D
> 
> 
> On Mon, Nov 2, 2009 at 4:38 PM, Ashley Sheridan 
> wrote:
> 
> > On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:
> >
> > > Hi there,
> > >
> > > I am doing an application that allows me to create RSS channels and put
> > > feeds inside of each channel. Everything works so far, but - now I have
> > > started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and
> > 'Delete
> > > Feed' functionalities and have run into a problem. For me its a big
> > problem
> > > cause Im not a guru programmer but for you out there it may be a piece of
> > > cake.
> > >
> > > I have the following line of code:
> > >
> > > $myFeedHTML .="
> > $feedItemImagePath 
> > >   > > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />   > > />DELETE";
> > >
> > > In $myFeedHTML I'am always appending new HTML data to it, in this case
> > I'am
> > > appending a table row/header row that has an image in it and underneath
> > the
> > > image it has two buttons, one is for the EDIT functionality and the other
> > is
> > > for the DELETE functionality.
> > >
> > > Now... notice the onClik events ->
> > > onClik='javascript:DeleteChannelAndAllOfItsFeeds()'. I ususally use
> > that
> > > method to call a javascript function from within a button or a
> > linkand
> > > like this is works (on its own - ie when its not being appended as a
> > normal
> > > string to the variable $myFeedHTML).
> > >
> > > But...When it is appended to a variable so that I echo everything at once
> > in
> > > the end, the onClik action must be included inside a " (double quotes)
> > and
> > > inside  ' (single quotes) so that it can be appeneded to the string, now
> > > when this is being done everything gets mixed because of of all the " and
> > '
> > > thus the program thinks that these are normal escape characters and just
> > > skips over the javascript call function that is nested within the onClik
> > > event. So the onClik is not getting a function assigned to it. (you can
> > see
> > > this in the code I've pasted above)
> > >
> > > What can I do in order to append it to my $myFeedHTML variable and at the
> > > same time have it assigend a javascript function inside of its
> > EDIT/DELETE
> > > button onClik event ?
> > >
> > > Can you give me some example maybe etc ?
> > >
> > > Image Preview:
> > >
> > > http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.jpg
> > >
> > > btw: I know I've written onClik wrong but I wrote it this way in this
> > forum
> > > cause it wouldn't let me post my thread because it regards it as an
> > illegal
> > > tag lol. B-)B-)
> > >
> > > Thank you very much :) ,
> > > The Ace
> > >
> > >
> > > --
> > > View this message in context:
> > http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627.html
> > > Sent from the PHP - General mailing list archive at Nabble.com.
> > >
> > >
> >
> >
> > I've noticed also that in your code you've always referred to onclik,
> > when it should be onclick. I hope this was just a typo in the email!
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
> 
> 


oops, lol!

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Devendra Jadhav
Ashley Sheridan:
> btw: I know I've written onClik wrong but I wrote it this way in this
forum
> cause it wouldn't let me post my thread because it regards it as an
illegal
> tag lol. B-)B-)

:D


On Mon, Nov 2, 2009 at 4:38 PM, Ashley Sheridan 
wrote:

> On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:
>
> > Hi there,
> >
> > I am doing an application that allows me to create RSS channels and put
> > feeds inside of each channel. Everything works so far, but - now I have
> > started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and
> 'Delete
> > Feed' functionalities and have run into a problem. For me its a big
> problem
> > cause Im not a guru programmer but for you out there it may be a piece of
> > cake.
> >
> > I have the following line of code:
> >
> > $myFeedHTML .="
> $feedItemImagePath 
> >   > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />   > />DELETE";
> >
> > In $myFeedHTML I'am always appending new HTML data to it, in this case
> I'am
> > appending a table row/header row that has an image in it and underneath
> the
> > image it has two buttons, one is for the EDIT functionality and the other
> is
> > for the DELETE functionality.
> >
> > Now... notice the onClik events ->
> > onClik='javascript:DeleteChannelAndAllOfItsFeeds()'. I ususally use
> that
> > method to call a javascript function from within a button or a
> linkand
> > like this is works (on its own - ie when its not being appended as a
> normal
> > string to the variable $myFeedHTML).
> >
> > But...When it is appended to a variable so that I echo everything at once
> in
> > the end, the onClik action must be included inside a " (double quotes)
> and
> > inside  ' (single quotes) so that it can be appeneded to the string, now
> > when this is being done everything gets mixed because of of all the " and
> '
> > thus the program thinks that these are normal escape characters and just
> > skips over the javascript call function that is nested within the onClik
> > event. So the onClik is not getting a function assigned to it. (you can
> see
> > this in the code I've pasted above)
> >
> > What can I do in order to append it to my $myFeedHTML variable and at the
> > same time have it assigend a javascript function inside of its
> EDIT/DELETE
> > button onClik event ?
> >
> > Can you give me some example maybe etc ?
> >
> > Image Preview:
> >
> > http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.jpg
> >
> > btw: I know I've written onClik wrong but I wrote it this way in this
> forum
> > cause it wouldn't let me post my thread because it regards it as an
> illegal
> > tag lol. B-)B-)
> >
> > Thank you very much :) ,
> > The Ace
> >
> >
> > --
> > View this message in context:
> http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627.html
> > Sent from the PHP - General mailing list archive at Nabble.com.
> >
> >
>
>
> I've noticed also that in your code you've always referred to onclik,
> when it should be onclick. I hope this was just a typo in the email!
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


-- 
Devendra Jadhav


Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Stuart
2009/11/2 Ashley Sheridan :
> On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:
>
>> Hi there,
>>
>> I am doing an application that allows me to create RSS channels and put
>> feeds inside of each channel. Everything works so far, but - now I have
>> started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Delete
>> Feed' functionalities and have run into a problem. For me its a big problem
>> cause Im not a guru programmer but for you out there it may be a piece of
>> cake.
>>
>> I have the following line of code:
>>
>> $myFeedHTML .=        " $feedItemImagePath 
>> 
>>  > onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />  > />DELETE";
>>
>> In $myFeedHTML I'am always appending new HTML data to it, in this case I'am
>> appending a table row/header row that has an image in it and underneath the
>> image it has two buttons, one is for the EDIT functionality and the other is
>> for the DELETE functionality.
>>
>> Now... notice the onClik events ->
>> onClik='javascript:DeleteChannelAndAllOfItsFeeds()'    . I ususally use that
>> method to call a javascript function from within a button or a linkand
>> like this is works (on its own - ie when its not being appended as a normal
>> string to the variable $myFeedHTML).
>>
>> But...When it is appended to a variable so that I echo everything at once in
>> the end, the onClik action must be included inside a " (double quotes) and
>> inside  ' (single quotes) so that it can be appeneded to the string, now
>> when this is being done everything gets mixed because of of all the " and '
>> thus the program thinks that these are normal escape characters and just
>> skips over the javascript call function that is nested within the onClik
>> event. So the onClik is not getting a function assigned to it. (you can see
>> this in the code I've pasted above)
>>
>> What can I do in order to append it to my $myFeedHTML variable and at the
>> same time have it assigend a javascript function inside of its EDIT/DELETE
>> button onClik event ?
>>
>> Can you give me some example maybe etc ?
>>
>> Image Preview:
>>
>> http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.jpg
>>
>> btw: I know I've written onClik wrong but I wrote it this way in this forum
>> cause it wouldn't let me post my thread because it regards it as an illegal
>> tag lol. B-)B-)
>>
>> Thank you very much :) ,
>> The Ace
>>
>>
>> --
>> View this message in context: 
>> http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627.html
>> Sent from the PHP - General mailing list archive at Nabble.com.
>>
>>
>
>
> I've noticed also that in your code you've always referred to onclik,
> when it should be onclick. I hope this was just a typo in the email!

I've noticed also that you didn't read his email properly. I hope that
was just an oversight.

-Stuart

-- 
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Ashley Sheridan
On Mon, 2009-11-02 at 00:53 -0800, acetrader wrote:

> Hi there,
> 
> I am doing an application that allows me to create RSS channels and put
> feeds inside of each channel. Everything works so far, but - now I have
> started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Delete
> Feed' functionalities and have run into a problem. For me its a big problem
> cause Im not a guru programmer but for you out there it may be a piece of
> cake.
> 
> I have the following line of code:
> 
> $myFeedHTML .=" $feedItemImagePath 
> 
>   onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />   />DELETE";
> 
> In $myFeedHTML I'am always appending new HTML data to it, in this case I'am
> appending a table row/header row that has an image in it and underneath the
> image it has two buttons, one is for the EDIT functionality and the other is
> for the DELETE functionality.
> 
> Now... notice the onClik events ->
> onClik='javascript:DeleteChannelAndAllOfItsFeeds()'. I ususally use that
> method to call a javascript function from within a button or a linkand
> like this is works (on its own - ie when its not being appended as a normal
> string to the variable $myFeedHTML). 
> 
> But...When it is appended to a variable so that I echo everything at once in
> the end, the onClik action must be included inside a " (double quotes) and
> inside  ' (single quotes) so that it can be appeneded to the string, now
> when this is being done everything gets mixed because of of all the " and '
> thus the program thinks that these are normal escape characters and just
> skips over the javascript call function that is nested within the onClik
> event. So the onClik is not getting a function assigned to it. (you can see
> this in the code I've pasted above)
> 
> What can I do in order to append it to my $myFeedHTML variable and at the
> same time have it assigend a javascript function inside of its EDIT/DELETE
> button onClik event ?
> 
> Can you give me some example maybe etc ?
> 
> Image Preview: 
> 
> http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.jpg 
> 
> btw: I know I've written onClik wrong but I wrote it this way in this forum
> cause it wouldn't let me post my thread because it regards it as an illegal
> tag lol. B-)B-)
> 
> Thank you very much :) ,
> The Ace
> 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627.html
> Sent from the PHP - General mailing list archive at Nabble.com.
> 
> 


I've noticed also that in your code you've always referred to onclik,
when it should be onclick. I hope this was just a typo in the email!

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Devendra Jadhav
Hey,
You can do it this way as well
$myFeedHTML .=  " $feedItemImagePath 
 
> DeleteChannelAndAllOfItsFeeds()\" />   />DELETE";


So you can escape double quotes by \ (slash)
try this .. It will work...
you can escape any special character that you want to use as it is by
prepend it by \

On Mon, Nov 2, 2009 at 2:23 PM, acetrader  wrote:

>
> Hi there,
>
> I am doing an application that allows me to create RSS channels and put
> feeds inside of each channel. Everything works so far, but - now I have
> started to do the 'Edit Channel', 'Edit Feed', 'Delete Channel' and 'Delete
> Feed' functionalities and have run into a problem. For me its a big problem
> cause Im not a guru programmer but for you out there it may be a piece of
> cake.
>
> I have the following line of code:
>
> $myFeedHTML .=  " $feedItemImagePath 
>   onClik='javascript:DeleteChannelAndAllOfItsFeeds()' />   />DELETE";
>
> In $myFeedHTML I'am always appending new HTML data to it, in this case I'am
> appending a table row/header row that has an image in it and underneath the
> image it has two buttons, one is for the EDIT functionality and the other
> is
> for the DELETE functionality.
>
> Now... notice the onClik events ->
> onClik='javascript:DeleteChannelAndAllOfItsFeeds()'. I ususally use
> that
> method to call a javascript function from within a button or a linkand
> like this is works (on its own - ie when its not being appended as a normal
> string to the variable $myFeedHTML).
>
> But...When it is appended to a variable so that I echo everything at once
> in
> the end, the onClik action must be included inside a " (double quotes) and
> inside  ' (single quotes) so that it can be appeneded to the string, now
> when this is being done everything gets mixed because of of all the " and '
> thus the program thinks that these are normal escape characters and just
> skips over the javascript call function that is nested within the onClik
> event. So the onClik is not getting a function assigned to it. (you can see
> this in the code I've pasted above)
>
> What can I do in order to append it to my $myFeedHTML variable and at the
> same time have it assigend a javascript function inside of its EDIT/DELETE
> button onClik event ?
>
> Can you give me some example maybe etc ?
>
> Image Preview:
>
> http://old.nabble.com/file/p26156627/my%2BEscape%2BProblem.jpg
>
> btw: I know I've written onClik wrong but I wrote it this way in this forum
> cause it wouldn't let me post my thread because it regards it as an illegal
> tag lol. B-)B-)
>
> Thank you very much :) ,
> The Ace
>
>
> --
> View this message in context:
> http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-like-to-solve-things-can-try-to-solve-this-issue%2C-its-tricky-I-think--%29-tp26156627p26156627.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Devendra Jadhav


RE: [PHP] php and javascript error

2007-03-12 Thread Richard Lynch
On Sun, March 11, 2007 9:21 am, tedd wrote:
> At 5:28 PM +0100 3/7/07, [EMAIL PROTECTED] wrote:
>>  > PS: If you want your code to validate, change the & to &  Add
>> the
>>>  closing  tag too.
>>>  PPS: It's advisable not to use the short tags, use >> of >in such a cases I usually use  instead .
>> At
>>least it's shorter. :)
>>
>>-afan
>
> But, while it's shorter, it's still NOT advisable to use the shorter
> tags.

I believe short tags is/was/maybe slated for removal completely in PHP
6...

That may have been shot down.

Or maybe http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-12 Thread Richard Lynch
On Thu, March 8, 2007 7:17 pm, jekillen wrote:
> Yes I have been around the bend with Netscape and now, Fire Fox
> javascript consoles.
> Before I got it that I need to format web content text for Unix, I
> went
> crazy trying to interpret
> Netscape console messages and the line numbers it said the errors were
> found. I was using
> Mac and text file are formatted with carriage return, not new line or
> line feed as in Unix text.
> The Javascript errors are based on Unix text formatting even if the
> browser is running on
> Mac or Windows (well I am not sure about Windows, I have never use it
> for web development
> but I do know that it uses both carriage return and line feed for
> plain
> text line endings).

The line numbers correspond to your HTML output lines, not PHP lines.

You may also want to tack on "\n" for most PHP print/echo statements,
so that the HTML source is nicely formatted.

Between JavaScript console and "View Source" you can almost always
track back to what PHP spit out what, unless your PHP code is a pig's
breakfast to start with.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-12 Thread Richard Lynch
When you install IE, I think there is an option to get the developer
JS tools that give better error messages...

And there's some kind of setting in the preferences about showing JS
errors.

And maybe a JS console.

Havent' used IE for so long, I forget what all there is, but I suspect
you can wring out more info, once you go through enough interminible
dialogs from MS.

Also check in Firefox JS console -- It may be warning you of a problem
without halting on it.

On Wed, March 7, 2007 11:03 am, Németh Zoltán wrote:
> 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
>> I've just run into this problem this morning
>>
>> > onclick="javascript:window.open('web_forward.php?address=> echo $web_url; ?>&agent=&real_company_name=> $real_company_name; ?>', 'Web Site');">
>>
>> This produces an "Error on Page" in IE 7, but works perfectly in
>> Firefox
>> and Netscape.
>>
>> I have several other javascript calls on the page where this call
>> resides and all of them work perfectly except for this one. Does
>> this
>> error occur because I'm sending the variables to another script that
>> does some logging then forwards the user to the URL or is it just a
>> IE
>> quirk?
>>
>
> I'm almost sure it has nothing to do with php
> rather javascript, and maybe microsoft's special javascript
> interpretations...
>
> greets
> Zoltán Németh
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-11 Thread tedd

At 3:25 PM +0100 3/11/07, Tijnema ! wrote:

On 3/11/07, tedd <[EMAIL PROTECTED]> wrote:

At 5:28 PM +0100 3/7/07, [EMAIL PROTECTED] wrote:

 > PS: If you want your code to validate, change the & to &  Add the

 closing  tag too.
 PPS: It's advisable not to use the short tags, use 
in such a cases I usually use  instead . At
least it's shorter. :)

-afan


But, while it's shorter, it's still NOT advisable to use the shorter tags.

tedd


It does save space on your harddrive (Not much, but some :P)

and if it is for your own usage only, why not?

Tijnema


Tijnema:

Saves space? I would venture to say that if you took the inverse of 
the space that technique saves from a typical drive and turn it into 
dollars, we all (the entire world) could live the rest of our lives 
very comfortably. Another way to look at it, I would venture to say, 
if you took the total actual cost for the space everyone (all php 
programmers together) saved from a lifetime of work, you couldn't buy 
a cup of coffee with it. So, the old "let's save space" legacy 
concern doesn't mean squat anymore and it's meaning less squat each 
day.




It's a matter of style and consistency not to use short tags. Don't 
develop "bad-habits" when you can easily avoid them. Plus, while we 
develop code for ourselves, we seldom stay in that environment and 
when we do venture out, we often take those bad habits with us. Why 
do it wrong?


Also for me, adding "php" to a short tag is just a reminder of what 
language I'm currently using and that certainly doesn't inconvenience 
me a bit -. Besides, it provides me with some degree of comfort in 
that if I want to move my code publicly, or portions of it, I don't 
have to worry about past bad habits. After decades of programming, I 
have enough of those.




Additionally, while I have not dealt with xml yet, I have read that 
there is a problem in dealing with xml if you use the php short tag 
regardless of if you're coding for yourself or not.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-11 Thread Tijnema !

On 3/11/07, tedd <[EMAIL PROTECTED]> wrote:


At 5:28 PM +0100 3/7/07, [EMAIL PROTECTED] wrote:
>  > PS: If you want your code to validate, change the & to &  Add the
>>  closing  tag too.
>>  PPS: It's advisable not to use the short tags, use in such a cases I usually use  instead . At
>least it's shorter. :)
>
>-afan

But, while it's shorter, it's still NOT advisable to use the shorter tags.

tedd



It does save space on your harddrive (Not much, but some :P)

and if it is for your own usage only, why not?

Tijnema

--

---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] php and javascript error

2007-03-11 Thread tedd

At 5:28 PM +0100 3/7/07, [EMAIL PROTECTED] wrote:

 > PS: If you want your code to validate, change the & to &  Add the

 closing  tag too.
 PPS: It's advisable not to use the short tags, use 
in such a cases I usually use  instead . At
least it's shorter. :)

-afan


But, while it's shorter, it's still NOT advisable to use the shorter tags.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-08 Thread jekillen


On Mar 7, 2007, at 11:46 PM, Tijnema ! wrote:

Just a little side note, you said that firefox wasn't giving an error, 
i think it does, but that it hides the error.

Open your page, and then go to Tools->javascript console.
There it will display all javascript errors. And gives a nice detailed 
error.

 
Tijnema


Thanks,
Yes I have been around the bend with Netscape and now, Fire Fox 
javascript consoles.
Before I got it that I need to format web content text for Unix, I went 
crazy trying to interpret
Netscape console messages and the line numbers it said the errors were 
found. I was using
Mac and text file are formatted with carriage return, not new line or 
line feed as in Unix text.
The Javascript errors are based on Unix text formatting even if the 
browser is running on
Mac or Windows (well I am not sure about Windows, I have never use it 
for web development
but I do know that it uses both carriage return and line feed for plain 
text line endings).

Jeff K

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Tijnema !

Just a little side note, you said that firefox wasn't giving an error, i
think it does, but that it hides the error.
Open your page, and then go to Tools->javascript console.
There it will display all javascript errors. And gives a nice detailed
error.

Tijnema


Re: [PHP] php and javascript error

2007-03-07 Thread jekillen


On Mar 7, 2007, at 10:24 AM, Ed Curtis wrote:


Edward Kay wrote:


you've got a stay quote mark in one of your PHP vars.


Not it, I looked and there's nothing there.
I'm sure it's because you've got some stray characters in your output 
that
mess it up. It would help if you actually posted the source rather 
than just

saying it's OK, when it clearly isn't.


The problem wasn't a stray apostrophe. Brad Fuller was dead on. It was 
the space in the window name option of the javascript. It works as 
expected once the space is removed.


PPS: It's advisable not to use the short tags, use of 

Can you tell me why? Is it just a personal preference?
If you move to another server where the short tags option is off, 
your code

will break. From the manual:
Using short tags should be avoided when developing applications or 
libraries
that are meant for redistribution, or deployment on PHP servers which 
are

not under your control


My scripts aren't meant for distribution also they will only ever be 
delpoyed on a server that I control. Thanks for the tip though and 
thanks to everyone that helped.


Ed


This isn't a javascript discussion list but, javascript and php 
compliment each other very well.


Internet Explorer has error reporting that can be turned on in the 
preferences.


I would try that before making any other assumptions.

Believe me, I started developing javascript before php and with no IDE 
for javascript you
'have to rely on the browsers error reporting facilities, and lots of 
alert dialogs used as
break points. Safari on Mac is a head ache because it has no error 
reporting at all and
I have encountered problems with it that do not show up in any of the 
browsers that do

have error reporting.
Hope that helps,
Jeff K

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Ed Curtis

Edward Kay wrote:


you've got a stay quote mark in one of your PHP vars.


Not it, I looked and there's nothing there.



I'm sure it's because you've got some stray characters in your output that
mess it up. It would help if you actually posted the source rather than just
saying it's OK, when it clearly isn't.



The problem wasn't a stray apostrophe. Brad Fuller was dead on. It was 
the space in the window name option of the javascript. It works as 
expected once the space is removed.





PPS: It's advisable not to use the short tags, use 

Can you tell me why? Is it just a personal preference?


If you move to another server where the short tags option is off, your code
will break. From the manual:

Using short tags should be avoided when developing applications or libraries
that are meant for redistribution, or deployment on PHP servers which are
not under your control


My scripts aren't meant for distribution also they will only ever be 
delpoyed on a server that I control. Thanks for the tip though and 
thanks to everyone that helped.


Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Seak, Teng-Fong
Ed Curtis wrote:
> Németh Zoltán wrote:
>> 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
>>
>>> I've just run into this problem this morning
>>>
>>> >> onclick="javascript:window.open('web_forward.php?address=>> $web_url; ?>&agent=&real_company_name=>> $real_company_name; ?>', 'Web Site');">
>>>
>>> This produces an "Error on Page" in IE 7, but works perfectly in
>>> Firefox and Netscape.
>>>
>>> I have several other javascript calls on the page where this call
>>> resides and all of them work perfectly except for this one. Does
>>> this error occur because I'm sending the variables to another script
>>> that does some logging then forwards the user to the URL or is it
>>> just a IE quirk?
>>>
>>
>>
>> I'm almost sure it has nothing to do with php
>> rather javascript, and maybe microsoft's special javascript
>> interpretations...
>
> I know it's not the PHP but rather the JS that's causing it. What I
> fail to understand is that there are 2 JS calls before, and 2 JS calls
> after this one in my page and the other 4 work perfectly. They are
> basically the same call too, just to different scripts. I just
> wondered if anyone  knew why this particular call doesn't work or had
> come across anything like this.
>
> Thanks
Sidenote: In new standard of HTML, it's no longer necessary to write
onclick="javascript:window.open(.
but you could write
onclick="window.open(.

Could you paste the generated code to show us?  You could paste it
back to a static page and try again to see what's wrong.



--
* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised! 
www.zoner.com/zps
  You can download your free version.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript error

2007-03-07 Thread Edward Kay

> >>>
> >>>
> >>
> >>This is a JavaScript issue, but may have something to do with
> the data you
> >>are echoing out in PHP. Look at the source in the browser. My guess it
> >>that
>
> >>you've got a stay quote mark in one of your PHP vars.
>
> Not it, I looked and there's nothing there.

I'm sure it's because you've got some stray characters in your output that
mess it up. It would help if you actually posted the source rather than just
saying it's OK, when it clearly isn't.


> >>PPS: It's advisable not to use the short tags, use 
> Can you tell me why? Is it just a personal preference?

If you move to another server where the short tags option is off, your code
will break. From the manual:

Using short tags should be avoided when developing applications or libraries
that are meant for redistribution, or deployment on PHP servers which are
not under your control, because short tags may not be supported on the
target server. For portable, redistributable code, be sure not to use short
tags.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript error

2007-03-07 Thread Brad Fuller
> -Original Message-
> From: Brad Fuller [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 07, 2007 12:02 PM
> To: 'Ed Curtis'; 'php-general@lists.php.net'
> Subject: RE: [PHP] php and javascript error
> 
> > -Original Message-
> > From: Ed Curtis [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 07, 2007 11:47 AM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] php and javascript error
> >
> >
> > >>> onclick="javascript:window.open('web_forward.php?address= > >>>echo $web_url; ?>&agent=&real_company_name= > >>>$real_company_name; ?>', 'Web Site');">
> > >>>
> > >>>This produces an "Error on Page" in IE 7, but works perfectly in
> > Firefox
> > >>>and Netscape.
> 
> 
> Is it because you have given the window the name 'Web Site' which contains
> a space character?  Try naming it 'WebSite' (without the space)
> 
> Hopefully that is the culprit.

You should also be making sure to use urlencode() on all data that goes into
that URL.

 click here 


> > >>>I have several other javascript calls on the page where this call
> > >>>resides and all of them work perfectly except for this one. Does this
> > >>>error occur because I'm sending the variables to another script that
> > >>>does some logging then forwards the user to the URL or is it just a
> IE
> > >>>quirk?
> > >>>
> > >>
> > >>This is a JavaScript issue, but may have something to do with the data
> > you
> > >>are echoing out in PHP. Look at the source in the browser. My guess it
> > >>that
> >
> > >>you've got a stay quote mark in one of your PHP vars.
> >
> > Not it, I looked and there's nothing there.
> >
> > >>PS: If you want your code to validate, change the & to &  Add the
> > >>closing  tag too.
> >
> > Thanks, the &'s are now all &. The closing  is in the script,
> > just wasn't posted in the message.
> >
> > >>PPS: It's advisable not to use the short tags, use  >
> > Can you tell me why? Is it just a personal preference?
> >
> > Another JS call directly in front of this one works perfectly.
> >
> > 
> > Send Me Email
> > 
> >
> > The only difference is this call has the window options included the one
> > that doesn't work doesn't have them. I've added them just to check and
> > it didn't change anything.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript error

2007-03-07 Thread Brad Fuller
> -Original Message-
> From: Ed Curtis [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 07, 2007 11:47 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] php and javascript error
> 
> 
> >>>
> >>>
> >>>This produces an "Error on Page" in IE 7, but works perfectly in
> Firefox
> >>>and Netscape.


Is it because you have given the window the name 'Web Site' which contains a
space character?  Try naming it 'WebSite' (without the space)

Hopefully that is the culprit.


> >>>I have several other javascript calls on the page where this call
> >>>resides and all of them work perfectly except for this one. Does this
> >>>error occur because I'm sending the variables to another script that
> >>>does some logging then forwards the user to the URL or is it just a IE
> >>>quirk?
> >>>
> >>
> >>This is a JavaScript issue, but may have something to do with the data
> you
> >>are echoing out in PHP. Look at the source in the browser. My guess it
> >>that
> 
> >>you've got a stay quote mark in one of your PHP vars.
> 
> Not it, I looked and there's nothing there.
> 
> >>PS: If you want your code to validate, change the & to &  Add the
> >>closing  tag too.
> 
> Thanks, the &'s are now all &. The closing  is in the script,
> just wasn't posted in the message.
> 
> >>PPS: It's advisable not to use the short tags, use  
> Can you tell me why? Is it just a personal preference?
> 
> Another JS call directly in front of this one works perfectly.
> 
> 
> Send Me Email
> 
> 
> The only difference is this call has the window options included the one
> that doesn't work doesn't have them. I've added them just to check and
> it didn't change anything.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Ed Curtis





This produces an "Error on Page" in IE 7, but works perfectly in Firefox
and Netscape.

I have several other javascript calls on the page where this call
resides and all of them work perfectly except for this one. Does this
error occur because I'm sending the variables to another script that
does some logging then forwards the user to the URL or is it just a IE
quirk?



This is a JavaScript issue, but may have something to do with the data you
are echoing out in PHP. Look at the source in the browser. My guess it
that



you've got a stay quote mark in one of your PHP vars.


Not it, I looked and there's nothing there.


PS: If you want your code to validate, change the & to &  Add the
closing  tag too.


Thanks, the &'s are now all &. The closing  is in the script, 
just wasn't posted in the message.



PPS: It's advisable not to use the short tags, use 

Can you tell me why? Is it just a personal preference?

Another JS call directly in front of this one works perfectly.



Send Me Email


The only difference is this call has the window options included the one 
that doesn't work doesn't have them. I've added them just to check and 
it didn't change anything.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript error

2007-03-07 Thread afan
>
>> I've just run into this problem this morning
>>
>> 
>>
>> This produces an "Error on Page" in IE 7, but works perfectly in Firefox
>> and Netscape.
>>
>> I have several other javascript calls on the page where this call
>> resides and all of them work perfectly except for this one. Does this
>> error occur because I'm sending the variables to another script that
>> does some logging then forwards the user to the URL or is it just a IE
>> quirk?
>>
>
> This is a JavaScript issue, but may have something to do with the data you
> are echoing out in PHP. Look at the source in the browser. My guess it
> that
> you've got a stay quote mark in one of your PHP vars.
>
> Edward
>
> PS: If you want your code to validate, change the & to &  Add the
> closing  tag too.
> PPS: It's advisable not to use the short tags, use  instead . At
least it's shorter. :)

-afan

>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Tijnema !

On 3/7/07, Ed Curtis <[EMAIL PROTECTED]> wrote:


Németh Zoltán wrote:
> 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
>
>>I've just run into this problem this morning
>>
>>
>>
>>This produces an "Error on Page" in IE 7, but works perfectly in Firefox
>>and Netscape.
>>
>>I have several other javascript calls on the page where this call
>>resides and all of them work perfectly except for this one. Does this
>>error occur because I'm sending the variables to another script that
>>does some logging then forwards the user to the URL or is it just a IE
>>quirk?
>>
>
>
> I'm almost sure it has nothing to do with php
> rather javascript, and maybe microsoft's special javascript
> interpretations...

I know it's not the PHP but rather the JS that's causing it. What I fail
to understand is that there are 2 JS calls before, and 2 JS calls after
this one in my page and the other 4 work perfectly. They are basically
the same call too, just to different scripts. I just wondered if anyone
knew why this particular call doesn't work or had come across anything
like this.

Thanks



I think you're not at the right mailing list for this, and btw, it would be
a lot easier to find what is going wrong, if you post one of the working
ones...

Tijnema

--

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php and javascript error

2007-03-07 Thread Ed Curtis

Németh Zoltán wrote:

2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:


I've just run into this problem this morning




This produces an "Error on Page" in IE 7, but works perfectly in Firefox 
and Netscape.


I have several other javascript calls on the page where this call 
resides and all of them work perfectly except for this one. Does this 
error occur because I'm sending the variables to another script that 
does some logging then forwards the user to the URL or is it just a IE 
quirk?





I'm almost sure it has nothing to do with php
rather javascript, and maybe microsoft's special javascript
interpretations...


I know it's not the PHP but rather the JS that's causing it. What I fail 
to understand is that there are 2 JS calls before, and 2 JS calls after 
this one in my page and the other 4 work perfectly. They are basically 
the same call too, just to different scripts. I just wondered if anyone 
 knew why this particular call doesn't work or had come across anything 
like this.


Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript error

2007-03-07 Thread Edward Kay

> I've just run into this problem this morning
>
> 
>
> This produces an "Error on Page" in IE 7, but works perfectly in Firefox
> and Netscape.
>
> I have several other javascript calls on the page where this call
> resides and all of them work perfectly except for this one. Does this
> error occur because I'm sending the variables to another script that
> does some logging then forwards the user to the URL or is it just a IE
> quirk?
>

This is a JavaScript issue, but may have something to do with the data you
are echoing out in PHP. Look at the source in the browser. My guess it that
you've got a stay quote mark in one of your PHP vars.

Edward

PS: If you want your code to validate, change the & to &  Add the
closing  tag too.
PPS: It's advisable not to use the short tags, use http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Tijnema !

Open the page with IE 7, and open the source, if it doesn't show any  tags, then it is a IE problem..

Tijnema


On 3/7/07, Németh Zoltán <[EMAIL PROTECTED]> wrote:


2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
> I've just run into this problem this morning
>
> 
>
> This produces an "Error on Page" in IE 7, but works perfectly in Firefox
> and Netscape.
>
> I have several other javascript calls on the page where this call
> resides and all of them work perfectly except for this one. Does this
> error occur because I'm sending the variables to another script that
> does some logging then forwards the user to the URL or is it just a IE
> quirk?
>

I'm almost sure it has nothing to do with php
rather javascript, and maybe microsoft's special javascript
interpretations...

greets
Zoltán Németh

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php and javascript error

2007-03-07 Thread Németh Zoltán
2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
> I've just run into this problem this morning
> 
> 
> 
> This produces an "Error on Page" in IE 7, but works perfectly in Firefox 
> and Netscape.
> 
> I have several other javascript calls on the page where this call 
> resides and all of them work perfectly except for this one. Does this 
> error occur because I'm sending the variables to another script that 
> does some logging then forwards the user to the URL or is it just a IE 
> quirk?
> 

I'm almost sure it has nothing to do with php
rather javascript, and maybe microsoft's special javascript
interpretations...

greets
Zoltán Németh

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2005-04-13 Thread Richard Lynch
On Mon, April 11, 2005 5:04 pm, Marek Kilimajer said:
> Richard Lynch wrote:
>> On Mon, April 11, 2005 4:23 pm, Jared Williams said:
>>
>>>Hmm, document.forms['Selection'].elements['distID[]'][0].value is
>>>perfectly valid, and should work in any decent browser.
>>>
>>>There is also document.getElementsByName()
>>
>>
>> Didja try it?
>>
>> Cuz every time *I* ever tried it (back in Browser Wars 3.0/4.0 days,
>> mind
>> you) the JavaScript would see the [] as an array reference and *NOT* as
>> part of the name.
>
> That was a long time ago. Try it now.

No.

My clients are starving musicians who get their computers out of the
dumpsters after yours throw them away :-)

They're stuck with version 3/4 browsers by hardware limitations.

Maybe some day I'll even use CSS... Nah.  Too flaky even now.  I'll
probably be dead before they get that mess cleaned up.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript

2005-04-12 Thread Ford, Mike
> -Original Message-
> From: Richard Lynch
> To: Marek Kilimajer
> 
> On Sun, April 10, 2005 4:32 pm, Marek Kilimajer said:
> > Assuming your form is named "Selection", you will have a javascript
> > array document.forms['Selection'].elements['distID[]'] available. You
> > can try:
> >
> > alert(document.forms['Selection'].elements['distID[]'][0].value);
> 
> I can GUARANTEE this will *NOT* work.
> 
> You *CANNOT* use [] as part of a 'name' in JavaScript.

That's completely untrue -- I've done it many times with complete success.
The above can even be written more concisely as

  alert(document['Selection']['distID[]'][0].value);

Cheers!

Mike


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2005-04-11 Thread Marek Kilimajer
Richard Lynch wrote:
On Mon, April 11, 2005 4:23 pm, Jared Williams said:
Hmm, document.forms['Selection'].elements['distID[]'][0].value is
perfectly valid, and should work in any decent browser.
There is also document.getElementsByName()

Didja try it?
Cuz every time *I* ever tried it (back in Browser Wars 3.0/4.0 days, mind
you) the JavaScript would see the [] as an array reference and *NOT* as
part of the name.
That was a long time ago. Try it now.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] php and javascript

2005-04-11 Thread Richard Lynch
On Mon, April 11, 2005 4:23 pm, Jared Williams said:
> Hmm, document.forms['Selection'].elements['distID[]'][0].value is
> perfectly valid, and should work in any decent browser.
>
> There is also document.getElementsByName()

Didja try it?

Cuz every time *I* ever tried it (back in Browser Wars 3.0/4.0 days, mind
you) the JavaScript would see the [] as an array reference and *NOT* as
part of the name.

Didn't matter what I did to try to convince it otherwise.

YMMV

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php and javascript

2005-04-11 Thread Jared Williams

> On Sun, April 10, 2005 4:32 pm, Marek Kilimajer said:
> > Assuming your form is named "Selection", you will have a javascript 
> > array document.forms['Selection'].elements['distID[]'] 
> available. You 
> > can try:
> >
> > alert(document.forms['Selection'].elements['distID[]'][0].value);
> 
> I can GUARANTEE this will *NOT* work.
> 
> You *CANNOT* use [] as part of a 'name' in JavaScript.
> 
> No way, no how.
> 
> No matter how you quote it, embed it in a string, or try to 
> sneak up on it.
> 
> It ain't gonna work.
> 
> 'Cuz I tried every godamn reasonable (and quite a few 
> UN-resaonable) ways to do that.  *
> 

Hmm, document.forms['Selection'].elements['distID[]'][0].value is perfectly 
valid, and should work in any decent browser.

There is also document.getElementsByName() 

Jared

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2005-04-11 Thread Richard Lynch
On Sun, April 10, 2005 4:32 pm, Marek Kilimajer said:
> Assuming your form is named "Selection", you will have a javascript
> array document.forms['Selection'].elements['distID[]'] available. You
> can try:
>
> alert(document.forms['Selection'].elements['distID[]'][0].value);

I can GUARANTEE this will *NOT* work.

You *CANNOT* use [] as part of a 'name' in JavaScript.

No way, no how.

No matter how you quote it, embed it in a string, or try to sneak up on it.

It ain't gonna work.

'Cuz I tried every godamn reasonable (and quite a few UN-resaonable) ways
to do that.  *

You'll just have to "know" that elements[7] is the one that you want.

Or maybe use an ID="xxx" attribute that does NOT have [] in it.  But that
new-fangled ID attiribute was added long after I worried about this issue,
so you're on your own for that.

* In retrospect, you could probably write some kind of JavaScript function
that iterates through every single element, and compares its '.name' to
'distID' and to '3' (assuming you use distID[3] for a name) and then
return the one object you were looking for... But that would be horribly
inefficient JavaScript and would make your page dog-slow, so don't do
that.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2005-04-10 Thread Marek Kilimajer
PartyPosters wrote:
Hello, I have a form that when I hit sumbit I want to test the varialble in 
javascript. I can get it working using test variables in php but I want to be 
able to call the input box in my form, the only problem is the name of the box 
is in an array (i think) as it's in a list. You can see the 2 samples of the 
code below which will hopefully make more sence.
Can anyone help me out?
Thanks.


function checkdata() {
alert(document.Selection.quantity[0].value)
alert("TEST")
return true
}


---
while ($row=mysql_fetch_array($mysql_result))
{
echo "

";
}
Assuming your form is named "Selection", you will have a javascript 
array document.forms['Selection'].elements['distID[]'] available. You 
can try:

alert(document.forms['Selection'].elements['distID[]'][0].value);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php and javascript

2003-03-21 Thread John Nichel
For what code to work, the JavaScript?  In php, the only way you'll be 
able to get all the checkboxes that have been checked is to put the 
square brackets behind the name.  For it to work in JavaScript, you have 
to reference the element such as

document.forms[0].elements['list[]'][i].checked

or something along those linesmy JS is a bit rusty.

Shaun Thornburgh wrote:
John,

Thanks for your reply, but for the code to work the checkbox has to be
called 'list'
Shaun Thornburgh BSc Hons.
Assertia Ltd
-
Web : http://www.assertia.net
Email : [EMAIL PROTECTED]
Office : 0845 123 2992
Mobile : 07976 711363
-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: 21 March 2003 20:04
To: shaun
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] php and javascript

Put square brackets after the name of your checkboxes.

Home
Office
etc
Then you will be able to access all the boxes checked on your post page 
in an array

$_POST['list']

shaun wrote:

Hi,

I'm not sure if this is a PHP or a JavaScript question but I have
found the

following code to enable me to select all of the checkboxes on my
form.


<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
 for (i = 0; i < field.length; i++) {
 field[i].checked = true;}
 checkflag = "true";
 return "Uncheck all"; }
else {
 for (i = 0; i < field.length; i++) {
 field[i].checked = false; }
 checkflag = "false";
 return "Check all"; }
}
//  End -->



Where do you connect to the Internet from?
Home
Office
Friends' home
Post office
Internet Café



The problem is that in the example all of the boxes are called list
and i

need to name each checkbox on my form with a different user_id so that
i can

collect the data sent from the form, is there a way around this?

Thanks in advance for any advice offered.












--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php and javascript

2003-03-21 Thread John Nichel
Put square brackets after the name of your checkboxes.

Home
Office
etc
Then you will be able to access all the boxes checked on your post page 
in an array

$_POST['list']

shaun wrote:
Hi,

I'm not sure if this is a PHP or a JavaScript question but I have found the
following code to enable me to select all of the checkboxes on my form.





Where do you connect to the Internet from?
Home
Office
Friends' home
Post office
Internet Café



The problem is that in the example all of the boxes are called list and i
need to name each checkbox on my form with a different user_id so that i can
collect the data sent from the form, is there a way around this?
Thanks in advance for any advice offered.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php and javascript

2003-03-21 Thread Mike
Try radio buttons. You can't have lots of checkboxes like that. Or try
one of those lists that you can select multiple parts. I don't remember
what they're called.

On Fri, 2003-03-21 at 10:25, shaun wrote:
> Hi,
> 
> I'm not sure if this is a PHP or a JavaScript question but I have found the
> following code to enable me to select all of the checkboxes on my form.
> 
> 
> 
> 
> 
> 
> 
> Where do you connect to the Internet from?
> Home
> Office
> Friends' home
> Post office
> Internet Caf
> 
>  onClick="this.value=check(this.form.list)">
> 
> 
> The problem is that in the example all of the boxes are called list and i
> need to name each checkbox on my form with a different user_id so that i can
> collect the data sent from the form, is there a way around this?
> 
> Thanks in advance for any advice offered.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2003-03-19 Thread Antoine
thank you so much... I got the function working
On Tue, 2003-03-18 at 17:52, Jim Lucas wrote:
> you are trying to include a variable inside a single quoted string.
> 
> change the echo line to this.
> 
> echo "  window.location = '$thepage'>
> ";
> 
> Jim
> - Original Message -
> From: "Antoine" <[EMAIL PROTECTED]>
> To: "php list" <[EMAIL PROTECTED]>
> Sent: Tuesday, March 18, 2003 2:52 PM
> Subject: [PHP] php and javascript
> 
> 
> > I wrote a function to redirect my page to another one.   But for some
> > reason I keep getting an error.
> > here is the function I made
> >
> > function js_pointer_login($thepage)
> > {
> >  echo '  window.location = '$thepage'
> > ';
> > }
> >
> >
> > --
> > Antoine <[EMAIL PROTECTED]>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
-- 
Antoine <[EMAIL PROTECTED]>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2003-03-18 Thread -{ Rene Brehmer }-
On Tue, 18 Mar 2003 15:59:32 -0700, Kevin Stone wrote about "Re: [PHP] php
and javascript" what the universal translator turned into this:

>- Original Message -
>From: "Antoine" <[EMAIL PROTECTED]>
>To: "php list" <[EMAIL PROTECTED]>
>Sent: Tuesday, March 18, 2003 3:52 PM
>Subject: [PHP] php and javascript
>
>> I wrote a function to redirect my page to another one.   But for some
>> reason I keep getting an error.
>> here is the function I made
>>
>> function js_pointer_login($thepage)
>> {
>>  echo '  window.location = '$thepage'
>> ';
>> }
>> --
>> Antoine <[EMAIL PROTECTED]>
>
>Three fundemental flaws:
>1) single quotes in PHP denote a litteral string so $thepage will not be
>parsed
>2) the first single quote before $thepage will end the echo statement
>anything after that is a parse error
>3) the proper javascript syntax to redirect to a url within the active
>window is window.location.href="";

parent.location.href=""

works just as fine ... and it's also portable directly to frames
sub-files.

Oh, and in JavaScript the end-line ; markers aren't used ... they're
ignored mostly, but some older browsers caugh and spit at them ... JS
standard doesn't require them, but because they're used in Java and
JScript, the newer JIT compilers just ignore them...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2003-03-18 Thread Chris Hayes
At 23:52 18-3-2003, you wrote:
I wrote a function to redirect my page to another one.   But for some
reason I keep getting an error.
here is the function I made
function js_pointer_login($thepage)
{
 echo '  window.location = '$thepage'
';
}
beside the quote thing which others mentioned,  please make it as 
cross-browser-compatible as possible:
window.location.href=

and try to let $thepage be a complete url, including the http:// and the 
www.domain.org/ part. That will work in more browsers!



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php and javascript

2003-03-18 Thread Kevin Stone

- Original Message -
From: "Antoine" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 3:52 PM
Subject: [PHP] php and javascript


> I wrote a function to redirect my page to another one.   But for some
> reason I keep getting an error.
> here is the function I made
>
> function js_pointer_login($thepage)
> {
>  echo '  window.location = '$thepage'
> ';
> }
>
>
> --
> Antoine <[EMAIL PROTECTED]>

Three fundemental flaws:
1) single quotes in PHP denote a litteral string so $thepage will not be
parsed
2) the first single quote before $thepage will end the echo statement
anything after that is a parse error
3) the proper javascript syntax to redirect to a url within the active
window is window.location.href="";

- Kevin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript

2003-03-18 Thread Oscar F
It has to do with the fact that you're using single quotes, and
$thepage is not replaced for its value.
I think you'd want to rewrite the function like this (note the \ 
escaping the "):

function js_pointer_login($thepage)
{
  echo "  window.location = '$thepage'
";
}
Hope this Helps,
Oscar F.
Antoine wrote:
I wrote a function to redirect my page to another one.   But for some
reason I keep getting an error.  
here is the function I made

function js_pointer_login($thepage)
{
 echo '  window.location = '$thepage'
';
}



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php and javascript

2003-03-18 Thread Jim Lucas
you are trying to include a variable inside a single quoted string.

change the echo line to this.

echo "  window.location = '$thepage'>
";

Jim
- Original Message -
From: "Antoine" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 2:52 PM
Subject: [PHP] php and javascript


> I wrote a function to redirect my page to another one.   But for some
> reason I keep getting an error.
> here is the function I made
>
> function js_pointer_login($thepage)
> {
>  echo '  window.location = '$thepage'
> ';
> }
>
>
> --
> Antoine <[EMAIL PROTECTED]>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and JavaScript

2002-11-07 Thread Maxim Maletsky
onLoad is Javascript, and thus AFTER page was parsed.


--
Maxim Maletsky
[EMAIL PROTECTED]



"John Meyer" <[EMAIL PROTECTED]> wrote... :

> On a PHP event, does the onLoad event in a document run before or after the
> page is parsed, created, and sent to the user?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP and JavaScript

2002-11-07 Thread Ernest E Vogelsinger
At 17:24 07.11.2002, John Meyer spoke out and said:
[snip]
>On a PHP event, does the onLoad event in a document run before or after the
>page is parsed, created, and sent to the user?
[snip] 

Hmm - maybe I should a little elaborate on this topic, as it is very often
misunderstood.

Statement 1:

PHP runs at the server side, and Java/VB/Whateverscript at the client's.

Statement 2:

First, all server side applications are processed, generating output.
Second, the client parses data received from the server and displays it.

---

If you lean back and look at these two statements, it will be very clear
that the client doesn't know anything how data was constructed by the
server, and the server doesn't know what the client will do with the data
it is about to transmit.

The server builds the HTML code, including any JavaScript functions and
event handlers. These are just ordinary text to the server application; it
does nothing special with it.

The client (if JavaScript is enabled) will execute the onLoad() code as
soon as the _whole_page_ has been received AND rendered, at this time the
server has already forgotten about the request...

There cannot (CANNOT) be any interaction between client-side Javascript and
any server-side application. These two are effectively independent!

Hope this clears things up...


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] PHP and JavaScript

2002-11-07 Thread Marco Tabini
After--that's client-side stuff.


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide  magazine dedicated to PHP programmer

Come visit us at http://www.phparch.com!


--- Begin Message ---
On a PHP event, does the onLoad event in a document run before or after the
page is parsed, created, and sent to the user?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP and JavaScript on a validation NIGHTMARE

2002-10-01 Thread Riccardo Sepe

skitum wrote:

>Use globals variables instead hidden fields. Maybe it works.
>
>Peace & Love
>skitum
>
>  
>
Cool mate I' ll let u know!

bye


>  
>
>  
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP and JavaScript on a validation NIGHTMARE

2002-10-01 Thread skitum

Use globals variables instead hidden fields. Maybe it works.

Peace & Love
skitum

- Original Message - 
From: "Riccardo Sepe" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Tuesday, October 01, 2002 1:34 PM
Subject: [PHP] PHP and JavaScript on a validation NIGHTMARE


> Hi every1 I'm stucked with this page in which I would like to perform 
> some check before submit and in the meantime I need to be able to change 
> some content upon a choice at the top of the page.
> My first attempt was:
> The form has been submitted every time I change the option at the top of 
> the page ... PHP decides the content of the page..
> Javascript performs the checks and then submit the form.
> PHP has to recognise the status (I mean checked performed do the real 
> task) so I used an isset statement.
> The problem using "isset" is that PHP doesn't find the variable after 
> Javascript has performed its check
> If I use a hidden field then PHP doesn't understand when I'm asking to 
> change the content or actually sending the form for the real task.
> After this I said Javascript could manage the dinamically changing of 
> the content but I found out that Layer feature is not supported with 
> mozilla .
> Any clue ??
> 
> thanks a lot guys !
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP and JavaScript on a form validation task

2002-09-27 Thread Kevin Stone

Instead of check for $ready2be_checked, use a hidden form field instead of
relying on the submit button to be pressed.  If the Javascript auto-submits
the form the hidden field will still be there.
-Kevin

- Original Message -
From: "Riccardo Sepe" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Friday, September 27, 2002 2:19 PM
Subject: [PHP] PHP and JavaScript on a form validation task


> Hi every1 I'm buidin' up a form that should perform a couple of checks
> before submit.
> I used javascript but as the form has got option fields also and some
> field changes upon the checkbox chosen
> the script has to know when I'm just changing the option or when I'm
> tryin' 2 send the form...
> (in order to change the option or eventually perform the check).
> Can I do that on the same page? ..I mean can I pass a variable through
> javascript 2 php?
>
> The problem is that if I call the submit button "ready2be_checked" and I
> use an onclick(validate_the_form) handle,
>  javascript works fine but it misses the variable "ready2be_checked" so
> the "isset" statement for ex. if(isset($ready2be_checked)){ }
> doesn't work!
> Using onsubmit instead,
> javascript performs the check and sends the form anyway cause the isset
> check finds the variable  $ready2be_checked !!
> ? ? ? ? ? ? ?
>
> Sorry if I posted it twice
> Thanx in advance
>Ricky
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php and javascript question

2002-06-05 Thread Miguel Cruz

On Wed, 5 Jun 2002, Martin Clifford wrote:
> As far as I'm aware you can't create a javascript variable and use it
> within PHP on the same page.  You can add that variable's value to a
> hidden form element to be passed to the next page, but I don't think so
> with the same page.

You're quite right; the PHP executes and terminates before the JavaScript
ever starts.

If you want to get JavaScript-calculated values back into PHP, you have to 
pass them back through new requests to the server.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] php and javascript question

2002-06-05 Thread Scott Hurring

As someone else suggested a few days ago: try using an IFRAME,
and refreshing it from javascript with the values you need.

The whole browser will not refresh, just the IFRAME, which
will give the illusion of jscript and php talking to each
other in realtime.

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -Original Message-
> From: Martin Clifford [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 4:24 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] php and javascript question
> 
> 
> As far as I'm aware you can't create a javascript variable 
> and use it within PHP on the same page.  You can add that 
> variable's value to a hidden form element to be passed to the 
> next page, but I don't think so with the same page.
> 
> martin
> 
> >>> "kemu" <[EMAIL PROTECTED]> 06/05/02 02:30PM >>>
> I have a page first he generates a var in javascript
> my next question is
> is it possible to use that var in php on the same page
> first he does the javascript then the php ?
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php and javascript question

2002-06-05 Thread Martin Clifford

As far as I'm aware you can't create a javascript variable and use it within PHP on 
the same page.  You can add that variable's value to a hidden form element to be 
passed to the next page, but I don't think so with the same page.

martin

>>> "kemu" <[EMAIL PROTECTED]> 06/05/02 02:30PM >>>
I have a page first he generates a var in javascript
my next question is
is it possible to use that var in php on the same page
first he does the javascript then the php ?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP and JavaScript

2002-05-26 Thread Mark

On Sun, 26 May 2002 10:05:03 +0300, mp wrote:
>Hi, php-general,
>
>I make this kind of PHP script(script.php):
>script.php
>$variable = "Some some long long Text Blah blah";
>echo "document.write(\"".$variable."\")";
>?>
>
>And in HTML (other.html) file I write:
>
>
>But there is some mistake. Does anybody can help me?
>Thanks...
>
>

make sure $variable doesn't have any newlines.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP and JavaScript

2002-05-26 Thread SP

It worked for me, what error are you getting?

In the other.html, did you have this?











-Original Message-
From: mp [mailto:[EMAIL PROTECTED]]
Sent: May 26, 2002 3:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP and JavaScript


Hi, php-general,

 I make this kind of PHP script(script.php):
 script.php
 

 And in HTML (other.html) file I write:
 

 But there is some mistake. Does anybody can help
me?
 Thanks...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php and javascript

2002-03-25 Thread Dennis Moore

Your popup window should be an normal PHP page calling your images in the
database.   You can then setup your form to call the popup windows via
javascript using the window.open() method.

/dkm



- Original Message -
From: "Scott" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 25, 2002 6:13 PM
Subject: [PHP] php and javascript


> I have some image urls that I have stored in a mysql database.  I want to
be
> able to display the images in a popup window using javascript.  But I
haven't
> been able to figure out how to get the get the info to mysql so that the
> image loads when the popup window appears.  Below is an example of the
form
> without any javascript.
>
> 
> 
> ">
> 
>
> Any help appreciated.
> Thanks,
> SW
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php and javascript

2001-07-27 Thread Sheridan Saint-Michel

I am not sure exactly what you are doing, but the thing
to remember is that your PHP script is writing your HTML
and JavaScript.  As long as you keep that in mind it is
fairly easy to see how to pass variables to JS.

Here is a very simple example





var foo = "";
document.writeln(foo);




If you need something more specific post some code.

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


- Original Message -
From: Karl Phillipson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 27, 2001 6:08 AM
Subject: [PHP] php and javascript


>
> Does anyone know how to pass php variables to a javascript for processing.
>
> I have a DHTML menu system that requires variables be attached to the url
> contained within it. Using echo does not print the variable to the url.
>
> Is there another way?
>
> Thx in advance.
>
> Karl
> ==
> Karl Phillipson
> PHP SQL Programmer
>
> Saffron Hill Ventures
> 67 Clerkenwell Road
> London
> EC1R 5BL
> ==
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and javascript

2001-07-27 Thread Daniel Rezny

Hello Karl,

Friday, July 27, 2001, 1:08:05 PM, you wrote:


KP> Does anyone know how to pass php variables to a javascript for processing.

KP> I have a DHTML menu system that requires variables be attached to the url
KP> contained within it. Using echo does not print the variable to the url.

KP> Is there another way?

KP> Thx in advance.


varname='';

some usage of varname;



I had a same problem some time ago. There must be a single quotes
neither is it string nor any other type.

I hope it helps

-- 
Best regards,
 Danielmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and javascript

2001-07-27 Thread Vitali Falileev

Hello Karl,

Publish your code, plz. We are not wizards. :)

27 July, 2001, 14:08:05, you wrote:

KP> Does anyone know how to pass php variables to a javascript for processing.

KP> I have a DHTML menu system that requires variables be attached to the url
KP> contained within it. Using echo does not print the variable to the url.

KP> Is there another way?


-- 
Best regards,
 Vitalimailto:[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php and javascript

2001-03-02 Thread John Ashton

Well not sure what ya need an example of :)
php is php and javascript is javascript.  

What excatly do you need help wiht ?

> -Original Message-
> From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
> Sent: March 2, 2001 5:34 AM
> To: Php-General@Lists. Php. Net
> Subject: Re: [PHP] php and javascript
> 
> 
> On Friday 02 March 2001 06:21, you wrote:
> > Hello,
> >
> > Are there any good examples of producing embedded javascript code in a
> > php file?
> 
>somecode
> ?>
> 
>   sglfjh s
> 
>more code
> ?>
> 
> -- 
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
> 
> The use of COBOL cripples the mind; its teaching should, therefore,
> be regarded as a criminal offence.
> 
> - Edsger W. Dijkstra
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and javascript

2001-03-02 Thread Christian Reiniger

On Friday 02 March 2001 06:21, you wrote:
> Hello,
>
> Are there any good examples of producing embedded javascript code in a
> php file?



  sglfjh s



-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

The use of COBOL cripples the mind; its teaching should, therefore,
be regarded as a criminal offence.

- Edsger W. Dijkstra

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and javascript

2001-02-20 Thread Ankur Verma

try

";
$summary = "Hellow universe";
print " ";
print "";
print "";
?>

hope that helps

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "Carl Natale" <[EMAIL PROTECTED]>
To: "Php" <[EMAIL PROTECTED]>
Sent: Wednesday, February 21, 2001 7:41 AM
Subject: [PHP] php and javascript


> I need some help passing a variable to a popup window. The following form
> collects input from the user and stores it in the variable $summary.
>
>  print "";
> $summary = "Hellow universe";
> print " ";
> print " onClick=\"window.open('hint.php', 'remote',
> 'menubar,scrollbars,resizable,width=350,height=200,left=20,top=20');
> return false;\">";
> print "";
> ?>
>
> When you click on the "Try This" button, hint.php opens up in another,
> smaller window just like I wanted. But the variable $summary doesn't show
> up
>
>  file://hint.php script says this
>
> file://THIS LINE PRINTS
> print "Here's the hint:";
> file://BUT NOT THIS ONE
> print $summary;
> ?>
>
> If I take JavaScript out of the submit coding, the browser window moves
> to hint.php and prints the $summary variable.
>
> I'm much more comfortable with PHP than JavaScript. How can I deliver the
> text in $summary to a second, smaller window?
>
> Thank you.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and javascript

2001-02-20 Thread Simon Garner

From: "Carl Natale" <[EMAIL PROTECTED]>

> I need some help passing a variable to a popup window. The following form
> collects input from the user and stores it in the variable $summary.
>
>  print "";
> $summary = "Hellow universe";
> print " ";
> print " onClick=\"window.open('hint.php', 'remote',
> 'menubar,scrollbars,resizable,width=350,height=200,left=20,top=20');
> return false;\">";
> print "";
> ?>


Try:

window.open('hint.php?summary=" . urlencode($summary) . "', )

Realise that the pop-up window is a totally separate document, from the web
server's point of view, hence hint.php cannot magically get the value of
$summary from the form page.




>
> When you click on the "Try This" button, hint.php opens up in another,
> smaller window just like I wanted. But the variable $summary doesn't show
> up
>
>  file://hint.php script says this
>
> file://THIS LINE PRINTS
> print "Here's the hint:";
> file://BUT NOT THIS ONE
> print $summary;
> ?>
>
> If I take JavaScript out of the submit coding, the browser window moves
> to hint.php and prints the $summary variable.
>
> I'm much more comfortable with PHP than JavaScript. How can I deliver the
> text in $summary to a second, smaller window?
>
> Thank you.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]