A proxy php script for one website - php

I'm looking for something that I'm not sure it exist.
If not I'm happy to get directions to do it.
I rent a proxy from a proxy company, so I have an IP, username and password to use it.
I would like to put those informations in a php script, then be able to surf through the proxy using this php script.
This will give me the opportunity to give the link to other person without them to have to change the config in them browser.
Thanks in advance

Something like this may be what you are looking for
http://freshmeat.net/projects/phpproxy/
Do a search in Google for PHP Proxy, there are many for your needs.

Related

PHP user-level session persistence

I have a use case where I need to be able to access my site from the local server. Specifically, it's for a HTML-to-PDF export of parts of various pages, but this would be nice for testing parts of the website as well.
The problem is that we have a login splash page, which needs to be dealt with before I can access any parts of the website. It would be really nice if I could just call a command "wkhtml2pdf 'localhost/[myurl]'" and have it PDF some stuff, but it hits this splash page.
Is there some way that I can perma-persist just one single session on the server? Or enable login-less access from localhost? Or could I just add a new Apache entry that accesses our site, whitelists only localhost and somehow circumvents the login?
What's the best solution?
You can pass your session cookie as parameter in wkhtml2pdf to solve your problem.
You can also execute it from a php file like this.
exec("wkhtmltopdf --cookie '{$cookieName}' '{$cookieValue}' http://example.com");
Soliciting feedback on this solution now:
I whitelisted localhost via $_SERVER['REMOTE_ADDR'] in the login scripts to bypass the usual user authentication and get an automatic localhost-user login. The server is running, however, on a university LAN, so the LAN maybe really big, possibly enabling bidirectional TCP spoofing.
Should I be worried about this, or does someone need admin rights on the routers or something? I trust the IT folks, but not others.
I realize that this sounds like a separate question, but I feel that security relates to whether or not this is a good solution.

PHP running a session through a proxy?

Basically, what I have is an account checker that needs to be ran through the use of proxies. The way I need it to work is, the user can place a proxy list into the site and the PHP script will connect through a proxy, gradually going down the list as 1 proxy for ever 2 accounts.
Account list format: email:password
Proxy list format: IP:Port
Is this possible?
If so, where do I start to look as I have no clue at the moment, I thought maybe someone on here could help?
Regards,

Change IP where domain is pointing

This is probably a very strange request.
I need to programmaticaly (via code) change the IP where a domain name is pointing to.
IE: xyz.com points to 100.100.100.100
setIP('xyz.com','100.100.100.100');
I know this [code] is practically impossible, however, what I need is to do this via domain host API etc or other possible ways you might think of.
I'd be happy even if it weren't anything more then sending an email to the DNS owner/host.
Do you know of anything the like or which might help?
(nb: considered throwing this at ServerFault, but felt it more at home here ;) )
Cheers!
You're looking for a Dynamic DNS provider, such as No-IP or DynDNS.
They have HTTP APIs that allow you to change the A records.
It really depends on the setup, where you are doing it from and for what reason?
I guess you are not running a DNS server yourself or hosting the(se) domains either, if you were then this is relatively easy.
More information on what you are trying to achieve using what technology would be helpful.
There is an API class called "WMI API", which can be used to manage your stuffs using code/program. please try the below URL.
http://www.delphi3000.com/articles/article_4392.asp

PHP - Is possible to find if user is browsing from beind a Router and get Router Info

Hello guys.
I think it isn't possible just using PHP, but just to be sure.
Is it possible for PHP to know if the
user is accessing the web from behind
a Router?
And if yes, how can i get some
information about that router, like:
Router Name, Brand, Serial Number, ...
Users connected in the same network.
Can PHP also find the Local IP
Address for the visitor in that
Network?
A few simple questions. To which i haven't found a solid answer, and i tough that some PHP genius could tell me. And teach me.
Thanks for your help.
EDIT: Motives for this privacy invasive question
I didn't thought that i had to say this... But i guess i do
I was writing a couple functions that would get the browser preferred languages and finding out from which Country the user comes based on the IP, to deliver my website content in the right language to the visitor.
Then i started to think, most people browse from behind the router, can i find out if they are indeed?
Then it just came to my mind to do one of those simple programs that display network details, people connected on your network. My idea was to do that, but Web App Based not Desktop App Based as all other programs of this kind.
I appreciate privacy above everything as most developers do, so i kind of understand the Down Votes, i would probably Down Vote myself.
I'm sorry if you misjudge me due to my weird question, i have nothing to do so.. These things just popped up on my head.
First, are you talking about finding out information about users visiting your website? Keep in mind that this implies an intrusion into their privacy (you can try it with yourself though ;))
Is it possible for PHP to know if the user is accessing the web from behind a Router?
No you cannot. Only when you know that e.g. you have a lot visitors from one company and they all have the same IP address, they might be behind a router but it could also be a proxy.
And if yes, how can i get some information about that router, like:
Router Name, Brand, Serial Number, ...
If you have the IP you might be able to discover various things about a host with tools such as nmap. You might be able to find out the brand of a router and host system but definitely not serial number and such stuff. nmap is not PHP though.
Note: The use of such tools without permission to do so is illegal in some countries. In any way, the use of such tools without permission is morally questionable .
Users connected in the same network.
As I mentioned in the first question, if you have different users with the same IP address they might be in the same network. They could also be in different sub-networks. Anyway you cannot get their local IP addresses.
Can PHP also find the Local IP Address for the visitor in that Network?
See previous answer.
You see, everything is very vague and mostly based on assumptions. You cannot get reliable information and I am very glad that we are not totally transparent yet.
Once we all use IPv6, the whole story is a different one.
I have no idea what you're trying to do, but it worries me a little.
So I'm glad that (as you suspected) it's not possible.
All the details you're asking about is information that there's no reason for anyone outside the local network to need, it would be a huge security problem if a router was broadcasting this to the world.
It is not possible, by the design of the network protocols.
However, some routers uses special builds of PHP in its admin control panels.

Advice regarding either a web based FTP or a File Sending service

I could use some advice.
I'm building a website in which the general user needs to be able to transfer files to the site administrator. It could be done one of two ways:
1] Some kind of web based interface - PHP perhaps - to send files to the FTP. I've done some Googling but have yet to come up with anything concrete that works. I've considered using an Applet but I need something free. Also, it seems to me that people are hesitant to give Applets permission to run in their browser.
2] Some kind of file transfer service. I've looked at services like Megaupload but using a free account, the files are public and that will not work. I need something that a user could use to send a file to the administrator who could pick it up later.
If anyone has some suggestions, it would be appreciated.
Thanks in advance.
You can do file upload via http if you have enough space (which I assume since you also have access to a ftp server). See here for more information.

Categories