Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts

    help with popup field

    how do I go about putting a popup field

    say it like this the nick come back empty so if it does I want user to put in a nick next to Guest_ by using a popup

    Code:
      if ($nickname=="") {
    	$nickname = "Guest_";
      }

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,234
    Thanks
    51
    Thanked 100 Times in 99 Posts
    As in a little alert box that says a message? if so that's Javascript.
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    like if the nick null a box popup then u put a nick in

  • #4
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    other thing I can think of is adding randoms numbers how would I do that ?


    if ($nickname=="") {
    $nickname = "Guest_(.Rand 100/100000)";
    }

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    PHP Code:
    if (empty($nickname))
    {
        
    $nickname 'Guest_' rand(100100000);

    Although you'd probably be better off pulling off of time.

    As for a popup, as mentioned that is not PHP, its client side technology like Javascript.

  • Users who have thanked Fou-Lu for this post:

    Whatnot (04-21-2012)

  • #6
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Thank you


  •  

    Posting Permissions

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