PHP උදව්වක්

බකුනා

Well-known member
  • Apr 24, 2012
    1,847
    192
    63
    29
    අවතැන් වෙලා ඉන්න
    ඹට ඕනි පේජ් එකකට ඊඩිරෙක්ට් වෙද්දි රෙෆර් එක අපිට කැමති විදියකට වෙනස් කරල යවන්න

    උදා

    අපි www.myweb.com/page.php

    එකට ගියාම අපි දාපු සියිට් එකට ඒක රී ඩිරෙක්ට් වෙනව.. අපිට කැමති රෙෆර් URL එකකුත් දාගන්න පුලවන් වෙන්න ඕනි:rolleyes:
     

    superman1

    Well-known member
  • Apr 16, 2008
    1,099
    316
    83
    machan mata nam therenne nae umba kiyana eka.... sinhala walata garahanawa newei, syntaxes thiyenneth english walin nisa english walin programming prashne ahanne balapan!!!!!!
     

    superman1

    Well-known member
  • Apr 16, 2008
    1,099
    316
    83
    ucan use a tag in the url just like

    www.abcd.com/page.php?go="yourpage"

    $Site_u_want = $_GET['go'];

    or else u can put any fixed url

    $Site_u_want = 'www.myweb.com/page.php';

    and excecute it when you want

    header('Location: '.$site_u_want);
     
    • Like
    Reactions: බකුනා

    PirateZ

    Member
    Feb 3, 2009
    527
    117
    0
    It's not up to the server to send the referer. I't browsers job to do that. Not handled by the server or server side scripts
     

    බකුනා

    Well-known member
  • Apr 24, 2012
    1,847
    192
    63
    29
    අවතැන් වෙලා ඉන්න
    ucan use a tag in the url just like

    www.abcd.com/page.php?go="yourpage"

    $Site_u_want = $_GET['go'];

    or else u can put any fixed url

    $Site_u_want = 'www.myweb.com/page.php';

    and excecute it when you want

    header('Location: '.$site_u_want);

    ref wenas wenne nane.. mata ona wena site ekaka idan yanawa wage pennana

    www.[B]whatismyrefer[/B]er.com

    me site ekata redirect kalama eka balaganan puluwan
     

    බකුනා

    Well-known member
  • Apr 24, 2012
    1,847
    192
    63
    29
    අවතැන් වෙලා ඉන්න
    hari machan hoyagatta

    <?PHP

    $desired_referer = "http://www.example.com/";
    $site_z = "http://www.whatismyreferer.com/";

    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_REFERER, $desired_referer);
    curl_setopt ($ch, CURLOPT_URL, $site_z);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_exec ($ch);
    curl_close ($ch);

    ?>


    meka wada..

    thanks okkotama :)
     

    PirateZ

    Member
    Feb 3, 2009
    527
    117
    0
    බකුනා;16897809 said:
    hari machan hoyagatta

    <?PHP

    $desired_referer = "http://www.example.com/";
    $site_z = "http://www.whatismyreferer.com/";

    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_REFERER, $desired_referer);
    curl_setopt ($ch, CURLOPT_URL, $site_z);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_exec ($ch);
    curl_close ($ch);

    ?>


    meka wada..

    thanks okkotama :)

    It works because it executes within the server and request the webpage using php. Basically your php server is acting like a web browser using curl. That's not what you asked in the first place