Results 1 to 4 of 4

Thread: How to insert a value to a hidden field?[resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509

    Question How to insert a value to a hidden field?[resolved]

    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:44 PM.

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    use POST as your method instead of GET. Put a hidden textbox on your form and set the value equal to the HDD serial # pulled from the DB...

    ??? Or am I missing something? Also, make sure you validate the HDD # after it's submitted to make sure they haven't hacked it.

    I didn't read the entire post, but that seems like what you want to do.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    ober, you can't verify if the serial is valid or not if it hasn't already been recorded, and since he's submitting on a PHP page from a VB browser control, it means you won't be able to verify it.

    now, onto the question. since your webbrowser control is hidden, you're going to need two VB textboxes in your program and one command button.. so, you could use something like this in your vb program:

    VB Code:
    1. 'this example assumes that:
    2. 'your username textbox = txt_user
    3. 'your password textbox = txt_pass
    4. 'your register command button = cmd_register
    5. 'your webbrowser control = wb_browse
    6. 'the var you store the serial number in = serial
    7. Private Sub cmd_register_Click()
    8.   Dim link
    9.   link = "http://www.yoursite.com/register.php?"
    10.   wb_browse.Navigate link & "user=" & txt_user.Text & _
    11.                             "pass=" & txt_pass.Text & _
    12.                             "serial=" & serial
    13. End Sub

    ok, now onto the register script.. since you can't submit that automatically through post, you're going to be using get.. also, since you said you want to hide a value on a form, well, what's the point? you shouldn't even bother, since your web browser control isn't even visible, and the user can't click a button that says register to do anything.. I suggest you rethink the way you want this setup, and find out what can and what can't do.. anyway, back to what you asked. how to hide an object on an html form and have it's value equal to that of "?serial=serial" in the vb form:

    PHP Code:
    <input type="hidden" name="serial" value="<?=$_GET['serial'];?>">
    That will put the value of the GET request 'serial' into the hidden HTML form value 'serial'.

    I advise that you instead create a PHP form that is placed into a web browser control that IS visible in your VB program, so that the user enters the username and password and presses submit, while there is a "?serial=" link that you originally go to for the user to enter the username and password. The location of the site will be recorded in the user's IE history, but unless you show the location on the form, it will not be visible to the user. I think you're going about this all wrong.. but I don't even know what you're really doing, so, whatever. This is entirely possible to do the way you want to and are right now, it just requires that you know a little about what you're doing. You could use the VB form I made and then make a register script that grabs the information to register from the $_GET var, and that will work fine.. I'm pretty much just babbling now though..

    hope I helped a bit.
    Like Archer? Check out some Sterling Archer quotes.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509

    Thumbs up

    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:52 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width