Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2008, 09:38 PM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 06-29-2008, 03:02 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 06-29-2008, 04:00 AM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 06-29-2008, 04:30 AM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-29-2008, 04:57 AM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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);
Reply With Quote
  #6  
Old 06-29-2008, 10:11 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use the header() function.
Reply With Quote
  #7  
Old 06-29-2008, 10:36 AM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahhh working perfectly now, thanks very much to both of you for helping me
Reply With Quote
  #8  
Old 06-29-2008, 12:55 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:03 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.04186 seconds
  • Memory Usage 2,229KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete