[PHP] PHP/Javascript Job in Madrid

2009-06-03 Thread barbara

Hi all,
I am Bárbara Vilela and I work at Tuenti in the Human Resources 
department in Madrid. Tuenti is a social application and our mission is 
to improve the communication and transmission of information between 
people who know each other. Already the #6 most-trafficked website in 
Spain, Tuenti is also one of the fastest-growing Alexa Top 500 sites and 
one of the largest invite-only websites worldwide.
I am writing you because we have job opportunities for PHP/JavaScript 
Engineers that could be interesting for you.

You can find more information about this position here:
http://tbe.taleo.net/NA11/ats/careers/requisition.jsp?org=TUENTITECHNOLOGIES&cws=1&rid=25 

If you think you fit for this job please send me an e-mail with your CV 
and I´ll get in contact with you soon.

Thank you very much,
Bárbara Vilela Fernandes


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



Re: [PHP] PHP Javascript header

2009-01-15 Thread Shawn McKenzie
Applejus wrote:
> Hello there,
> 
> Kind of newbie to PHP and javascript... I have this problem:
> 
> I want to pass a javascript variable to a PHP code.
> I am inside a javascript function that is creating HTML elements
> dynamically. After creating a  tag, I want to populate it with a
> list of variable names from $_SESSION['subgroupcolumn'] .
> Here is part of the code:
> 
> .
> .
> .
> location.href="subgroup.php?m=" + m;
> var linner= "for ($c=1; $c < $_SESSION['rows']; $c++){ echo( ' value=' . $c . '>' . $_SESSION['subgroupcolumn'][$c][0] . '\n' );
> }" ;
> document.getElementById(selectedSubsetText + hitcounter).innerHTML = linner
> ;
> .
> .
> .
> Since we cannot pass a javascript var to PHP directly, I am redirecting to
> subgroup.php and sending the variable ("m") and getting it there using a
> $_GET. Now the question: 
> In subgroup.php, after I get the variable m, I create the
> $_SESSION['subgroupcolumn'] array then I redirect to the initial page.
> Obviously it's not working because the code after
> location.href="subgroup.php?m=" + m; is not executing after coming back to
> the initial page
> 
> How do I make it to continue executing the javascript code?
> 
> I hope it's clear...
> 
> Thanks for your help.
> 
> 

The problem is that you are changing the location of the page and then
chaning the location back.  Really you need an AJAX call using
XMLHttpRequest.  There are probably easier examples, but here is one:

http://www.w3schools.com/PHP/php_ajax_suggest.asp

-- 
Thanks!
-Shawn
http://www.spidean.com

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



[PHP] PHP Javascript header

2009-01-15 Thread Applejus

Hello there,

Kind of newbie to PHP and javascript... I have this problem:

I want to pass a javascript variable to a PHP code.
I am inside a javascript function that is creating HTML elements
dynamically. After creating a  tag, I want to populate it with a
list of variable names from $_SESSION['subgroupcolumn'] .
Here is part of the code:

.
.
.
location.href="subgroup.php?m=" + m;
var linner= "for ($c=1; $c < $_SESSION['rows']; $c++){ echo( '' . $_SESSION['subgroupcolumn'][$c][0] . '\n' );
}" ;
document.getElementById(selectedSubsetText + hitcounter).innerHTML = linner
;
.
.
.
Since we cannot pass a javascript var to PHP directly, I am redirecting to
subgroup.php and sending the variable ("m") and getting it there using a
$_GET. Now the question: 
In subgroup.php, after I get the variable m, I create the
$_SESSION['subgroupcolumn'] array then I redirect to the initial page.
Obviously it's not working because the code after
location.href="subgroup.php?m=" + m; is not executing after coming back to
the initial page

How do I make it to continue executing the javascript code?

I hope it's clear...

Thanks for your help.


-- 
View this message in context: 
http://www.nabble.com/PHP-Javascript-header-tp21483721p21483721.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 & javascript interaction

2007-01-27 Thread Jochem Maas
William Stokes wrote:
> Hello,
> 
> I need some advice on how to learn Javascript and PHP interaction. Any good 
> tutorials on the web would be most welcome. I particulary need to learn how 
> to pass JS user input/choices to PHP.
> 
> My current problem is how to ask user confirmation over his actions on a web 
> form after POST. "Are you sure" type questions and how to pass the user 
> choice back to program make choices with PHP.

http://php.net/json
http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

^^-- note the name! toys.lerdorf.com is a veritable goldmine of
funky info, lots of php magic to be had there.


> 
> Thanks
> -Will
> 

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



Re: [PHP] php & javascript interaction

2007-01-26 Thread Scripter47

Myron Turner skrev:

William Stokes wrote:

Hello,

I need some advice on how to learn Javascript and PHP interaction. Any 
good tutorials on the web would be most welcome. I particulary need to 
learn how to pass JS user input/choices to PHP.


My current problem is how to ask user confirmation over his actions on 
a web form after POST. "Are you sure" type questions and how to pass 
the user choice back to program make choices with PHP.


Thanks
-Will

  
For the second question try google with something like "javascript form 
submit".


For the first question, see:
http://ca.php.net/manual/en/language.variables.predefined.php
Form data is captured in PHP in a number of different predefined 
variables accessible from your scripts.  This page defines these 
varibables.



Use AJAX

Link: http://javascript.internet.com/ajax/ajax-navigation.html

is migth be what you are looking for:
http://javascript.internet.com/ajax/check-username-signup.html


The cool thing with AJAX is that it can load pages while viewing the 
webpage. Without updating it!


check out this chat i made with it:
http://wsd.riddergarn.dk/index.php?p=chat

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



Re: [PHP] php & javascript interaction

2007-01-26 Thread Myron Turner

William Stokes wrote:

Hello,

I need some advice on how to learn Javascript and PHP interaction. Any good 
tutorials on the web would be most welcome. I particulary need to learn how 
to pass JS user input/choices to PHP.


My current problem is how to ask user confirmation over his actions on a web 
form after POST. "Are you sure" type questions and how to pass the user 
choice back to program make choices with PHP.


Thanks
-Will

  
For the second question try google with something like "javascript form 
submit".


For the first question, see:
http://ca.php.net/manual/en/language.variables.predefined.php
Form data is captured in PHP in a number of different predefined 
variables accessible from your scripts.  This page defines these varibables.


--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



[PHP] php & javascript interaction

2007-01-26 Thread William Stokes
Hello,

I need some advice on how to learn Javascript and PHP interaction. Any good 
tutorials on the web would be most welcome. I particulary need to learn how 
to pass JS user input/choices to PHP.

My current problem is how to ask user confirmation over his actions on a web 
form after POST. "Are you sure" type questions and how to pass the user 
choice back to program make choices with PHP.

Thanks
-Will

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



Re: [PHP] PHP, Javascript, and Forms

2006-05-30 Thread tedd
At 10:03 PM -0400 5/30/06, Beauford wrote:
>Hi,
>
>I have a form with about 20 fields in it and have two drop down menus in
>which the second one changes depending on the previous one. This is done
>with a javascript which reloads the page.
>
>The problem with this is that everything the user has put in so far gets
>erased when the page reloads. I am using PHP sessions, but at this point
>these fields are not saved yet.
>
>Is there a way to do this using sessions, or some other PHP function. All
>the javascript I've looked at reloads the page.
>
>This also screws up my validation routines.
>
>Thanks
>
>B

B:

Use ajax to populate the php session variables.

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, Javascript, and Forms

2006-05-30 Thread David Tulloh
Beauford wrote:
> Hi,
> 
> I have a form with about 20 fields in it and have two drop down menus in
> which the second one changes depending on the previous one. This is done
> with a javascript which reloads the page.
> 
> The problem with this is that everything the user has put in so far gets
> erased when the page reloads. I am using PHP sessions, but at this point
> these fields are not saved yet.
> 
> Is there a way to do this using sessions, or some other PHP function. All
> the javascript I've looked at reloads the page.
> 

Javascript can do this easily, you set up your variable content section
in a div.  Then use div.innerHTML = newcontent.  Only the content of the
div will change.

Searching for innerHTML should give you a few tutorials and full examples.


David

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



Re: [PHP] PHP, Javascript, and Forms

2006-05-30 Thread Minuk Choi
I think a better way for you to go(it may be a little bit more 
difficult, but it won't have any annoying "flickering" from the 
reloading of page) is to use AJAX.


But if you insist on going on a PHP form + Javascript validation -> 
submit form ->PHP form + Javascript validation, that can be done as well.


It might help to put up a sniplet of your PHP code.  When you say the 
page is reloading, I assume that you mean you have a form tag that sends 
the POST data back to itself?



Beauford wrote:


Hi,

I have a form with about 20 fields in it and have two drop down menus in
which the second one changes depending on the previous one. This is done
with a javascript which reloads the page.

The problem with this is that everything the user has put in so far gets
erased when the page reloads. I am using PHP sessions, but at this point
these fields are not saved yet.

Is there a way to do this using sessions, or some other PHP function. All
the javascript I've looked at reloads the page.

This also screws up my validation routines.

Thanks

B

 



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



[PHP] PHP, Javascript, and Forms

2006-05-30 Thread Beauford
Hi,

I have a form with about 20 fields in it and have two drop down menus in
which the second one changes depending on the previous one. This is done
with a javascript which reloads the page.

The problem with this is that everything the user has put in so far gets
erased when the page reloads. I am using PHP sessions, but at this point
these fields are not saved yet.

Is there a way to do this using sessions, or some other PHP function. All
the javascript I've looked at reloads the page.

This also screws up my validation routines.

Thanks

B

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread jekillen


On May 19, 2006, at 8:20 AM, Jay Blanchard wrote:


[snip]
http://us2.php.net/variables.external
[/snip]

BINGO! We have a winner!

It can be as simple as adding an id to each checkbox;



By doing this I did not have to change the function or the function
calls. JS recognizes the boxes by id, PHP recognizes the array.

There were some other more complex solutions listed.but I believe 
in

KISS

I'm one of 'em, I do javascript programming myself and finding the right
simplicity can be one hell of a task. I'll keep this in mind for the 
future.


I'm thinking of starting a web site database for posting of any and all
who are willing to contribute to a single source for all bugs, levels of
javascript DOM and css support in all or as many as possible extant
browsers. Quirks, you name it. It will be if you have knowledge and 
solutions

and want to contribute. It won't be a gripe and hold my hand and
listen to my woes, but look for a subject like a particular browser and
version, OS, platform and get a knowledge base for that query.

Here's one to start:
Internet Explorer v5 on Mac OSX and others won't run a function
with a variable declared inside the function. The variable has to
be declared outside of the function in the global space before
it will be used inside a function. This occurs with form submission
from an onclick event, rather than a submit button. I do this to
insure that input filters are run before the form is sent to the server.
The functions I write for this do pre submit processing like run
regex filters on text fields  and text areas and use document.forms
formname.submit(). In a particular class of browser, but not all 
versions

of the same browser nor platform will run the function with variables
declared inside the function.
I don't think this is 'OT' for this list because for me php and 
javascript

are great team mates. But javascript can be a rats nest particularly
for dhtml.
I have some demonstrations in my web site but I'm being timid about
giving out the url until it has time to prove it will stay afloat 
before a crowd

tries to use it. (I host my own site from an ADSL connection).
I'm running php 5.0.1 with gd support, freetype, t1, mysql, etc, etc.
on FreeBSD.
JK.


--
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 & JavaScript

2006-05-19 Thread Scott Hurring

Yeah, i guess it all depends what you're doing what works for you.

Another avenue to try (depending on your application) is:
Group all your checkboxes together inside of a uniquely-named DIV and then
use javascript to get all of the "checkbox" elements inside the DIV.  That
way, you dont really need to know or care about their id/name.

On 5/19/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:


[snip]
For grouped checkboxes that have numerical keys, why not give them an ID
that's simply a concatenation of NAME and the VALUE, so it's unique?
[/snip]

Because JavaScript loops through all the like ID'ed checkboxes to check
or uncheck groups. It could be done the other way, but then JavaScript
code has to have more to it to increment from the value of the first ID.

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





--
Scott Hurring [scott dot hurring dot lists at gmail dot com]
http://hurring.com/


RE: [PHP] PHP & JavaScript

2006-05-19 Thread Jay Blanchard
[snip]
For grouped checkboxes that have numerical keys, why not give them an ID
that's simply a concatenation of NAME and the VALUE, so it's unique?
[/snip]

Because JavaScript loops through all the like ID'ed checkboxes to check
or uncheck groups. It could be done the other way, but then JavaScript
code has to have more to it to increment from the value of the first ID.

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread Scott Hurring

For grouped checkboxes that have numerical keys, why not give them an ID
that's simply a concatenation of NAME and the VALUE, so it's unique?

Run the NAME though a preg_replace to replace non alphanum chars (\W+) with
an underscore first to make sure it's a valid ID.

i.e.




I've used this with some code i wrote that allows me to either output a
multi-select or a group of checkboxes, from a single array of values.

On 5/19/06, Richard Lynch <[EMAIL PROTECTED]> wrote:


Simplest solution is to use id="whatever" for JS.

It *is* possible to get [] into the name of a box in JS, but I never
succeeded in any useful way myself.

On Fri, May 19, 2006 9:33 am, Jay Blanchard wrote:
> Can they play nicely together?
>
> For instance I have a small JavaScript sniplet that will check certain
> checkboxes if a radio button is selected. Since I have a fair amount
> of
> checkboxes I want to put them in an array all their own so I use the
> XHTML syntax w/brackets;
>
> 
>
> Suddenly JavaScript doesn't care for the object and throws an error
> (take the brackets out and it works fine for JS, but PHP cannot see
> all
> of the values). I have Googled for this but think that my search
> term(s)
> are failing me because the condition is hard to describe.  Would
> someone
> please point me in the right direction?
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
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





--
Scott Hurring [scott dot hurring dot lists at gmail dot com]
http://hurring.com/


Re: [PHP] PHP & JavaScript

2006-05-19 Thread Richard Lynch
Simplest solution is to use id="whatever" for JS.

It *is* possible to get [] into the name of a box in JS, but I never
succeeded in any useful way myself.

On Fri, May 19, 2006 9:33 am, Jay Blanchard wrote:
> Can they play nicely together?
>
> For instance I have a small JavaScript sniplet that will check certain
> checkboxes if a radio button is selected. Since I have a fair amount
> of
> checkboxes I want to put them in an array all their own so I use the
> XHTML syntax w/brackets;
>
> 
>
> Suddenly JavaScript doesn't care for the object and throws an error
> (take the brackets out and it works fine for JS, but PHP cannot see
> all
> of the values). I have Googled for this but think that my search
> term(s)
> are failing me because the condition is hard to describe.  Would
> someone
> please point me in the right direction?
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
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 & JavaScript

2006-05-19 Thread Jef Sullivan
I use document.getElementById().value.
The only change that would need to be made with the input example is add
an id="list['.$x.']"



Jef

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 19, 2006 8:47 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP & JavaScript

Jay Blanchard wrote:
> Can they play nicely together?
> 
> For instance I have a small JavaScript sniplet that will check certain
> checkboxes if a radio button is selected. Since I have a fair amount of
> checkboxes I want to put them in an array all their own so I use the
> XHTML syntax w/brackets;
> 
> 
> 
> Suddenly JavaScript doesn't care for the object and throws an error
> (take the brackets out and it works fine for JS, but PHP cannot see all
> of the values). I have Googled for this but think that my search term(s)
> are failing me because the condition is hard to describe.  Would someone
> please point me in the right direction?
> 
> Thanks!
> 

I don't remember exactaly what I had to do, but I remember quoting it 
somehow made it work with JS.  Something like...

document.formname.elements['list37[]']

I *think*.

-- 
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[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 & JavaScript

2006-05-19 Thread Jay Blanchard
[snip]
So, using the same ID produces non-valid documents if you ask me.
[/snip]

This is correct, and in order to properly validate I changed it to
transitional instead of strict. This is an internal appif it were
external I would do this differently for sure

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread php
Dave Goodchild wrote:
> I think it's a case of using id for javascript, not for css...

Call me a purist, but quoting http://www.w3.org/TR/xhtml1/ (and you
can probably find likewise paragraphs in other xhtml specs, all
stemming from the basic XML property that id's are unique):

"4.10. The elements with 'id' and 'name' attributes

HTML 4 defined the name attribute for the elements a, applet, form,
frame, iframe, img, and map. HTML 4 also introduced the id
attribute. Both of these attributes are designed to be used as
fragment identifiers.

In XML, fragment identifiers are of type ID, and there can only be a
single attribute of type ID per element. Therefore, in XHTML 1.0 the
id attribute is defined to be of type ID. In order to ensure that
XHTML 1.0 documents are well-structured XML documents, XHTML 1.0
documents MUST use the id attribute when defining fragment
identifiers on the elements listed above. See the HTML Compatibility
Guidelines for information on ensuring such anchors are backward
compatible when serving XHTML documents as media type text/html.

Note that in XHTML 1.0, the name attribute of these elements is
formally deprecated, and will be removed in a subsequent version of
XHTML."

So, using the same ID produces non-valid documents if you ask me.

Best,

Koen

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread John Nichel

Jay Blanchard wrote:

[snip]
http://us2.php.net/variables.external
[/snip]

BINGO! We have a winner!

It can be as simple as adding an id to each checkbox;



By doing this I did not have to change the function or the function
calls. JS recognizes the boxes by id, PHP recognizes the array.

There were some other more complex solutions listed.but I believe in
KISS



Next time, RTFM!  :-p

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread Dave Goodchild

I think it's a case of using id for javascript, not for css...








--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] PHP & JavaScript

2006-05-19 Thread php
Jay Blanchard wrote:
> [snip]
> http://us2.php.net/variables.external
> [/snip]
> 
> BINGO! We have a winner!
> 
> It can be as simple as adding an id to each checkbox;
> 
> 
> 
> By doing this I did not have to change the function or the function
> calls. JS recognizes the boxes by id, PHP recognizes the array.
> 
> There were some other more complex solutions listed.but I believe in
> KISS
> 

Shouldn't ID's on xhtml tags be unique? Or is this special because
of the array construction?

Gr,

Koen

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread Jochem Maas

John Nichel wrote:

Jay Blanchard wrote:


Can they play nicely together?

For instance I have a small JavaScript sniplet that will check certain
checkboxes if a radio button is selected. Since I have a fair amount of
checkboxes I want to put them in an array all their own so I use the
XHTML syntax w/brackets;



Suddenly JavaScript doesn't care for the object and throws an error
(take the brackets out and it works fine for JS, but PHP cannot see all
of the values). I have Googled for this but think that my search term(s)
are failing me because the condition is hard to describe.  Would someone
please point me in the right direction?

Thanks!



I don't remember exactaly what I had to do, but I remember quoting it 
somehow made it work with JS.  Something like...


document.formname.elements['list37[]']

I *think*.


I think you think right = pretty sure about that actually :-)






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



RE: [PHP] PHP & JavaScript

2006-05-19 Thread Jay Blanchard
[snip]
http://us2.php.net/variables.external
[/snip]

BINGO! We have a winner!

It can be as simple as adding an id to each checkbox;



By doing this I did not have to change the function or the function
calls. JS recognizes the boxes by id, PHP recognizes the array.

There were some other more complex solutions listed.but I believe in
KISS

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



RE: [PHP] PHP & JavaScript

2006-05-19 Thread Kristen G. Thorson
> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 19, 2006 10:34 AM
> To: php-general@lists.php.net
> Subject: [PHP] PHP & JavaScript


 
> 
> 
> Suddenly JavaScript doesn't care for the object and throws an error
> (take the brackets out and it works fine for JS, but PHP cannot see
all
> of the values). I have Googled for this but think that my search
term(s)
> are failing me because the condition is hard to describe.  Would
someone
> please point me in the right direction?


I ran into this problem once too and had a terrible time finding an
answer.  I started finding some stuff with the following search terms:

php checkbox array javascript entity reference

Which brought up a page in the manual.  It had two helpful notes:

http://us2.php.net/variables.external



kgt

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



Re: [PHP] PHP & JavaScript

2006-05-19 Thread John Nichel

Jay Blanchard wrote:

Can they play nicely together?

For instance I have a small JavaScript sniplet that will check certain
checkboxes if a radio button is selected. Since I have a fair amount of
checkboxes I want to put them in an array all their own so I use the
XHTML syntax w/brackets;



Suddenly JavaScript doesn't care for the object and throws an error
(take the brackets out and it works fine for JS, but PHP cannot see all
of the values). I have Googled for this but think that my search term(s)
are failing me because the condition is hard to describe.  Would someone
please point me in the right direction?

Thanks!



I don't remember exactaly what I had to do, but I remember quoting it 
somehow made it work with JS.  Something like...


document.formname.elements['list37[]']

I *think*.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] PHP & JavaScript

2006-05-19 Thread Jay Blanchard
Can they play nicely together?

For instance I have a small JavaScript sniplet that will check certain
checkboxes if a radio button is selected. Since I have a fair amount of
checkboxes I want to put them in an array all their own so I use the
XHTML syntax w/brackets;



Suddenly JavaScript doesn't care for the object and throws an error
(take the brackets out and it works fine for JS, but PHP cannot see all
of the values). I have Googled for this but think that my search term(s)
are failing me because the condition is hard to describe.  Would someone
please point me in the right direction?

Thanks!

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



Re: [PHP] PHP / JavaScript integration

2005-03-09 Thread Richard Lynch

> Hi,
>
> I'm trying to integrate some JavaScript functions in PHP, but so far, no
> good :(
>
> I want to have a js.php file that has the JavaScript functions i want to
> use. This file, albeit its extension, has no PHP code or even tag.
>
> It's just like this:
>
> js.php
> --
> 
>
> function def(word) {
>  if (word == 'all_not_filled') {
>  type = 'error1';
>  definition = 'You didn't filled all form fields.';
>  }
> myFloater =
> window.open(filename,'myWindow','scrollbars=no,status=no,width=300,height=200')
> }
>
> 
> --
>
> Now... i want to call this JavaScript function from the regular PHP files.
> In particular, before the HTML code.
> Like this:
>
> index.php
> --
>
> 
>   if (condition)
>def('all_not_filled') // def is a JS function in js.php

You can't do that.

You could do this:


Then, when the page gets sent to the browser, the def() function gets
called by the browser.

PHP runs on your server.

JavaScript is run by the browser, on the web surfer's computer, millions
of miles away, and long after PHP has finished its work and gone away.

-- 
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



[Fwd: Re: [PHP] PHP / JavaScript integration]

2005-03-09 Thread Jochem Maas
this post was meant for the OP - I sent it to Chris W. (only) by mistake.
oops
 Original Message 
From: - Wed Mar 09 19:50:29 2005
Chris W. Parker wrote:
Mário Gamito 
on Tuesday, March 08, 2005 4:28 PM said:

I'm trying to integrate some JavaScript functions in PHP, but so far,
no good :(

[snip]

Now... i want to call this JavaScript function from the regular PHP
files. In particular, before the HTML code.
Like this:

[snip]

How can i do this ?
How to tell PHP, that def(word) is a JS function in js.php file ?
I've tried include ('js.php'), etc., but got no results :(
include ('js.php') will output the contents of that file to the browser,
assuming include() actually finds the file.

You don't and you can't. PHP does not interact with the client (like you are thinking it does) and 
Javascript does not interact with the server. They are completely different and not related, except 
that PHP can send Javascript to the client for the client to interpret.
javascript is a scripting language, there is no theoretical reason that it 
can't be used as a serverside
scripting language, but the fact that practically nobody in the real does says 
something :-). anyway
its not strictly correct to say javascript is 'clientside'.
as for calling a javascript function directly from php code, forget about it.
It's a bit confusing at first but once you understand it, you'll wonder why it ever didn't make sense.
1 round trip:
1. a (php) webserver gets a request for a page.
2. the server runs the requested (php) script.
3. the server sending some output to the browser.
4. the browser interprets the output.
the output is generally a webpage - this can include

RE: [PHP] PHP / JavaScript integration

2005-03-08 Thread Chris W. Parker
Mário Gamito 
on Tuesday, March 08, 2005 4:28 PM said:

> I'm trying to integrate some JavaScript functions in PHP, but so far,
> no good :(

[snip]

> Now... i want to call this JavaScript function from the regular PHP
> files. In particular, before the HTML code.
> Like this:

[snip]

> How can i do this ?
> How to tell PHP, that def(word) is a JS function in js.php file ?
> I've tried include ('js.php'), etc., but got no results :(

You don't and you can't. PHP does not interact with the client (like you are 
thinking it does) and Javascript does not interact with the server. They are 
completely different and not related, except that PHP can send Javascript to 
the client for the client to interpret.

It's a bit confusing at first but once you understand it, you'll wonder why it 
ever didn't make sense.



Chris.

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



Re: [PHP] PHP / JavaScript integration

2005-03-08 Thread Gabe Guzman
On Wed, Mar 09, 2005 at 12:27:39AM +, M?rio Gamito wrote:
> Hi,
> 
> I'm trying to integrate some JavaScript functions in PHP, but so far, no 
> good :(
> 
> I want to have a js.php file that has the JavaScript functions i want to 
> use. This file, albeit its extension, has no PHP code or even tag.
> 
> It's just like this:
> 
> js.php
> --
> 
> 
> function def(word) {
> if (word == 'all_not_filled') {
> type = 'error1';
> definition = 'You didn't filled all form fields.';
> }
> myFloater = 
> window.open(filename,'myWindow','scrollbars=no,status=no,width=300,height=200')
> }
> 
> 
> --
> 
> Now... i want to call this JavaScript function from the regular PHP files.
> In particular, before the HTML code.
> Like this:
> 
> index.php
> --
> 
>  
>  if (condition)
>   def('all_not_filled') // def is a JS function in js.php
> 
> ?>
> 
> 
>  
> 
> (...)
> 
> 
> --
> 
> How can i do this ?
> How to tell PHP, that def(word) is a JS function in js.php file ?
> I've tried include ('js.php'), etc., but got no results :(

why not use a script include instead of a php one?  ie: 


[PHP] PHP / JavaScript integration

2005-03-08 Thread Mário Gamito
Hi,
I'm trying to integrate some JavaScript functions in PHP, but so far, no 
good :(

I want to have a js.php file that has the JavaScript functions i want to 
use. This file, albeit its extension, has no PHP code or even tag.

It's just like this:
js.php
--

function def(word) {
if (word == 'all_not_filled') {
type = 'error1';
definition = 'You didn't filled all form fields.';
}
myFloater = window.open(filename,'myWindow','scrollbars=no,status=no,width=300,height=200')
}


--
Now... i want to call this JavaScript function from the regular PHP files.
In particular, before the HTML code.
Like this:
index.php
--

 if (condition)
  def('all_not_filled') // def is a JS function in js.php
?>

 
(...)

--
How can i do this ?
How to tell PHP, that def(word) is a JS function in js.php file ?
I've tried include ('js.php'), etc., but got no results :(
Any help would be apreciated.
Best regards,
Mário Gamito
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP + Javascript, immediate database update

2004-10-27 Thread Matt M.
> I have a webform which my users are expecting to act like a Windows program,
> they only need to check the box and it is automatically written to the
> database.

you could try this
http://developer.apple.com/internet/webcontent/iframe.html

or this

http://jibbering.com/2002/4/httprequest.html

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



[PHP] PHP + Javascript, immediate database update

2004-10-27 Thread Steve McGill
Hi everyone,

I have a webform which my users are expecting to act like a Windows program,
they only need to check the box and it is automatically written to the
database.

So I'd like to use a combination of javascript, like this, but it isn't
quite elegent enough:

- Tick the box.
- Javascript opens up a popup window, SQL query is made, popup window closes
again

Or a second method:

- Register an onexit() function, and auto-submit the form.

The only problem there is to remember to redirect them to their intended
destination, after having submitted the form. (i.e. they pressed back,
forward, or entered in another URL).

Can anybody point me in the right direction?

Many thanks,
Steve

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



Re: [PHP] PHP & JavaScript

2003-10-22 Thread jsWalter
"Martin Towell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Hi everybody!
> >
> > Have somebody any idea how I could do something like that?
> >
> >  > settype($phpScreenWidth,  "string");
> > settype($phpScreenHeight, "string");
> > ?>

This is a serverside process

This says the var $phpScreenWidth and the var $phpScreenHeight are to be
strings.

At this point they have no value associated with them.

This is done on your server, *before* the page is given to the user...


> > 
> > var phpScreenWidth, phpScreenHight;
> >
> > phpScreenWidth  = screen.width;
> > phpScreenHeight = screen.height;
> >
> > 

This is a clientside process

This retrieves the width and height of the users browser window and drops
that value into 2 JavaScript variables.

This is done on the clinets browser, *after* the page is given to the
user...


> >  > echo "Width:|".$phpScreenWidth."|";
> > echo "Height:|".$phpScreenHeight."|";
> > ?>

This is a serverside process

this displays the values of the vars $phpScreenWidth and $phpScreenHeight.

This varaibles do *not* have any values.

This is done on your server, *before* the page is given to the user...



> > I know that this code is not working, it is just to see what I want to
> > do.

ASSUPTION: all 3 sections are on the same PHP page to be servered.

Section #1 and #3 will be processed on the server *before* the page is given
to the user.

Section #2 will be processed on the clients browser *after* the page is
given to the user.


Your trying to clean the dinner dishes *before* you've set the table for
dinner.

It looks like you want to know the width and height of the clients browser
window.

And you want your PHP process to know this so it can do some magic.

Well, first your going to have to serve up a page that retrieves that info,
via JavaScript, places that info in 2 HIDDEN form objects, SUBMIT that info
back to your PHP process and pull that data from the POST variables.

*Then* you can do your magic in PHP with these values.

Or, you can translate your magic into JavaScript and let JS do your magic on
the clients browser.

Does this help you?

Walter

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



[PHP] RE: [PHP-WIN] Re: [PHP] PHP & JavaScript

2003-10-22 Thread BQ777
Oh I see. Well I thought that, but I wasn't sure.

Ok I will do this way. No I have an direction :)

Thanks a lot.


-Original Message-
From: Mike Migurski [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 23. Oktober 2003 03:11
To: BQ777
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: [PHP] PHP & JavaScript

>Have somebody any idea how I could do something like that?



You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...

>[time]->
client request received from browser
 |
 +-> PHP code executed on server
  |
  +-> text output to webserver (including javascript source)
   |
   +-> [drawing of cloud representing internet]
|
+-> text input to web browser on client side
 |
 +-> javascript executed by client
>[time]->

...The only way to have the javascript affect the PHP, is to make a
subsequent request /back/ to the server after the javascript has started
executing. You can, for example, package the screen size into a GET
variable appended to an image request.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP Windows 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 & JavaScript

2003-10-22 Thread Mike Migurski
>Have somebody any idea how I could do something like that?



You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...

>[time]->
client request received from browser
 |
 +-> PHP code executed on server
  |
  +-> text output to webserver (including javascript source)
   |
   +-> [drawing of cloud representing internet]
|
+-> text input to web browser on client side
 |
 +-> javascript executed by client
>[time]->

...The only way to have the javascript affect the PHP, is to make a
subsequent request /back/ to the server after the javascript has started
executing. You can, for example, package the screen size into a GET
variable appended to an image request.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



RE: [PHP] PHP & JavaScript

2003-10-22 Thread BQ777
Exactly.

but it should be only with one step.
That means, just running the file once and get the vars.

cbq

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 23. Oktober 2003 03:00
To: 'BQ777'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP & JavaScript

> Hi everybody!
>  
> Have somebody any idea how I could do something like that?
>  
>  settype($phpScreenWidth,  "string");
> settype($phpScreenHeight, "string");   
> ?>
>  
> 
> var phpScreenWidth, phpScreenHight;
> 
> phpScreenWidth  = screen.width;
> phpScreenHeight = screen.height;
> 
> 
>  
>  echo "Width:|".$phpScreenWidth."|";
> echo "Height:|".$phpScreenHeight."|";
> ?>
>  
> I know that this code is not working, it is just to see what I want to
> do.
> If somebody know a solution, like this, then please let me know.

What are you trying do? Are you trying to pass to PHP the user's screen
width and height ?

Martin

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



RE: [PHP] PHP & JavaScript

2003-10-22 Thread Martin Towell
> Hi everybody!
>  
> Have somebody any idea how I could do something like that?
>  
>  settype($phpScreenWidth,  "string");
> settype($phpScreenHeight, "string");   
> ?>
>  
> 
> var phpScreenWidth, phpScreenHight;
> 
> phpScreenWidth  = screen.width;
> phpScreenHeight = screen.height;
> 
> 
>  
>  echo "Width:|".$phpScreenWidth."|";
> echo "Height:|".$phpScreenHeight."|";
> ?>
>  
> I know that this code is not working, it is just to see what I want to
> do.
> If somebody know a solution, like this, then please let me know.

What are you trying do? Are you trying to pass to PHP the user's screen
width and height ?

Martin

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



[PHP] PHP & JavaScript

2003-10-22 Thread BQ777
Hi everybody!
 
Have somebody any idea how I could do something like that?
 

 

var phpScreenWidth, phpScreenHight;

phpScreenWidth  = screen.width;
phpScreenHeight = screen.height;


 
";
echo "Height:|".$phpScreenHeight."|";
?>
 
I know that this code is not working, it is just to see what I want to
do.
If somebody know a solution, like this, then please let me know.
 
greetZ
 
CBQ


Re: [PHP] php&javascript live-clock

2003-10-07 Thread Eugene Lee
On Tue, Oct 07, 2003 at 03:48:27PM +0200, Alex Ciurea wrote:
: 
: is it possible to show the live-clock from the server machine, using
: php and javascript, without having to make refresh of that page?

AFAIK, no.

PHP scripts get their time information from the server.  JavaScript can
get its time from the server or the client, but it counts the time on
the client side.  If your web browser counts time a bit more slowly or
quickly than the server, the time drift would result in your JavaScript
clock to become more inaccurate over time.  Then you would have to
refresh the PHP page and re-sync your JavaScript clock with the server.
This is not be a big problem if your time drift is "minimal" and your
intervals between page refreshes is "reasonable".

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



Re: [PHP] php&javascript live-clock

2003-10-07 Thread Chris Hayes
At 15:48 7-10-03, you wrote:
hello,

is it possible to show the live-clock from the server machine, using php and
javascript, without having to make refresh of that page?
That would be a 99% javascript job.

Find an existing javascript that works.
When the page is loaded let PHP feed the javascript with the current 
servertime.
In javascript immediately read the time on the usersystem.

Option 1) Compare times and recalculate
Calculate the time difference and remember that.
At every time the time has to be displayed again, use the calculate time 
difference to adjust the time you read on the PC to servertime.

Option 2) trust counters
I'm sure there are time counters in javascript. Start one when the page is 
loaded and to display time add them up.

For both options you will need functions to add times, this is tricky at 
the end of the hour and at the end of the day.
(and keep in mind the time difference can be positive as well as negative.
good luck.

Chris
PS maybe the script is already out there somewhere.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php&javascript live-clock

2003-10-07 Thread Alex Ciurea
hello,

is it possible to show the live-clock from the server machine, using php and
javascript, without having to make refresh of that page?


there are scripts in javascript to display a clock, but it's the clock from
client machine, not from server...

php can obtain the live clock of the server, but how can I keep this
information realtime...?


thanks,
alex


Have a nice day ! (And I'm sure that tomorrow will be better than today!)
Alex Ciurea Greets You
www.netonwave.com



Have a nice day ! (And I'm sure that tomorrow will be better than today!)
Alex Ciurea Greets You
www.netonwave.com

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



RES: [PHP] PHP/JavaScript/HTML

2003-08-18 Thread Mauricio
Perfect! That's all I had to do.

Thanks!

Maurício

-Mensagem original-
De: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Enviada em: terça-feira, 5 de agosto de 2003 16:30
Para: Mauricio; [EMAIL PROTECTED]
Assunto: Re: [PHP] PHP/JavaScript/HTML


From: "Mauricio" <[EMAIL PROTECTED]>
> On the Address Bar I can see: index.php?slcAdd=1&slcAdd=2&slcAdd=3
> But when I get the value using $HTTP_GET_VARS['slcAdd']; it returns just
the
> last value. What can I do to get them all?

Name your select box as "slcAdd[]" and you'll have all of the values in an
array.

---John Holmes...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 14/8/2003

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 14/8/2003


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



Re: [PHP] PHP/JavaScript/HTML

2003-08-14 Thread Mauricio
Ok! Now I can see the values in the another page. But each value are passed
with the same name. How can I get all values using PHP script?

On the Address Bar I can see: index.php?slcAdd=1&slcAdd=2&slcAdd=3
But when I get the value using $HTTP_GET_VARS['slcAdd']; it returns just the
last value. What can I do to get them all?

Thanks!

.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Maurício Alegre Valente
AGP5 Tecnologia da Informação Ltda.
(48) 439-3004
Visite nosso site: www.agp5.com.br
.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
- Original Message - 
From: "CPT John W. Holmes" <[EMAIL PROTECTED]>
To: "Mauricio" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 10:05 AM
Subject: Re: [PHP] PHP/JavaScript/HTML


> From: "Mauricio" <[EMAIL PROTECTED]>
> > I wrote a JavaScript to set the values of a Select html object by client
> > side. The values are copied from another Select that I create getting
the
> > values from the database. After the user set the values he/she wants to
> add
> > it in another form, for example, then press submit button, the values of
> the
> > "user" Select object doesn't appears on the next page. What can I do to
> get
> > the user selected values in the another page?
>
> Well, if I understand that correctly, you need to use Javascript to
"select"
> all of the options that the user selected to add to the second select box.
> If they aren't selected, then they won't be passed to the next page.
>
> ---John Holmes...
>
>
> -- 
> 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/JavaScript/HTML

2003-08-05 Thread CPT John W. Holmes
From: "Mauricio" <[EMAIL PROTECTED]>
> On the Address Bar I can see: index.php?slcAdd=1&slcAdd=2&slcAdd=3
> But when I get the value using $HTTP_GET_VARS['slcAdd']; it returns just
the
> last value. What can I do to get them all?

Name your select box as "slcAdd[]" and you'll have all of the values in an
array.

---John Holmes...


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



Re: [PHP] PHP/JavaScript/HTML

2003-08-05 Thread CPT John W. Holmes
From: "Mauricio" <[EMAIL PROTECTED]>
> I wrote a JavaScript to set the values of a Select html object by client
> side. The values are copied from another Select that I create getting the
> values from the database. After the user set the values he/she wants to
add
> it in another form, for example, then press submit button, the values of
the
> "user" Select object doesn't appears on the next page. What can I do to
get
> the user selected values in the another page?

Well, if I understand that correctly, you need to use Javascript to "select"
all of the options that the user selected to add to the second select box.
If they aren't selected, then they won't be passed to the next page.

---John Holmes...


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



[PHP] PHP/JavaScript/HTML

2003-08-05 Thread Mauricio
Hello folks

I wrote a JavaScript to set the values of a Select html object by client
side. The values are copied from another Select that I create getting the
values from the database. After the user set the values he/she wants to add
it in another form, for example, then press submit button, the values of the
"user" Select object doesn't appears on the next page. What can I do to get
the user selected values in the another page?

Someone could help me?

Thanks!
.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Maurício Alegre Valente
AGP5 Tecnologia da Informação Ltda.
(48) 439-3004
Visite nosso site: www.agp5.com.br
.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
- Original Message - 
From: "Nicholas Robinson" <[EMAIL PROTECTED]>
To: "skate" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 4:26 AM
Subject: Re: [PHP] easier than switch


> As, in this case, only one of the variables is non-null, then you could
use
> the string concatenation operator and this would return what you want.
>
> i.e. type = $_POST['news'] . $_POST['dreams'] . $_POST['storys']...
>
> I think I've used the same variable name in different forms on the same
page,
> as only one form submission occurs at any one time there can't be a
conflict
> and PHP doesn't care where the POST'ed variable came from.. So, you could
> rename news, dreams, etc. to be type and extract the result directly
without
> having to fiddle around.
>
> HTH
>
> Nick
>
> On Monday 04 Aug 2003 11:19 pm, skate wrote:
> > okay, so i know there's an easy way to do this, and i've seen it done,
sure
> > of it. so please forgive the stupidity of my question, i don't even know
> > where to begin to look in the archives either...
> >
> > i have several forms on one page, they all submit a different variable,
i
> > then want to set one variable depending on that... okay, now i'm
confusing
> > myself, lets try explain it with some code...
> >
> >  >
> > if(isset($_POST))
> > {
> >  $type = $_POST['news'] || $_POST['dreams'] || $_POST['storys'] ||
> > $_POST['words'] || $_POST['chat']; }
> >
> > ?>
> >
> > obviously this doesn't work. but i wanna set $type depending on which
> > $_POST variable was sent. only one of these will ever be sent. rather
than
> > doing a big ass switch statement, is there no way i can get this into
one
> > line?
> >
> > i hope this isn't too confusing...
>
>
> -- 
> 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, JavaScript and populating DropDowns

2003-07-30 Thread Creative Solutions New Media
Thanks very much John.  It looks great.

Tim Winters
Manager, Creative Development
Sampling Technologies Incorporated (STI)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
W: 902 450 5500
C:  902 430 8498

-Original Message-
From: John Manko [mailto:[EMAIL PROTECTED]
Sent: July 29, 2003 2:49 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] PHP, JavaScript and populating DropDowns

assuming you have a table with colors, and each color has car associated
with it (yes, there might be dup color entries).
This should work (check spellings and case, etc..etc...)

$query="SELECT * from colors";
$results = mysql_query($query) or die ("DB ERROR:" . mysql_error());
$num = mysql_numrows($results);
$i=0;
echo "\n<!--\n";
while ($i < $num) {
echo "\n ca[$i] = new Array();";
echo "\n ca[$i][0] = \"" . mysql_result($results,$i,"CarID") . "\";";
echo "\n ca[$i][1] = \"" . mysql_result($results,$i,"ColorID") . "\";";
echo "\n ca[$i][2] = \"" . mysql_result($results,$i,"ColorName") .
"\";\n";
++$i;
}

echo "
function changeColor(ns)
{var SelectColor, NumEntries, i;

for (i = document.form1.selectcolor.length; i > 0; i--)
{
document.addform.selectcolor.options[i-1] = null;
}

document.form1.selectcolor.options[0] = new Option("-- Select Color
--",0);
len = 0;
if (ns != "0")
{
NumEntries = ca.length

for (i = 0; i < NumEntries; i++)
{
if(ca[i][0] == ns){
len++;
document.form1.selectcolor.options[len] = new
Option(ca[i][2],ca[i][1]);
}
}
}
document.form1.selectcolor.selectedIndex = 0;
}

";
echo "\n//-->\n\n";


this in later in the page...


$query="SELECT * from car";
$results = mysql_query($query) or die("ERROR - Please Contact Site
Administrator");
$num = mysql_numrows($results);
$i=0;
echo "Select Car";
while ($i < $num) {
  $id=mysql_result($results,$i,"CarID");
  $name=mysql_result($results,$i,"CarName");
 echo "$name";
  ++$i;
 }
echo "";


echo "-- Select Color
--";




---


Creative Solutions New Media wrote:

>Hello,
>
>I am using mySQL and PHP to pull some data into my page.
>
>I have 2 dropdown boxes.
>
>As an example lets say dropbox1 has a list of cars and dropbox2 has a list
>of colours.
>
>Here's the thing.  The colours for each car vary so I won't know what
>colours to populate the 2nd dropbox with until a car is chosen.  I really
>want this all contained on 1 page.
>
>Is there a standard way of dealing with this?  The only thing I can think
of
>is to reload the page once the make of car is selected which would give me
>the opportunity to populate the 2nd drop box at that time but that doesn't
>seem like a good solution.
>
>I don't know much in the way of JS but is there a way to do what I need
that
>way?
>
>Thanks.
>
>Tim Winters
>Manager, Creative Development
>Sampling Technologies Incorporated (STI)
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>W: 902 450 5500
>C:  902 430 8498
>
>
>
>
>
>



--
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, JavaScript and populating DropDowns

2003-07-29 Thread John Manko
assuming you have a table with colors, and each color has car associated 
with it (yes, there might be dup color entries).
This should work (check spellings and case, etc..etc...)

$query="SELECT * from colors";
$results = mysql_query($query) or die ("DB ERROR:" . mysql_error());
$num = mysql_numrows($results);   
$i=0;
echo "\n\n\n";

this in later in the page...

$query="SELECT * from car";
$results = mysql_query($query) or die("ERROR - Please Contact Site 
Administrator");
$num = mysql_numrows($results);   
$i=0;
echo "Select Car";
while ($i < $num) {
 $id=mysql_result($results,$i,"CarID");
 $name=mysql_result($results,$i,"CarName");
echo "$name";
 ++$i;
}   
echo "";   

echo "-- Select Color 
--";



---

Creative Solutions New Media wrote:

Hello,

I am using mySQL and PHP to pull some data into my page.

I have 2 dropdown boxes.

As an example lets say dropbox1 has a list of cars and dropbox2 has a list
of colours.
Here's the thing.  The colours for each car vary so I won't know what
colours to populate the 2nd dropbox with until a car is chosen.  I really
want this all contained on 1 page.
Is there a standard way of dealing with this?  The only thing I can think of
is to reload the page once the make of car is selected which would give me
the opportunity to populate the 2nd drop box at that time but that doesn't
seem like a good solution.
I don't know much in the way of JS but is there a way to do what I need that
way?
Thanks.

Tim Winters
Manager, Creative Development
Sampling Technologies Incorporated (STI)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
W: 902 450 5500
C:  902 430 8498


 



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


[PHP] PHP, JavaScript and populating DropDowns

2003-07-29 Thread Creative Solutions New Media
Hello,

I am using mySQL and PHP to pull some data into my page.

I have 2 dropdown boxes.

As an example lets say dropbox1 has a list of cars and dropbox2 has a list
of colours.

Here's the thing.  The colours for each car vary so I won't know what
colours to populate the 2nd dropbox with until a car is chosen.  I really
want this all contained on 1 page.

Is there a standard way of dealing with this?  The only thing I can think of
is to reload the page once the make of car is selected which would give me
the opportunity to populate the 2nd drop box at that time but that doesn't
seem like a good solution.

I don't know much in the way of JS but is there a way to do what I need that
way?

Thanks.

Tim Winters
Manager, Creative Development
Sampling Technologies Incorporated (STI)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
W: 902 450 5500
C:  902 430 8498




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



Re: [PHP] php - javascript together prob?

2003-07-09 Thread Ray Hunter
U need to quote it with double quotes and escape them with like so:

\"

that should work for you. If not then you will need to start separating
the string out and joining it with the "." .

--
BigDog



On Wed, 2003-07-09 at 15:51, Micah Montoy wrote:
> Anyone have an idea of how to get this to work?  Its the onClick part that
> wont work.  I know if I pull it out of PHP it works just fine but I need it
> part of the script as I have a loop that it runs under.
> 
> echo ("");
> 
> I considered and tried sending it to a js function but it doesn't like not
> having the " but I need the quotes in the echo statement to read in the
> variables passed to it.
> 
> thanks
> 
> 


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



RE: [PHP] php - javascript together prob?

2003-07-09 Thread Jennifer Goodie
Since you had problems with quotes yesterday too, I would suggest reading
the manual page on strings so you do not continue to have the same problems
day after day.

http://www.php.net/manual/en/language.types.string.php


> -Original Message-
> From: Micah Montoy [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 09, 2003 2:51 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php - javascript together prob?
>
>
> Anyone have an idea of how to get this to work?  Its the onClick part that
> wont work.  I know if I pull it out of PHP it works just fine but
> I need it
> part of the script as I have a loop that it runs under.
>
> echo ("");
>
> I considered and tried sending it to a js function but it doesn't like not
> having the " but I need the quotes in the echo statement to read in the
> variables passed to it.
>
> thanks


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



[PHP] php - javascript together prob?

2003-07-09 Thread Micah Montoy
Anyone have an idea of how to get this to work?  Its the onClick part that
wont work.  I know if I pull it out of PHP it works just fine but I need it
part of the script as I have a loop that it runs under.

echo ("");

I considered and tried sending it to a js function but it doesn't like not
having the " but I need the quotes in the echo statement to read in the
variables passed to it.

thanks



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



RE: [PHP] PHP/Javascript Help

2003-06-10 Thread Ford, Mike [LSS]
> -Original Message-
> From: Stephen [mailto:[EMAIL PROTECTED]
> Sent: 06 June 2003 15:48
> 
> 
> Thanks for your reply. I had actually made a mistake in the 
> code. It looks
> like this now:
> 
> 
> 
> How could I still use the id thing on this?

Well, the addition of the stripslashes() call doesn't really change the
basic idea, so:

   print "$d";

>  I now use ' in 
> the brakets as
> well, if that helps any...

I'm not sure I quite understand this, but if you're saying that the value of
$HTTP_GET_VARS['name'] may itself include ' characters, then I think the
answer to that is *not* to stripslashes() it -- JavaScript will understand
the backslashed notations and convert them to the correct result.  If that's
not what you were getting at, please try explaining it again in a bit more
detail (adding an example might help).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] PHP/Javascript Help

2003-06-06 Thread Stephen
Thanks for your reply. I had actually made a mistake in the code. It looks
like this now:

print "$d";

How could I still use the id thing on this? I now use ' in the brakets as
well, if that helps any...

I'm not yours, so why should I be sincere about it,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.


- Original Message - 
From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]>
To: "'Stephen'" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 4:22 AM
Subject: RE: [PHP] PHP/Javascript Help


> -Original Message-
> From: Stephen [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 19:15
>
> Here's my javascript link code for each day of the month in
> the calendar script:
>
> print " onClick=\"window.opener.document.".$HTTP_GET_VARS['name'].".da
> te.value='$y-$m-$d';\">$d";
>
> $HTTP_GET_VARS['name'] holds the text field name, ie
> delivery[3322ffds]. If I replace the name either order in the
> text field and as the variable I pass in the URL it works fine.

You need to make use of the JavaScript ['id'] identity with .id (see any
good JavaScript book for more on this), thus:

  print "$d";


Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

-- 
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] PHP/Javascript Help

2003-06-06 Thread Stephen
Hello,

I'm trying to use a calendare script to select a date in another form. I got the 
calendar working and I've got it all working except one bit of error.

I'm repeating a table field to get all these items into a table. Each row of the table 
has it's own text field where the user can type in when they want the item to be 
delivered. That's where the calendar comes in. It opens a new window, displays the 
calendar, and that's that. The problem I'm having is when the user click the date, 
they get an error, one of those "Expected ] on line whatever."

I can see what the problem is. Since I repeat the form field, I made the field's name 
delivery[item_id] and item_id is replaced with the item's id currently being 
displayed. I need to keep this array so, how can I fix this error? I tried doing the 
\[ trick since that works with apostrpohes but it didn't seem to work. Any help would 
be great!

Here's my javascript link code for each day of the month in the calendar script:

print "$d";

$HTTP_GET_VARS['name'] holds the text field name, ie delivery[3322ffds]. If I replace 
the name either order in the text field and as the variable I pass in the URL it works 
fine.

I'm not yours, so why should I be sincere about it,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.



RE: [PHP] PHP/Javascript Help

2003-06-06 Thread Ford, Mike [LSS]
> -Original Message-
> From: Stephen [mailto:[EMAIL PROTECTED]
> Sent: 05 June 2003 19:15
> 
> Here's my javascript link code for each day of the month in 
> the calendar script:
> 
> print " onClick=\"window.opener.document.".$HTTP_GET_VARS['name'].".da
> te.value='$y-$m-$d';\">$d";
> 
> $HTTP_GET_VARS['name'] holds the text field name, ie 
> delivery[3322ffds]. If I replace the name either order in the 
> text field and as the variable I pass in the URL it works fine.

You need to make use of the JavaScript ['id'] identity with .id (see any good 
JavaScript book for more on this), thus:

  print "$d";


Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] php & javascript problem

2003-03-23 Thread Denis L. Menezes
Hello friends.

I need to control the users viewing from one location so that when I change the URL 
string in a text file, the viewers page which has a timer automatically reads the URL 
on the text pages and goes to that page.

Updating the textfile is ok. But below is the script onthe page which I want to reload 
every 10 seconds and display the name of the new page and go there. 

There are two problems, when the page reloads, the PHP script that gets the new URL 
from the text file does not seem to run.

Can someone please tell me where I am wrong?

Thanks very much.
Denis



";
Print"";
Print "";
Print"";
fclose($fo);
?>







Re: [PHP] PHP & JavaScript

2003-02-12 Thread Greg
Thank you so much, that worked perfectly...I know it's off topic, but do you
know how to automatically select all elements of a select multiple box and
then submit the form using a submit button?  Thanks!
-Greg

"John Nichel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> document.forms[0].elements['select1[]']
>
> Assuming the form is your first form on the page, reference the element
>   in JavaScript as above.
>
> Greg wrote:
> > I have a problem with 2 select multiple boxes in my PHP pages.  In order
for
> > PHP to pass multiple values to a page that it is posted to, the name of
the
> > select box must have [] at the end of it.  My problem is that when I do
that
> > for select1[] in my page that breaks the syntax of the JavaScript code
that
> > performs operations on it.  Is there any way around this?  I'm looking
for
> > either a PHP or a JavaScript solution.
> > Thanks,
> > Greg
> >
> >
> >
>
>



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




Re: [PHP] php & javascript drop down menu???

2003-02-12 Thread Jeff Bluemel
thanks Jason, between this & the other suggestions I was emailed I believe I
can make this all work like I need to.

Jeff

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wednesday 12 February 2003 08:47, Jeff Bluemel wrote:
> > OK...  I have a dynamic menu system, and I have to maintain a dynamic
menu.
> > however, the amount of content I need in my menu is going to be rapidly
> > outgrown.  I believe my only solution is to deploy a javascript drop
down
> > menu (users have to be javascript compatible anyway for some other
issues
> > in my pages).
> >
> > however, it seems like anytime I try to integrate php & javascript I run
> > into a total nightmare.  the php & javascript do not need to integrate
at
> > the client level, but just on the server side to actually deploy the
menu
> > to the user.  (have if then statements of info from a database that will
> > determine if the item is displayed to the user or not, so should be
pretty
> > easy to accomodate)
> >
> > does anybody have any sample code of a javascript menu across the top of
> > the page that will have menu, and submenu's they are deploying with php
> > echo statements?
>
> Try this:
>
>   http://phplayersmenu.sourceforge.net/
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The difference between this place and yogurt is that yogurt has a live
> culture.
> */
>



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




Re: [PHP] PHP & JavaScript

2003-02-12 Thread John Nichel
document.forms[0].elements['select1[]']

Assuming the form is your first form on the page, reference the element 
 in JavaScript as above.

Greg wrote:
I have a problem with 2 select multiple boxes in my PHP pages.  In order for
PHP to pass multiple values to a page that it is posted to, the name of the
select box must have [] at the end of it.  My problem is that when I do that
for select1[] in my page that breaks the syntax of the JavaScript code that
performs operations on it.  Is there any way around this?  I'm looking for
either a PHP or a JavaScript solution.
Thanks,
Greg







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




[PHP] PHP & JavaScript

2003-02-12 Thread Greg
I have a problem with 2 select multiple boxes in my PHP pages.  In order for
PHP to pass multiple values to a page that it is posted to, the name of the
select box must have [] at the end of it.  My problem is that when I do that
for select1[] in my page that breaks the syntax of the JavaScript code that
performs operations on it.  Is there any way around this?  I'm looking for
either a PHP or a JavaScript solution.
Thanks,
Greg



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




Re: [PHP] php & javascript drop down menu???

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 08:47, Jeff Bluemel wrote:
> OK...  I have a dynamic menu system, and I have to maintain a dynamic menu.
> however, the amount of content I need in my menu is going to be rapidly
> outgrown.  I believe my only solution is to deploy a javascript drop down
> menu (users have to be javascript compatible anyway for some other issues
> in my pages).
>
> however, it seems like anytime I try to integrate php & javascript I run
> into a total nightmare.  the php & javascript do not need to integrate at
> the client level, but just on the server side to actually deploy the menu
> to the user.  (have if then statements of info from a database that will
> determine if the item is displayed to the user or not, so should be pretty
> easy to accomodate)
>
> does anybody have any sample code of a javascript menu across the top of
> the page that will have menu, and submenu's they are deploying with php
> echo statements?

Try this:

  http://phplayersmenu.sourceforge.net/

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The difference between this place and yogurt is that yogurt has a live 
culture.
*/


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




[PHP] php & javascript drop down menu???

2003-02-11 Thread Jeff Bluemel
OK...  I have a dynamic menu system, and I have to maintain a dynamic menu.
however, the amount of content I need in my menu is going to be rapidly
outgrown.  I believe my only solution is to deploy a javascript drop down
menu (users have to be javascript compatible anyway for some other issues in
my pages).

however, it seems like anytime I try to integrate php & javascript I run
into a total nightmare.  the php & javascript do not need to integrate at
the client level, but just on the server side to actually deploy the menu to
the user.  (have if then statements of info from a database that will
determine if the item is displayed to the user or not, so should be pretty
easy to accomodate)

does anybody have any sample code of a javascript menu across the top of the
page that will have menu, and submenu's they are deploying with php echo
statements?



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




[PHP] PHP & Javascript compatibilty

2002-11-29 Thread Wee Keat [Amorphosium]
Hi all,

I'm developing a WYSIWYG editor using PHP and Javascript (for COM). However, I start 
having problems when I try to display the page using the .php extension. The 
Javascript is not working. 

However, when I save it to HTML, it worked fine. 

Can anyone please help me? Why is this so? What can I do to get Javascript working 
with PHP with ease? Any articles on this?

Thanks a lot... again. :)



Yours,

Wee Keat Chin

--
"If you cannot win, make the one ahead of you break the record." 



RE: [PHP] php + javascript hard day together ?

2002-07-16 Thread Ford, Mike [LSS]

> -Original Message-
> From: David D [mailto:[EMAIL PROTECTED]]
> Sent: 13 July 2002 16:38
> 
> I can manage this script to work.
> Js warn about listid[], he doesnt like [] in a var name !
> Php needs them to collect an array from form checkboxes.
> 
> 
> 
> 
>  onClick="this.value=check(this.form.listid[])">

use this.form['listid[]']

It seems to be a very little known fact that, by definition, the JavaScript construct

   x.y

is identical to

   x['y']

so an extended accessor such as

   w.x.y.z

could also be written equally validly in any of the following ways:

   w.x.y['z']
   w.x['y'].z
   w['x'].y.z
   w['x'].y['z']
   w['x']['y'].z

and several other similar combinations!

(And, yes, that means that this['form']['listid[]'] should be valid, too!)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] php + javascript hard day together ?

2002-07-13 Thread David D

I hack js no need to change in php :












[redirect_script.php]

...and here on the redirect page I would do validation of the 
variables/form_contents etc.,
insert it into a db, and then redirect:

http://www.site.com/path/to/another_page.html";); 
//Redirect browser
break;
case ...
}

Cheers,
Bruce







_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


-- 
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-JavaScript

2002-01-20 Thread Richard Crawford

In a word... No.

Well...

No.


Mårten Andersson wrote:

> Is it posible to get values from javascript to PHP? Without having to 
> post the variables..
> 
> Thanks //Mårten
> 
> _
> Chatta med vänner online, prova MSN Messenger: http://messenger.msn.se
> 
> 



-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED] 
http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupery

"Push the button, Max!"



-- 
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] PHP-JavaScript

2002-01-20 Thread Mårten Andersson

Is it posible to get values from javascript to PHP? Without having to post 
the variables..

Thanks //Mårten

_
Chatta med vänner online, prova MSN Messenger: http://messenger.msn.se


-- 
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 & javascript

2001-10-03 Thread Matthew Armsby

> document.myform["email[]"] seems to give me a syntax error.

Check if your already using "" you'll need to use single quotes as so:

(tested on IE 5.5 and NS 4.08, works)

>> If you leave it as email, you can then convert the email variable into an
array using explode() or split() as so:

>  On the recieving page I have echo($array = implode (",", $email));
which echos the array of text box values just fine. but only if the input
name=email[] not name=email, and email[] doesnt work since my javascript
uses email, not email[]

If you want to continue using email[], the above advise should be okay, and
no need to read on.
If you want to use email, instead of echo(implode(",", $email)), just
echo($email), then you can use explode() when you want the array.




-- 
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 & javascript

2001-10-03 Thread nate

Thanks...

> Leave the  name as email.  If you really want to call it email[],
> you should be able to reference this in JavaScript as the object
> document.myform["email[]"]

document.myform["email[]"] seems to give me a syntax error.

 If you leave it as email, you can then convert the email variable into an
> array using explode() or split() as so:

On the recieving page I have echo($array = implode (",", $email));

which echos the array of text box values just fine. but only if the input
name=email[] not name=email, and email[] doesnt work since my javascript
uses email, not email[]

- Original Message -
From: "Matthew Armsby" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 2:54 AM
Subject: Re: [PHP] php & javascript


> Leave the  name as email.  If you really want to call it email[],
> you should be able to reference this in JavaScript as the object
> document.myform["email[]"]
>
> If you leave it as email, you can then convert the email variable into an
> array using explode() or split() as so:
>  // on the recieving page, of course
> $emailArray = explode (",", $email);
> // Alternatively, a bit of RE exploding...
> $emailArray = split (",", $email);
> ?>
>
> Matt
>
> > Hey all!
> >
> > I'm including some javascript that enables a button in a form
> >  > onClick="checkAll(document.myform.email)">to check all
> > the check boxes at once. (I have an array of check boxes from a mysql
> > db)
> >
> > I use:
> >
> > 
> > <!-- Begin
> > function checkAll(field)
> > {
> > for (i = 0; i < field.length; i++)
> >  field[i].checked = true ;
> > }
> >
> > function uncheckAll(field)
> > {
> > for (i = 0; i < field.length; i++)
> >  field[i].checked = false ;
> > }
> > //  End -->
> > 
> >
> > So... In order to use this script my button has to have
> > onClick="checkAll(document.myform.email)" and my check boxes have to
> > have name="email" but i need to name them name="email[]" in order to
> > pass the variables as an array in php. ive tried using
> > onClick="checkAll(document.myform.email[])" but that just gives me an
> > error for obvious reasons im sure. I don't know jack about javascript,
> > so if you know of a better way to make a button that selects all check
> > boxes or another way to code how the check boxes values are passed to
> > the next page, I would be so greatful.
> >
> > Thanks!
> > Nate
>
>
>
> --
> 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 & javascript

2001-10-03 Thread nate

First off thanks for the reply.

When I click the "test" button I get "Error: 'length' is null or not an
object."

I used



  function func( field ) {
for ( i = 0; i < field.length; i++ )
  field[i].checked = true ;
  }











- Original Message -
From: "Krzysztof Kocjan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 2:47 AM
Subject: Re: [PHP] php & javascript


> Try document.myform.elements['email[]'] like below
>
> 
>
>   function func( field ) {
> for ( i = 0; i < field.length; i++ )
>   field[i].checked = true ;
>   }
>
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
>
> Krzysztof
>
> [EMAIL PROTECTED] wrote:
> >
> > Hey all!
> >
> > I'm including some javascript that enables a button in a form
 > onClick="checkAll(document.myform.email)">to check all
the check boxes at once. (I have an array of check boxes from a mysql db)
> >
> > I use:
> >
> > 
> > <!-- Begin
> > function checkAll(field)
> > {
> > for (i = 0; i < field.length; i++)
> >  field[i].checked = true ;
> > }
> >
> > function uncheckAll(field)
> > {
> > for (i = 0; i < field.length; i++)
> >  field[i].checked = false ;
> > }
> > //  End -->
> > 
> >
> > So... In order to use this script my button has to have
onClick="checkAll(document.myform.email)" and my check boxes have to have
name="email" but i need to name them name="email[]" in order to pass the
variables as an array in php. ive tried using
onClick="checkAll(document.myform.email[])" but that just gives me an error
for obvious reasons im sure. I don't know jack about javascript, so if you
know of a better way to make a button that selects all check boxes or
another way to code how the check boxes values are passed to the next page,
I would be so greatful.
> >
> > Thanks!
> > Nate
>
> 
> 99% trafien. 1% rezerwy, zeby innym nie bylo przykro.
> Nowe Centrum Wyszukiwania >> http://szukaj.interia.pl/
>


-- 
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 & javascript

2001-10-03 Thread Matthew Armsby

Leave the  name as email.  If you really want to call it email[], 
you should be able to reference this in JavaScript as the object 
document.myform["email[]"]

If you leave it as email, you can then convert the email variable into an 
array using explode() or split() as so:


Matt

> Hey all!
> 
> I'm including some javascript that enables a button in a form  
>  onClick="checkAll(document.myform.email)">to check all
> the check boxes at once. (I have an array of check boxes from a mysql
> db)
> 
> I use:
> 
> 
> 
> 
> 
> So... In order to use this script my button has to have
> onClick="checkAll(document.myform.email)" and my check boxes have to
> have name="email" but i need to name them name="email[]" in order to
> pass the variables as an array in php. ive tried using
> onClick="checkAll(document.myform.email[])" but that just gives me an
> error for obvious reasons im sure. I don't know jack about javascript,
> so if you know of a better way to make a button that selects all check
> boxes or another way to code how the check boxes values are passed to
> the next page, I would be so greatful.
> 
> Thanks!
> Nate



-- 
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] php & javascript

2001-10-03 Thread nate

Hey all!

I'm including some javascript that enables a button in a form   to check all the check boxes 
at once. (I have an array of check boxes from a mysql db)

I use:





So... In order to use this script my button has to have 
onClick="checkAll(document.myform.email)" and my check boxes have to have name="email" 
but i need to name them name="email[]" in order to pass the variables as an array in 
php. ive tried using onClick="checkAll(document.myform.email[])" but that just gives 
me an error for obvious reasons im sure. I don't know jack about javascript, so if you 
know of a better way to make a button that selects all check boxes or another way to 
code how the check boxes values are passed to the next page, I would be so greatful.

Thanks!
Nate



RE: [PHP] PHP + javascript

2001-05-01 Thread Joseph Tate

This is usually handled by the browser automatically.  (Nobody likes to see
out of date content when browsing the web).  Users can set their browser
settings to check for new things once per session, every time, or never (or
some variation of these).  Most users use once per session.  Otherwise, a
complete reload can be forced on many browsers (NS and IE at least) by
holding shift and clicking reload.

Joseph

> -Original Message-
> From: Ide, Jim [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 01, 2001 4:36 PM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] PHP + javascript
>
>
>
> Hi -
>
> I want to use javascript to validate some fields on a form.
> The javascript code will take the value the user typed
> into the form and search for it in an array.  If the value
> is found in the array, then the value is ok, otherwise
> an alert() message will be displayed.
>
> The amount of data in the array is quite large.
>
> The data in the array rarely changes.
>
> I want to avoid transferring the array from the web server
> to the client's web browser every time the user loads the
> form.  I put the array in a file called "myarray.js":
>
> $ cat myarray.js
> var MyArray = new Array(
>   "value 1",
>   "value 2",
> 
>   "value 789",
>   "value 790"
> );
> $
>
> Then, I put the following line in the php script that generates the form:
>
> 
>
> By examining Apache's access_log, I see that "myarray.js" is
> transferred to the user's web browser once when the form is first
> displayed, and for subsequent uses of the form, the web browser
> uses the myarray.js that is cached, so that the array does not
> have to be transferred from the web server to the client computer
> every time the user uses the form.
>
> So, if the data in the array contained in myarray.js _does_ need
> to be changed, I need some way of signaling the user's web browser
> that it needs to transfer the updated myarray.js file from the web
> server.  How do I do this?
>
> The only way I know to do this is to instruct the users to clear their
> web browser cache, which will force the web browser to transfer
> the updated myarray.js from the web server to the web browser.
>
> Is there another way?  Is there some kind of "expire" mechanism
> that will tell the web browser that it needs to get the updated
> myarray.js file?
>
> Thanks -
> Jim Ide
>
>
>
>
> --
> 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]




[PHP] PHP + javascript

2001-05-01 Thread Ide, Jim


Hi -

I want to use javascript to validate some fields on a form.
The javascript code will take the value the user typed
into the form and search for it in an array.  If the value
is found in the array, then the value is ok, otherwise
an alert() message will be displayed.

The amount of data in the array is quite large.

The data in the array rarely changes.

I want to avoid transferring the array from the web server
to the client's web browser every time the user loads the
form.  I put the array in a file called "myarray.js":

$ cat myarray.js
var MyArray = new Array(
"value 1",
"value 2",

"value 789",
"value 790"
);
$

Then, I put the following line in the php script that generates the form:



By examining Apache's access_log, I see that "myarray.js" is
transferred to the user's web browser once when the form is first
displayed, and for subsequent uses of the form, the web browser
uses the myarray.js that is cached, so that the array does not
have to be transferred from the web server to the client computer
every time the user uses the form.

So, if the data in the array contained in myarray.js _does_ need
to be changed, I need some way of signaling the user's web browser
that it needs to transfer the updated myarray.js file from the web
server.  How do I do this?

The only way I know to do this is to instruct the users to clear their
web browser cache, which will force the web browser to transfer
the updated myarray.js from the web server to the web browser.

Is there another way?  Is there some kind of "expire" mechanism
that will tell the web browser that it needs to get the updated
myarray.js file?

Thanks -
Jim Ide




-- 
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]