vb.org Archive

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

invitezone 06-28-2008 09:38 PM

php linking
 
Hi there,
I have a simple php login script but need to change something slightly

Code:

$msg                = 'Password incorrect.';



<form action="" method="POST">
                        <p>
                          <input type="password" name="password" size="20">
                          &nbsp;
                          <input type="submit" value="Login">
                          <input type="hidden" name="sub" value="sub">
        </p>
  <div class=error><?=$msg?></div>


instead of displaying the password incorrect message i would like to send the user to a url with their whatever they put as the password on the end

eg. www.mysite.com/1.php?substring=XXXX

where XXXX is their input


could some explain how I could do that please

thanks a lot

MoT3rror 06-29-2008 03:02 AM

You can use the function exec_header_redirect when the login is invalid but I suggest highly not to redirect with the password already input. Sending a password in plain text is not a good thing to do. Also some browsers have problems with forms that have blank as the action or no action.

invitezone 06-29-2008 04:00 AM

thankyou for your answer but would you be able to show me how to use it? im new to this and I cant seem to make it work.

Do I do something like....

$msg = exec_header_redirect("www.mysite.com/1.php?substring=");

and also how do I add the incorrect password on the end?

thanks for your help.

MoT3rror 06-29-2008 04:30 AM

exec_header_redirect is a function that does the redirect, I don't believe it returns anything.

PHP Code:

if() //invalid login
{
exec_header_redirect("1.php?substring=" $password);


But like I said it is not good security wise to send the password in plain text or in any encryption that can easily be unencrypted.

invitezone 06-29-2008 04:57 AM

ok thanks i'll give that a try.

ps. im not using this to create a secure login or anything, im just adapting a login script to fit my needs. There will be the proper vbulletin login after this.

--------------- Added [DATE]1214721236[/DATE] at [TIME]1214721236[/TIME] ---------------

hmmm im getting the error
Code:

Fatal error: Call to undefined function exec_header_redirect() in /home/invitezo/public_html/home.php on line 388
line 388 is

Code:

exec_header_redirect("1.php?substring=" . $password);

Opserty 06-29-2008 10:11 AM

Use the header() function.

invitezone 06-29-2008 10:36 AM

ahhh working perfectly now, thanks very much to both of you for helping me

Dismounted 06-29-2008 12:55 PM

exec_header_redirect() is a vBulletin function and will only work if its files are included.


All times are GMT. The time now is 01:05 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.01040 seconds
  • Memory Usage 1,731KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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