Iframe that pops up words ?

Discussion in 'PHP' started by obeegoone, Dec 5, 2010.

  1. #1
    Hey, im trying to get a iframe pop up words from a file or something, it should only be able to pop up the word 1 time, i have googled but not much of a php coder so have no idea how this is builded, so if anyone could assist that would help much.

    Something like this perhaps http://www.freemmogamer.com/2010/12/pandora-saga-beta-key-giveaway.html

    But instead of keys i will have words
     
    obeegoone, Dec 5, 2010 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    
    <?php
    if(isset($_GET['test']) && strcmp($_GET['test'],'test') == 0)
    echo 'Test word';
    else
    echo '<a href="?test=test" target="_self">Click for test</a>';
    ?>
    
    PHP:
    
    <iframe src="test.php"></iframe>
    
    HTML:
    Something like that....but why don't you use ajax to return the result in a div ? Its much more 20th century...
     
    Last edited: Dec 6, 2010
    tvoodoo, Dec 5, 2010 IP
  3. obeegoone

    obeegoone Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks will try that code out, not sure how to use it with ajax, do you have a script or code for it that you could post ? :) Thanks alot for the post above

    *edit* it only gives me a big white square :( So they i tryed the whole url like www.mywebsite.com/randomword.php and gave me Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in /randomword.php on line 2
     
    obeegoone, Dec 6, 2010 IP
  4. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #4
    My bad , sorry...There were some errors in my code ... I just woke up when I first posted :) Check the code now as it is fixed.
     
    tvoodoo, Dec 6, 2010 IP
  5. obeegoone

    obeegoone Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Awsome thank you very much ? It dosent show same word twice right ? And how do i make so its more then 1 word ? :) Thanks alot
     
    Last edited: Dec 6, 2010
    obeegoone, Dec 6, 2010 IP
  6. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Well , it actually hide's the link that you should click on showing the word...but if you keep the link it will show the same word twice...
    You asked about how to make it , you didn't say you need to generate something unique or read it from a database...
    Give me more info on what you want to accomplish...
     
    tvoodoo, Dec 6, 2010 IP
  7. obeegoone

    obeegoone Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Okey sorry i wasent clear on my question, im trying to make just like this http://www.freemmogamer.com/2010/11/archlord-dragon-scion-beta-key-giveaway.html

    This is what im trying to get to my website
    Click here to get your key!
    THERE ARE : 1224 KEYS LEFT TO GIVEAWAY

    But instead i will be using words instead off keys but will work the same way :)

    I have no idea if he post all the keys in a file or in a post (he uses wordpress so am i)

    I really appriciate your help
     
    obeegoone, Dec 6, 2010 IP
  8. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #8
    What he does there is probably something like this :
    1.Stores all codes in a database (or randomly generates each code)
    2.Fetch a code from the database (or show the random code generated and insert it into a table of codes that should be used )

    This is easy to do and I don't feel like create the whole code for you.Google it you will find plenty examples for this topic.
     
    tvoodoo, Dec 6, 2010 IP
  9. obeegoone

    obeegoone Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hmm okey but wouldent that make tons off databases for each iframe i want ? :/ Been searching for iframe guides,examples but cant find what i want :( Will keep searching, thanks
     
    obeegoone, Dec 6, 2010 IP
  10. backlinkneeded

    backlinkneeded Member

    Messages:
    285
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #10
    try this .
    Stores all codes in a database (or randomly generates each code)
    2.Fetch a code from the database as Tvoodoo said. it will work.
     
    backlinkneeded, Dec 22, 2010 IP