Jump to content

open problem!!


d_barszczak

Recommended Posts

Um, I don't see any way you can do that.

 

The server shouldn't allow an external script to run like that. It would be a huge security problem.

 

Think about it, all I would have to do is right a script, and have it connect to your site and I would have all your personal files!

 

Now, on the other hand, it might be possible to pass your login information to the server so it will let you in, but I wouldn't have a clue as to how to do that...

 

I will have to do a search, It should be interesting....

Link to comment
Share on other sites

OK, I was reading an article about cross domain AJAX requests, it was really confusing and drawn out... So, the article might have been trying to say what I am thinking about.....

 

Anyways, this is what you could do. You could use AJAX to call a local PHP script. You could then use this local PHP script to call on a script at another server. You might try using the built in include() function to call it.3

 

You might have to play around with it, but it should work....

Link to comment
Share on other sites

Thanks for that,

 

Sounds a little complicated.

 

All i need is one value to get from javascript to php so it can be stored in a database.

 

Is it then possible for javascript to write a cookie at the begnining of the page and have php pick it up at the end?

Link to comment
Share on other sites

  • 2 weeks later...

I am creating a hitcounter script / traffic monitor and one of the stats i need is the users screen resolution. I can only get this from javascript. I then need javascript to pass the variable to php where i can save the value in a mysql database along with other bits of data it collects.

 

I have tried ajax but the counter can be used on any website and ajax will not work cross domain.

 

Please Please someone help me with this.

Link to comment
Share on other sites

I think i know the solution...

You can load in your script empty image... I saw somewhere code, and it looks something like that:

 

<script language="JavaScript">
var image_path = '<img src="http://example.com/script.php?res='+screen.width+'x'+screen.height+' "/>';
document.write(image_path);
</script>

 

Now in 'script.php' you can get users screen resolution from $_REQUEST array...

Link to comment
Share on other sites

  • 2 weeks later...

Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! Genius! What a guy. Just when i was about to give up on php & mysql and take up something easier like heavy weight boxing smart85 has saved the day.

 

Thanks a lot smart85!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.