Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 3:57 PM   #1
Gilbert Schroeder
 
Gilbert Schroeder's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

Hi there!

I want to read the client environment and pass the username to php to
compare it with the username stored in a MySQL table. To read the
client environment I know I have to use javascript (don't know how yet
but will find out). Question: how can I pass the JS output to php to
do the comparison?

Thanx.
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 07-01-2007, 3:57 PM   #2
Nathan
 
Nathan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

Gilbert Schroeder say...

> Hi there!
>
> I want to read the client environment and pass the username to php to
> compare it with the username stored in a MySQL table. To read the
> client environment I know I have to use javascript (don't know how yet
> but will find out). Question: how can I pass the JS output to php to
> do the comparison?


Well you'll have to do some sort of meta refresh or redirect (possibly to
the same page), perhaps passing variables via the URL.

for example in page test.php, you use some javascript to get what you need
and then refresh to test.php?client=something

BUT...

If it's stuff like getting the user's browser then PHP can do that too:
It's automatically stored in $_SERVER['HTTP_USER_AGENT']

--
Nathan.
XBL Gamertag: Cowfield
http://www.cowfields.com
Bow to the Cow!
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:58 PM   #3
Gilbert Schroeder
 
Gilbert Schroeder's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

Nathan <spamfourstomachs@hotmails.com> wrote in message news:<Xns93C76C60973DBfourstomachsspamhotm@130.133 .1.4>...
> Gilbert Schroeder say...
>
> > Hi there!
> >
> > I want to read the client environment and pass the username to php to
> > compare it with the username stored in a MySQL table. To read the
> > client environment I know I have to use javascript (don't know how yet
> > but will find out). Question: how can I pass the JS output to php to
> > do the comparison?

>
> Well you'll have to do some sort of meta refresh or redirect (possibly to
> the same page), perhaps passing variables via the URL.
>
> for example in page test.php, you use some javascript to get what you need
> and then refresh to test.php?client=something
>
> BUT...
>
> If it's stuff like getting the user's browser then PHP can do that too:
> It's automatically stored in $_SERVER['HTTP_USER_AGENT']


Well, actually, I need the client information, for instance, the
environment variable 'username' or 'nwusername' and thus I have to use
javascript. Thanx for your help anyway, even if I still don't see how
to do
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:58 PM   #4
Rob
 
Rob's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables


"Gilbert Schroeder" <gibs@valain.com> schreef in bericht
news:26b6dc45.0307292219.5bc58ee2@posting.google.c om...
> Nathan <spamfourstomachs@hotmails.com> wrote in message

news:<Xns93C76C60973DBfourstomachsspamhotm@130.133 .1.4>...
> > Gilbert Schroeder say...
> >
> > > Hi there!
> > >
> > > I want to read the client environment and pass the username to php to
> > > compare it with the username stored in a MySQL table. To read the
> > > client environment I know I have to use javascript (don't know how yet
> > > but will find out). Question: how can I pass the JS output to php to
> > > do the comparison?

> >
> > Well you'll have to do some sort of meta refresh or redirect (possibly

to
> > the same page), perhaps passing variables via the URL.
> >
> > for example in page test.php, you use some javascript to get what you

need
> > and then refresh to test.php?client=something
> >
> > BUT...
> >
> > If it's stuff like getting the user's browser then PHP can do that too:
> > It's automatically stored in $_SERVER['HTTP_USER_AGENT']

>
> Well, actually, I need the client information, for instance, the
> environment variable 'username' or 'nwusername' and thus I have to use
> javascript. Thanx for your help anyway, even if I still don't see how
> to do


If it was possible to get the username or network username from a client
computer just through a browser we would make a lot of hackers very happy!

There is no way you can get (private) client environment variables through
javascript (or PHP) through a html page.

You can get stuf about the connection(i.e. ip address) and
useragent(browser) in both javascript and PHP because this is usually all
you need when creating html pages

in javascript look at tthe properties if the navigation object and in PHP
look at the $_SERVER and $_ENV arrays.
Hope you find what you need

Rob


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:58 PM   #5
Gilbert Schroeder
 
Gilbert Schroeder's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

"Rob" <Rob@Demmenie.net> wrote in message news:<6wLVa.671959$gs1.44678814@amsnews03.chello.c om>...
> "Gilbert Schroeder" <gibs@valain.com> schreef in bericht
> news:26b6dc45.0307292219.5bc58ee2@posting.google.c om...
> > Nathan <spamfourstomachs@hotmails.com> wrote in message

> news:<Xns93C76C60973DBfourstomachsspamhotm@130.133 .1.4>...
> > > Gilbert Schroeder say...
> > >
> > > > Hi there!
> > > >
> > > > I want to read the client environment and pass the username to php to
> > > > compare it with the username stored in a MySQL table. To read the
> > > > client environment I know I have to use javascript (don't know how yet
> > > > but will find out). Question: how can I pass the JS output to php to
> > > > do the comparison?
> > >
> > > Well you'll have to do some sort of meta refresh or redirect (possibly

> to
> > > the same page), perhaps passing variables via the URL.
> > >
> > > for example in page test.php, you use some javascript to get what you

> need
> > > and then refresh to test.php?client=something
> > >
> > > BUT...
> > >
> > > If it's stuff like getting the user's browser then PHP can do that too:
> > > It's automatically stored in $_SERVER['HTTP_USER_AGENT']

> >
> > Well, actually, I need the client information, for instance, the
> > environment variable 'username' or 'nwusername' and thus I have to use
> > javascript. Thanx for your help anyway, even if I still don't see how
> > to do

>
> If it was possible to get the username or network username from a client
> computer just through a browser we would make a lot of hackers very happy!
>
> There is no way you can get (private) client environment variables through
> javascript (or PHP) through a html page.
>
> You can get stuf about the connection(i.e. ip address) and
> useragent(browser) in both javascript and PHP because this is usually all
> you need when creating html pages
>
> in javascript look at tthe properties if the navigation object and in PHP
> look at the $_SERVER and $_ENV arrays.
> Hope you find what you need
>
> Rob


In IE, with the correct permissions, you can get the client
environment using ActiveX. But it only works for IE. So, I have an
idea how to do this but I still do not know how I could transport the
result, the js variable content, to php. And that's the matter. Maybe
it's to easy ... )
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:59 PM   #6
Nathan
 
Nathan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

Gilbert Schroeder say...

> he js variable content, to php. And that's the matter. Maybe
> it's to easy ... )


Just get Javascript to redirect to a page, passing the variables through
the url.

I don't really know JS, but surely some sort of write.document type thingy
to make either a link

something.php?username=nathan

If passed through the URL like this, then in something.php:

$_POST["username"] == "nathan";

Does this help?

--
Nathan.
XBL Gamertag: Cowfield
http://www.cowfields.com
Bow to the Cow!
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:59 PM   #7
Gilbert Schroeder
 
Gilbert Schroeder's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

Nathan <spamfourstomachs@hotmails.com> wrote in message news:<Xns93C89509DBE80fourstomachsspamhotm@130.133 .1.4>...
> Gilbert Schroeder say...
>
> > he js variable content, to php. And that's the matter. Maybe
> > it's to easy ... )

>
> Just get Javascript to redirect to a page, passing the variables through
> the url.
>
> I don't really know JS, but surely some sort of write.document type thingy
> to make either a link
>
> something.php?username=nathan
>
> If passed through the URL like this, then in something.php:
>
> $_POST["username"] == "nathan";
>
> Does this help?


OK, I'll try to find a way to pass it thru the URL. I'll post the
solution here if I find any. Thanx.
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:59 PM   #8
Nathan
 
Nathan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Passing variables

Gilbert Schroeder say...

>>
>> $_POST["username"] == "nathan";
>>
>> Does this help?

>
> OK, I'll try to find a way to pass it thru the URL. I'll post the
> solution here if I find any. Thanx.


I've just realised a mistake in the above.

If passed through the URL it won't be $_POST["username"] it'll be $_GET
["username"].

HTH

--
Nathan.
XBL Gamertag: Cowfield
http://www.cowfields.com
Bow to the Cow!
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing information to PHPBB? joebeta PHP 2 10-08-2008 4:42 PM
Passing arrays burgermeister01@insightbb.com PHP 8 07-01-2007 3:56 PM
Passing arrays burgermeister01@insightbb.com PHP 0 07-01-2007 3:48 PM
Passing on POST data with Location: ^MisterJingo^ PHP 1 07-01-2007 3:40 PM
Network sharing and by-passing the public only Don Windows 0 05-29-2007 12:49 AM


Featured Websites




All times are GMT +1. The time now is 2:51 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98