How to send A string with url ??

hello there ! :slight_smile:

Am working on my senior project , and i almost done but there is one issue (The last step I hope)

the problem is that I don’t know how to send a value (string) to an html or php page using (url) in js

I did use a code from the scripting manual but it gives me this error (unknown identifier “www”)

i don’t know if the script that i use is correct i just want some help to be able to send the string :face_with_spiral_eyes:

http://unity3d.com/support/documentation/Manual/Unity%20Web%20Player%20and%20browser%20communication.html

You need to use the class WWW and not www.
JavaScript is case sensitive, Iam not sure about UnityScript but I suspect its too.

guys , i need a way to send the the value with the url to another web page

if this could help ( you could just tell me how to redirect from the unity player page to any other one)

Without your code, nobody can make an informed recommendation.

the problem is that I don’t have a code , i just wana ask if it’s possible to make a button that could redirect me from the unity application page to another URL (that’s can help or give me a clue or a hint to start working on it ) ??

NPSF3000 postet already everything you need:

Executing arbitrary browser code from Unity web player content

You don’t even have to define functions in the embedding web page, instead you can use the Application.ExternalEval() function to execute arbitrary browser code from the web player content.

The following example checks that the page embedding the web player content is fetched from a certain host (unity3d.com), if that’s not the case then it will redirect to another URL. This technique can be used to prevent deep linking to your web player content:

Application.ExternalEval(
    "if(document.location.host != 'unity3d.com') { document.location='http://unity3d.com'; }"
);

i think it might help , thanx for everything guys , :slight_smile:

If you want to send along a value to the redirect you will need to do what Marrrk posted and simply add some GET parameters to the end of the url:

var foo = "foo";
Application.ExternalEval( "document.location='http://yoursite.com/script.php?string='" + foo + "';");

)

Antitheory , thanks a lot ,now i get it ,

thanks every body for helping me , I’ll add a special thanks for you guys in the acknowledgment of my senior documentation :slight_smile: :slight_smile: