Results 1 to 6 of 6

Thread: Login form, webmail..

  1. #1
    Join Date
    Mar 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Login form, webmail..

    Hi,

    Have a problem.. I have a simple login form on my homepage and it looks like this:

    <FORM target="_blank" action="http://webmail1.b-one.net/src/redirect.php" method=post>
    <table width="30%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td>
    <INPUT type=hidden value="<?php echo $url; ?>" name=login_domain>
    Email-adress:<br /><input type="text" value="" name=login_username class="inputbox" size="25" /> <br />
    Password:<br /><input type="password" value="" name=secretkey class="inputbox" size="25" />
    <INPUT type=hidden value=0 name=js_autodetect_results>
    <INPUT type=hidden value=1 name=just_logged_in>
    <INPUT type="submit" name="Submit" class="button" value="Logga in" />
    </td>
    </tr>
    </table>
    </FORM>

    When you login you have to write the hole emailadress, ie larza@bootleg.be. Since all logging in to this site will be using domain @bootleg.be i would like to change email field to username and then automaticly send "username"+@bootleg.be with this form. Any solution? Im logging into to a distance mailserver so I canīt change anything there, the info has to be sent with the form..

    //Johan Larsson

  2. #2
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    I would just add a hidden field with the domain and then stitch them together on the server-side - like you have for login_domain.

  3. #3
    Join Date
    Mar 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry but the script wasnīt acurate.. The hidden string is not used.. so this is the correct one.. Donīt know how to use hidden values.. So what I should do is add something else as hidden value and name that on as "secretkey" and in this value add what is put in to field password and add @bootleg.be?


    How do I code this?

    <FORM target="_blank" action="http://webmail1.b-one.net/src/redirect.php" method=post>
    <table width="30%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td>

    Email-adress:<br /><input type="text" value="" name=login_username class="inputbox" size="25" /> <br />
    Password:<br /><input type="password" value="" name=secretkey class="inputbox" size="25" />
    <INPUT type=hidden value=0 name=js_autodetect_results>
    <INPUT type=hidden value=1 name=just_logged_in>
    <INPUT type="submit" name="Submit" class="button" value="Logga in" />
    </td>
    </tr>
    </table>
    </FORM>

  4. #4
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Hidden form inputs are no different from standard form inputs except they are not rendered by a browser (they just appear in the source view).

    so if you add a hidden input like this
    Code:
    <input name="email_domain" type="hidden" value="bootleg.be" />
    to your form, the value would come through in your post data under the name 'email_domain', so append that onto the email address prefix that the user supplies as their login name with your server-side script.
    PHP Code:
    $email $_POST['login_username'].'@'.$_POST['email_domain']; 

  5. #5
    Join Date
    Mar 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmmm.. Okey, i get this hidden field thing at least (not much ), basic..

    The values "login_username" and "secretkey" are the ones sent to "http://webmail1.b-one.net/src/redirect.php" (which i donīt controll).

    So what i should do is to change the value "login_username" to "username+emaildomain".

    So if I make a normal textfield with name "username" and a hidden field with name emaildomain and put value to @bootleg.be. How can I merge theese into form value "login_username"?

    Can I on the same page before I "posted" put a value from a textfield to a variable and then merge these?


    <input type="hidden" value="$_POST['username'].$_POST['emaildomain']
    " name=login_username>

    I guess you canīt do anything like that since the info has to be "posted" first?

    Sorry if iīm beeing a pain in the as.. After i fixed this iīm going to surf into php.net and study for a while..

  6. #6
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    You could probably do something with javascript, but obviously it wouldn't be available to people without javascript enabled. You could post the form to an intermediate page that you do have control of, and carry out the logic there, but that would be over the top IMO. I don't think there is a way of concatenating form variables using pure html markup. Maybe you can just make the initial value of the text field equal to the domain? People might find this more irritating than helpful though as the text is normally highlighted when you focus the field.
    Probably what you want to ask yourself at this point is, is it worth the bother!

    Maybe somebody else has a good idea, but I'm afraid I'm all out.

    sorry>.<

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HTML: Custom Helm Login Form
    By Warren Ashcroft in forum Code Sharing
    Replies: 17
    Last Post: 28th September 2006, 02:33 PM
  2. webmail login
    By amac10 in forum ASP.NET
    Replies: 1
    Last Post: 27th June 2006, 04:52 PM
  3. Webmail login from own page
    By Shiven Rabadia in forum Development Support
    Replies: 5
    Last Post: 12th March 2006, 08:56 PM
  4. Form-ASP Help!?
    By JamesU2002 in forum General Technical Support
    Replies: 13
    Last Post: 29th January 2006, 10:11 PM
  5. PHPMyAdmin login
    By slippers in forum Technical Support
    Replies: 3
    Last Post: 28th November 2005, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •