::Get string from url::..How to..

Discussion in 'HTML & Website Design' started by omar_391, Mar 26, 2009.

  1. #1
    Suppose i have to files named 'main.html' and 'go.html' in same directory.
    and the url of -
    main.html = http://...../main.html?id=123

    Now i want to read this string 123 and place it in an iframe inside main.html.

    as like-

    <html>
    
    <body>
    
    <iframe style="vertical-align: middle;" height="30%" [U]SRC="go.html[B]#id[/B]"[/U] scrolling="auto" width="100%" 
    
    frameborder="0"></iframe>
    
    </body>
    </html>
    Code (markup):
    is there any way i could get that string in SRC="go.html#id n replace id with 123.

    i thought SRC="go.html#<? print($id) ?>" may work.but it didnt.
    my host doesnt support url_fopen and curl..thats the problem..so php echo didnt work..

    plz show a way guyz...i thing its nothing difficult for u ..

    p/s:what do u think about javascript..?
     
    omar_391, Mar 26, 2009 IP
  2. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #2
    I don't know anything about JavaScript, but you can easily do it with PHP. If the url is main.php?id=123 ...

    <? $mynumber = $_GET['id']; ?>

    SRC="go.html#<? echo $mynumber; ?>"
     
    Kerosene, Mar 27, 2009 IP
  3. boompie

    boompie Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Agreed; PHP or Perl are the way to go.
    Carl
     
    boompie, Mar 27, 2009 IP