vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Remote login (https://vborg.vbsupport.ru/showthread.php?t=214581)

g3nti 05-26-2009 11:58 AM

Remote login
 
Hi all,

Code:

function curl_vb($url,$data,$cookie,$method='POST')
        {
       
               
                $ch = curl_init();
               
                // set the target url
                curl_setopt($ch, CURLOPT_URL,$url);
               
                // howmany parameter to post
                curl_setopt($ch, CURLOPT_POST, count($_POST));
               
                // the parameter 'username' with its value 'johndoe'
                curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
               
                //cookie?!?!
                curl_setopt($ch, CURLOPT_COOKIE, $cookie);
               
                $result= curl_exec ($ch);
                curl_close ($ch);
                print $result;
                       
       
        }

i'm using this script to try to login remotely to my vb. Login runs perfectly but the user logged on my forum has the same ip of the server. any idea?

Cryo 05-26-2009 12:43 PM

Since it's done in PHP the server itself is doing the request, and the IP is based off of the requesting machine. The only way to show their IP would be to pass it off in a variable and do an update of the appropriate records.

UKBusinessLive 05-26-2009 04:20 PM

Hi g3nti

I use this method of login on my main site to let members sign up or register

Code:

<a href="http://www.ukbusinesslive.co.uk/forum"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/Forum-pic.jpg" border="0" ></a>
<a href="http://www.ukbusinesslive.co.uk/forum/register.php">Register Free NOW!</a>
<form action="http://www.ukbusinesslive.co.uk/forum/login.php?do=login" target="_new" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
            <input type="hidden" name="do" value="login" />
            <input type="hidden" name="url" value="/forum" />
            <input type="hidden" name="vb_login_md5password" />
            <input type="hidden" name="vb_login_md5password_utf" />
            <input type="hidden" name="s" value="$session[sessionhash]" />
            <label>Username:<input name="vb_login_username" type="text" id="login" tabindex="1" class="bginput" accesskey="u"/></label>
            <label>Password:<input name="vb_login_password" type="password" id="password" tabindex="1" class="bginput" /></label>
      <label>Remember me?<input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" /></label>
            <input name="submit" type="submit" id="submit" tabindex="1" value="Login" accesskey="s" class="button" />
     
</form>

Its just basic HTML and so easy, looks impressive too, just change my details at the begining of the code for yours, its pretty self explanitary.

https://vborg.vbsupport.ru/external/2009/05/7.png

Let me know how you got on if you decide to use it ;)

:D


All times are GMT. The time now is 01:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01031 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete