Jump to content

jarv

Members
  • Posts

    325
  • Joined

  • Last visited

Posts posted by jarv

  1. You have to move the query also.

     

    Ken

     

    but i have done this

     

    <?
    include_once("config.php");
    $result = mysql_query("SELECT * FROM Headertbl ORDER BY HeaderDate DESC");
    
    
    while($row = mysql_fetch_array($result))
    
    
    {
    echo '<div id="entry" class="wrap">';
    $HeaderID = $row['HeaderID'];
    $HeaderImage = $row['HeaderImage'];
    $HeaderDate = $row['HeaderDate'];
    $HeaderPhotoNo = $row['HeaderPhotoNo'];
    $HeaderName = $row['HeaderName'];
    $PhotoID = $row['PhotoID'];
    $CountryID = $row['CountryID'];
    
    
    
    $result1 = mysql_fetch_array(mysql_query("SELECT * FROM Headertbl LEFT JOIN country ON Headertbl.CountryID = country.CountryID"));
    $Country = $result1['country'];
    
    echo <<<EOF
      <div class="entry_header">
        <b>Header Name:</b> $HeaderName <a href="edit.php?HeaderID=$HeaderID">Edit Header</a> | <a href="delete.php?HeaderID=$HeaderID">Delete Header</a><br />
     <a href="upload.php?HeaderID=$HeaderID">Change Header</a><br />
      <a href="http://www.avert.org/photo_search.php?search_keyword_id=&search_country_id=country-$CountryID&page_type=thumbnails&search=search">Other pictures from $Country</a><br />
    <b>PhotoID:</b> $PhotoID <br />
    <b>Header Photo No:</b> $HeaderPhotoNo <br />
    <b>Header Date:</b> $HeaderDate <br />
    <img src="headers/$HeaderImage">
      </div>
    EOF;
    }
    
    ?>

     

  2. ok here is my code my problem is is that $Country shows

    CHINA

    CHINA

    CHINA

    CHINA

    and so on... in the loop

    CHINA is HeaderID = 1 the next one in the Headertbl table is USA but that doesn't show?!

     

    <?php
    include_once("config.php");
    include_once("functions.php");
    // Check user logged in already:
    // checkLoggedIn("yes");
    doCSS(); ?>
    <div id="header">
    <p class="wrap">
    
    <? print("\n <a href=\"post.php"."\">+ Add new header</a> ");?>
    </p>
    <h1 class="wrap">Avert Weekly Headers</h1>
    </div>
    <?
    include_once("config.php");
    $result = mysql_query("SELECT * FROM Headertbl ORDER BY HeaderDate DESC");
    $result1 = mysql_fetch_array(mysql_query("SELECT * FROM Headertbl LEFT JOIN country ON Headertbl.CountryID = country.CountryID"));
    
    $Country = $result1['country'];
    ?>
    
    <? print($result1['country']);?>
    <?
    while($row = mysql_fetch_array($result))
    
    
    {
    echo '<div id="entry" class="wrap">';
    $HeaderID = $row['HeaderID'];
    $HeaderImage = $row['HeaderImage'];
    $HeaderDate = $row['HeaderDate'];
    $HeaderPhotoNo = $row['HeaderPhotoNo'];
    $HeaderName = $row['HeaderName'];
    $PhotoID = $row['PhotoID'];
    $CountryID = $row['CountryID'];
    
    
    
    
    $output =<<<EOF
      <div class="entry_header">
        <b>Header Name:</b> $HeaderName <a href="edit.php?HeaderID=$HeaderID">Edit Header</a> | <a href="delete.php?HeaderID=$HeaderID">Delete Header</a><br />$Country
     <a href="upload.php?HeaderID=$HeaderID">Change Header</a><br />
      <a href="http://www.avert.org/photo_search.php?search_keyword_id=&search_country_id=country-$CountryID&page_type=thumbnails&search=search">Other pictures from </a><br />
    <b>PhotoID:</b> $PhotoID <br />
    <b>Header Photo No:</b> $HeaderPhotoNo <br />
    <b>Header Date:</b> $HeaderDate <br />
    <img src="headers/$HeaderImage">
      </div>
    EOF;
    echo $output;
    echo '</div>';
    }
    
    mysql_close($link);
    ?>

  3. I just put

    $SQL="CREATE TABLE assessment ( 
    ID int NOT NULL auto_increment, 
    Assessor varchar(50) NOT NULL default '', 
    page varchar(100) binary NOT NULL default '', 
    Assessment longtext(0) binary NOT NULL default '', 
    assignedto varchar(100) binary NOT NULL default '', 
    section varchar(15) binary NOT NULL default '', 
    grade int(11) binary NOT NULL default '', 
    action longtext(0) binary NOT NULL default '', 
    PRIMARY KEY (ID), 
    )";
    mysql_query($SQL);
    
    
    $SQL1="CREATE TABLE users ( 
    ID int NOT NULL auto_increment, 
    Assessor varchar(50) NOT NULL default '', 
    login varchar(100) binary NOT NULL default '', 
    password varchar(100) binary NOT NULL default '', 
    PRIMARY KEY (ID), 
    )"; 
    mysql_query($SQL1);

     

    in my config.php file which is an include on my index.php and nothing happens, I get: Page cannot be found!

  4. http://mypubspace.110mb.com/cms/

     

    error reads:

     

     

    Warning: require(/www/110mb.com/m/y/p/u/b/s/p/a/mypubspace/htdocs/cms//administrator/components/com_comment/config.comment.php) [function.require]: failed to open stream: No such file or directory in /www/110mb.com/m/y/p/u/b/s/p/a/mypubspace/htdocs/cms/mambots/content/moscomment.php on line 26

     

    Fatal error: require() [function.require]: Failed opening required '/www/110mb.com/m/y/p/u/b/s/p/a/mypubspace/htdocs/cms//administrator/components/com_comment/config.comment.php' (include_path='.:/usr/share/php') in /www/110mb.com/m/y/p/u/b/s/p/a/mypubspace/htdocs/cms/mambots/content/moscomment.php on line 26

     

     

    can someone please help!

  5. so i changed all the publics to vars now i get an error on line 90:

     

    PHP Parse error: parse error, unexpected T_RETURN

     

     

    
    function do_get_session($auth_token) {
        try 
    {
          return $this->api_client->auth_getSession($auth_token);
        } catch (FacebookRestClientException $e) 
          // API_EC_PARAM means we don't have a logged in user, otherwise who
          // knows what it means, so just throw it.
          if ($e->getCode() != FacebookAPIErrorCodes::API_EC_PARAM) {
            throw $e;
          }
        }
      }

     

  6. ok so i am working my way through the facebook app tutorial from .net magazine issue 172 (feb 2008)

    I have all the files from the CD and the SQL file which i have set up the mySQL database I have added my secret code and app API code to my config.php file, I am not sure what to do next?!

     

    when i go to the index.php file i get the following error:

     

    PHP Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in e:\Domains\mypubspace.com\wwwroot\fb\client\facebook.php on line 37

  7. http://mypubspace.110mb.com/

     

    still doesn't work, i put it into the following 3 pages?!

    <?
    $email = $row['email'];
    $email = str_replace("\x40", "@", $email);
    echo $email; // this will give you the new email address with @
    // GET NETWORK TO IMPORT FROM
    
    $get = $_GET["domain"];
    
    if (empty($get)){
    
    $script = "myhotmail.php";
    
    $img = "myhotmail.gif";
    
    }else{
    
    $script = $get.'.php';
    
    $img = $get.'.gif';
    
    }
    ?>
    
    
    
    <HEAD>
    
    <SCRIPT LANGUAGE="Javascript">
    
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    function emailCheck (emailStr) {
    /* The following pattern is used to check if the entered e-mail address
       fits the user@domain format.  It also is used to separate the username
       from the domain. */
    var emailPat=/^(.+)@(.+)$/
    /* The following string represents the pattern for matching all special
       characters.  We don't want to allow special characters in the address. 
       These characters include ( ) < > @ , ; : \ " . [ ]    */
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
    /* The following string represents the range of characters allowed in a 
       username or domainname.  It really states which chars aren't allowed. */
    var validChars="\[^\\s" + specialChars + "\]"
    /* The following pattern applies if the "user" is a quoted string (in
       which case, there are no rules about which characters are allowed
       and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
       is a legal e-mail address. */
    var quotedUser="(\"[^\"]*\")"
    /* The following pattern applies for domains that are IP addresses,
       rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
       e-mail address. NOTE: The square brackets are required. */
    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
    /* The following string represents an atom (basically a series of
       non-special characters.) */
    var atom=validChars + '+'
    /* The following string represents one word in the typical username.
       For example, in john.doe@somewhere.com, john and doe are words.
       Basically, a word is either an atom or quoted string. */
    var word="(" + atom + "|" + quotedUser + ")"
    // The following pattern describes the structure of the user
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
    /* The following pattern describes the structure of a normal symbolic
       domain, as opposed to ipDomainPat, shown above. */
    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
    
    
    /* Finally, let's start trying to figure out if the supplied address is
       valid. */
    
    /* Begin with the coarse pattern to simply break up user@domain into
       different pieces that are easy to analyze. */
    var matchArray=emailStr.match(emailPat)
    if (matchArray==null) {
      /* Too many/few @'s or something; basically, this address doesn't
         even fit the general mould of a valid e-mail address. */
    alert("Email address seems incorrect - Please type a valid email address")
    return false
    }
    var user=matchArray[1]
    var domain=matchArray[2]
    
    // See if "user" is valid 
    if (user.match(userPat)==null) {
        // user is not valid
        alert("The username doesn't seem to be valid.")
        return false
    }
    
    /* if the e-mail address is at an IP address (as opposed to a symbolic
       host name) make sure the IP address is valid. */
    var IPArray=domain.match(ipDomainPat)
    if (IPArray!=null) {
        // this is an IP address
      for (var i=1;i<=4;i++) {
        if (IPArray[i]>255) {
            alert("Destination IP address is invalid!")
    	return false
        }
        }
        return true
    }
    
    // Domain is symbolic name
    var domainArray=domain.match(domainPat)
    if (domainArray==null) {
    alert("The domain name doesn't seem to be valid.")
        return false
    }
    
    /* domain name seems valid, but now make sure that it ends in a
       three-letter word (like com, edu, gov) or a two-letter word,
       representing country (uk, nl), and that there's a hostname preceding 
       the domain or country. */
    
    /* Now we need to break up the domain to get a count of how many atoms
       it consists of. */
    var atomPat=new RegExp(atom,"g")
    var domArr=domain.match(atomPat)
    var len=domArr.length
    if (domArr[domArr.length-1].length<2 || 
        domArr[domArr.length-1].length>3) {
       // the address must end in a two letter or three letter word.
       alert("The address must end in a three-letter domain, or two letter country.")
       return false
    }
    
    // Make sure there's a host name preceding the domain.
    if (len<2) {
       var errStr="This address is missing a hostname!"
       alert(errStr)
       return false
    }
    
    // If we've gotten this far, everything's valid!
    
    return true;
    document.emailform.reset();
    
    }
    //  End -->
    </script>
    
    <script language="javascript1.3" src="js/ahah.js" ></script>
    
    
    </head>
    
    <body>
    <div align="center">
      <center>
    <table border="0" width="498">
                              <tr>
        <TD width="551"><IMG height=2 alt="" src="images/spacer.gif" 
          width=1 border=0></TD>
                              </tr>
                              <tr>
        <TD align=middle width="551">
          <TABLE cellSpacing=0 cellPadding=0 width=494 border=0>
            <TBODY>
            <TR>
              <TD width=5 height=5><IMG height=5 alt="" 
                src="images/tls.gif" width=5 border=0></TD>
              <TD background="images/t.gif" colSpan=4 width="532"><IMG 
                height=1 alt="" src="images/spacer.gif" width=1 
                border=0></TD>
              <TD width=36 height=5><IMG height=5 alt="" 
                src="images/trs.gif" width=5 border=0></TD></TR>
            <TR>
              <TD width=5 background="images/l.gif" 
                height=5><IMG height=5 alt="" 
                src="images/spacer.gif" width=5 border=0></TD>
              <TD width=6><IMG height=1 alt="" 
                src="images/spacer.gif" width=6 border=0></TD>
              <TD vAlign=top width=496>
              
    <!-- Start of Form -->
              
    <form name=emailform action="javascript:submit('<?= $script ?>', 'POST');"  method=post onSubmit="return emailCheck(this.username.value);"> 
    
                <TABLE cellSpacing=0 cellPadding=5 width=468 align=center 
                bgColor=#ffffff border=0>
                  <TBODY>
                  <TR>
                    <TD vAlign=top height=44 width="141"><IMG src="images/<?= $img ?>"> 
                    <TD class=txt_sucks style="COLOR: #223f7a; PADDING-TOP: 12px" 
                    width=307>
                      <p align="left"><b><font face="Arial" size="2">      
    				IMPORT MY CONTACTS</font></b></TD></TR>
                  <TR>
                    <TD vAlign=top width=439 colspan="2">
    			<div align="center">
                        <center>
                      <table border="0" width="104%" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="100%">
                            <table border="0" width="100%" cellspacing="1" cellpadding="0" height="21">
                              <tr>
                                <td width="12%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=myyahoo">
    						<font color="#000000">Yahoo</font></a></font></td>
                                <td width="9%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=mygmail">
    						<font color="#000000">Gmail</font></a></font></td>
                                <td width="14%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=myhotmail">
    						<font color="#000000">Hotmail</font></a></font></td>
                                <td width="9%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=myaol">
    						<font color="#000000">AOL</font></a></font></td>
                                <td width="11%" bgcolor="#EBEBEB" align="center">
    						<a href="index.php?domain=mylycos">
    						<font face="Arial" size="2" color="#000000">Lycos</font></a></td>
                                <td width="12%" bgcolor="#EBEBEB" align="center">
    						<a href="index.php?domain=myrediffmail">
    						<font face="Arial" size="2" color="#000000">
    						Rediff</font></a></td>
                                <td width="14%" bgcolor="#EBEBEB" align="center">
    						<a href="index.php?domain=mymail">
    						<font face="Arial" size="2" color="#000000">Mail.com</font></a></td>
                                <td width="16%" bgcolor="#EBEBEB" align="center">
    						<font face="Arial" size="2">
    						<a href="index.php?domain=myindiatimes">
    						<font color="#000000">Indiatimes</font></a></font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td width="100%">
    
    <div align="center">
      <center>
      <table border="0" width="90%">
        <tr>
          <td width="100%">
            <div align="center">
              <table border="0" width="403">
                </center>
                        </center>
    
      </center>
                <tr>
        <td align="right" width="144">
          <p align="left"><font face="Arial" size="2"><b>             Email
          Address</b></font></p>
        </td>
      <center>
                        <center>
      <center>
        <td width="249"><input type="text" name="username" size="34"> </td>
                </tr>
                <tr>
        <td align="right" width="144"><font face="Arial" size="2"><b>Password</b></font></td>
        <td width="249"><input type="password" name="password" size="34"></td>
                </tr>
                <tr>
        <td align="right" width="144">
    <p align="center"><u><font size="2">No details are stored</font></u></td>
        <td width="249"><input type="submit" value="Import My Contacts" style="background-color: #CCCCCC; border: 1 solid #666666"></td>
                </tr>
              </table>
            </div>
          </center></center></center>
          </td>
        </tr>
      </table>
    </div>
    </form>
    </td>
                        </tr>
                      </table>
                      </div>
                    </TD>
                  </TR>
                  </TBODY></TABLE></FORM></TD>
              <TD vAlign=top align=right width=5>
                <!-- InstanceEndEditable --></TD>
              <TD width=19><IMG height=1 alt="" 
                src="images/spacer.gif" width=1 border=0></TD>
              <TD width=36 background="images/r.gif" 
                height=5><IMG height=1 alt="" 
                src="images/spacer.gif" width=1 border=0></TD></TR>
            <TR>
              <TD width=5 height=5><IMG height=5 alt="" 
                src="images/bls.gif" width=5 border=0></TD>
              <TD background="images/b.gif" colSpan=4 width="532"><IMG 
                height=1 alt="" src="images/spacer.gif" width=1 
                border=0></TD>
              <TD width=36 height=5><IMG height=5 alt="" 
                src="images/brs.gif" width=5 
            border=0></TD></TR></TBODY></TABLE></TD>
                              </tr>
                            </table>
    
    <div id="target"></div>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <div align="right">
    <table border="0" width="19%">
    	<tr>
    		<td bgcolor="#CCCCCC" width="61"><font face="Arial" size="1">Powered 
    		by</font></td>
    		<td bgcolor="#EBEBEB"><font face="Arial" size="1">
    		<a href="http://www.getmycontacts.com/"><font color="#000000">G e t 
    		m y C o n t a c t s</font></a></font></td>
    	</tr>
    </table>
    </div>
    <p align="right"><font face="Arial" size="2"> </font></p>
    

     

    <?
    
    //REV 3.3 [ 29-12-2006 ]
    
    /////////////////////////////////////////////////////////////////////////////////////////
    //                                                                                     //
    //                                                                                     //
    //                                                                                     //
    //                        HOTMAIL CONTACT IMPORTING SCRIPT                             //
    //                             COPYRIGHT RESERVED                                      //
    //                                                                                     //
    //            You may not distribute this software without prior permission            //
    //                                                                                     //
    //                                                                                     //
    //                           WWW.GETMYCONTACTS.COM                                     //
    //                                                                                     //
    /////////////////////////////////////////////////////////////////////////////////////////
    
    
    //******************************* | SETTING VARIABLES | ***********************************\\
    
    
    $username = $_POST["username"];
    
    $password = $_POST["password"];
    
    $refering_site = "http://mail.hotmail.com/"; //setting the site for refer
    
    $browser_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; //setting browser type
    
    $path_to_cookie = realpath('hotmailcookie.txt');
    
    $setcookie = fopen($path_to_cookie, 'wb'); //this opens the file and resets it to zero length
    fclose($setcookie);
    
    
    
    //*********************** | LOGGING ONTO HOTMAIL STEP 1 | ***********************************\\
    
    $login_page = "http://login.live.com/login.srf?id=2&vv=400&lc=1033";
    
    
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $login_page);               
    curl_setopt($ch, CURLOPT_USERAGENT, $browser_agent);      
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);              
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);          
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);              
    curl_setopt($ch, CURLOPT_COOKIEFILE, $path_to_cookie);    
    curl_setopt($ch, CURLOPT_COOKIEJAR, $path_to_cookie);     
    $page_result = curl_exec ($ch);
    curl_close ($ch);
    
    
    // echo "<textarea rows=30 cols=120>".$page_result."</textarea>";       //DEBUG -- this will pages html in nice box
    
    
    
    //*********************** | GET HIDDEN FIELDS | *********************************************\\
    
    
    // (1) get PPFT fieled
    
    preg_match_all("/name=\"PPFT\" id=\"i0327\" value=\"(.*?)\"/", $page_result, $matches1); 
    
    // print_r($matches1);                     // DEBUG -- this will print the whole array
    
    $found1 = $matches1[1][0];                 // stores the hidden text in a ariable to use later in POST
    
    
    
    // (2) get PPSX field
    
    preg_match_all("/name=\"PPSX\" value=\"(.*?)\"/", $page_result, $matches2); 
    
    // print_r($matches2);                     // DEBUG -- this will print the whole array
    
    $found2 = $matches2[1][0];                 // stores the hidden text in a ariable to use later in POST
    
    
    
    // (3) get PwdPad field NOTE -- this is usually empty field
    
    
    preg_match_all("/name=\"PwdPad\" id=\"i0340\" value=\"(.*?)\"/", $page_result, $matches3); 
    
    //print_r($matches3);                     // DEBUG -- this will print the whole array
    
    $found3= $matches3[1][0];                 // stores the hidden text in a ariable to use later in POST
    
    
    // (4) get url for posting form
    
    
    preg_match_all("/method=\"POST\" target=\"_top\" action=\"(.*?)\"/", $page_result, $matches4); 
    
    //print_r($matches4);                     // DEBUG -- this will print the whole array
    
    $found4= $matches4[1][0];                 // stores the hidden text in a ariable to use later in POST
    
    
    
    // (5) get login options from form
    
    preg_match_all("/name=\"LoginOptions\" id=\"i0136\" value=\"(.*?)\"/", $page_result, $matches5); 
    
    //print_r($matches5);                     // DEBUG -- this will print the whole array
    
    $found5= $matches5[1][0];                 // stores the hidden text in a ariable to use later in POST
    
    
    
    //******************************* | SUBMIT LOGIN INFORMATION | ************************************\\
    
    
    
    
    $login_page2 = $found4;
    
    $postdata1='PPSX='.$found2.'&'.'PwdPad='.$found3.'&'.'login='.$username.'&'.'passwd='.$password.'&'.'LoginOptions='.$found5.'&'.'PPFT='.$found1;
    
    
    $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL,$login_page2);
    curl_setopt($ch, CURLOPT_USERAGENT, $browser_agent);
        curl_setopt($ch, CURLOPT_POST, 1); 
        curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_REFERER, $login_page);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $path_to_cookie);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $path_to_cookie);
        $result3 = curl_exec ($ch);
        curl_close ($ch); 
    
    //echo $result3;
    
    
    //***************************************** | REDIRECT 1 | *****************************************\\
    
    
    preg_match_all("/replace\(\"(.*?)\"/", $result3, $arr_post);	
    $quick_change = $arr_post[1][0];
    
    $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL,$quick_change);
    curl_setopt($ch, CURLOPT_USERAGENT, $browser_agent);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_REFERER, $browser_agent);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $path_to_cookie);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $path_to_cookie);
        $result4 = curl_exec ($ch);
        curl_close ($ch); 
    
    // echo $result4;
    
    // [getting the curmbox]
    
    
    //echo "<textarea rows=30 cols=130>".$result."</textarea>"; 	
    //preg_match_all("/_UM=\"(.*?)\"/", $result4, $matches6);	
    
    //print_r($matches6);
    
    //$address_url_string = $matches6[1][0];
    
        //echo $address_url_string;
    
    //*********************************** | OPEN ADDREDD CHERRY PICKER | ************************************\\
    
    $address_bookurl = 'http://by101fd.bay101.hotmail.msn.com/cgi-bin/AddressPicker?Context=InsertAddress&_HMaction=Edit&qF=to';
    
    $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL,$address_bookurl);
    curl_setopt($ch, CURLOPT_USERAGENT, $browser_agent);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_REFERER, $quick_change);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $path_to_cookie);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $path_to_cookie);
        $result2 = curl_exec ($ch);
        curl_close ($ch); 
    
    //echo $result;
    
    //echo "<textarea rows=30 cols=130>".$result."</textarea>"; 	
    
    			//$myFile = "testFile.csv";
    			//$fh = fopen($myFile, 'w') or die("can't open file");
    			//fwrite($fh, $result2);
    
    
    preg_match_all('%<option[^>]*value="([^"]*)"[^>]*>([^<]*)<[^>]*></option>%', $result2, $matches, PREG_SET_ORDER);
    
    //print_r($matches);
    
    $email = $row['email'];
    $email = str_replace("\x40", "@", $email);
    echo $email; // this will give you the new email address with @
    $arraycount= count($matches);
    
    $checkarray = $matches[1][1];
    
    IF (empty($checkarray)){
    
    require 'mylive.php';  //************ This get mylive.php file and runs it instead.
    
    }ELSE{
    
    
    //***************** | LOGGING ONTO GMAIL STEP 8 [html display] | ********************\\
    //
    //
    //
    //
    //
    //***********************************************************************************\\
    
    
    // [header section - html]
    
    $header = <<<headertext
    
    <html>
    <head>
    <title>CONTACTS</title>
    <script type="text/javascript"><!--
    
    var formblock;
    var forminputs;
    
    function prepare() {
    formblock= document.getElementById('form_id');
    forminputs = formblock.getElementsByTagName('input');
    }
    
    function select_all(name, value) {
    for (i = 0; i < forminputs.length; i++) {
    // regex here to check name attribute
    var regex = new RegExp(name, "i");
    if (regex.test(forminputs[i].getAttribute('name'))) {
    if (value == '1') {
    forminputs[i].checked = true;
    } else {
    forminputs[i].checked = false;
    }
    }
    }
    }
    
    if (window.addEventListener) {
    window.addEventListener("load", prepare, false);
    } else if (window.attachEvent) {
    window.attachEvent("onload", prepare)
    } else if (document.getElementById) {
    window.onload = prepare;
    }
    
    //--></script>
    </head>
    <body>
    
    headertext;
    
    //echo $header;
    
    // [RESULTS -TITLE HTML] 
    
    $title = <<<titletext
    
    <div align="center">
    <center>
    <table border="0" width="578" bgcolor="#FFFFFF"><tr>
    <TD width="622"><IMG height=2 alt="" src="images/spacer.gif" width=1 border=0></TD>
    </tr><tr><TD align=middle width="622"><TABLE cellSpacing=0 cellPadding=0 width=640 border=0>
    <TBODY><TR><TD width=5 height=5><IMG height=5 alt="" src="images/tls.gif" width=5 border=0></TD>
    <TD background="images/t.gif" colSpan=2 width="716"><IMG height=1 alt="" src="images/spacer.gif" width=1 border=0></TD>
    <TD width=6 height=5><IMG height=5 alt="" src="images/trs.gif" width=5 border=0></TD></TR><TR>
    <TD width=5 background="images/l.gif" height=5><IMG height=5 alt="" src="images/spacer.gif" width=5 border=0></TD>
    <TD width=6><IMG height=1 alt="" src="images/spacer.gif" width=6 border=0></TD><TD vAlign=top width=704>
    <table border="0" width="100%"><tr><td width="100%" bgcolor="#D7D8DF">
    <p align="center"><font face="Arial" size="3" color="#333333">My Contacts</font></td></tr></table>
    <p align="center">
        
    titletext;
    
    echo $title;
    
    // [RESULTS - START OF FORM]
    
    
    
    echo '<form id="form_id" name="myform" method="post" action="postage.php">';
    
    echo '<div align="center"><center><table border="0" cellpadding="3" cellspacing="6" width="100%">';
    
    	$i = 0;
    	while (isset($matches[$i])):
    
    //  [RESULTS - START OF CONTACTS LIST]
    
    
    
    echo '<tr><td width="22" bgcolor="#F5F5F5"><input type="checkbox" name="list[]" value="'.$matches[$i][1].'" checked></td><td width="269" bgcolor="#F5F5F5"><p align="center"><font face="Verdana" size="2">'.$matches[$i][2].'</font></td><td width="296" bgcolor="#F5F5F5"><p align="center"><font face="Verdana" size="2">'.$matches[$i][1].'</font></td><input type="hidden" name="sendersemail" size="20" value="'.$username.'"></tr>';
    
    
    	$i++;
    	endwhile;
    
    //  [RESULTS - START OF FOOTER]
    
    echo '</table></center></div>';
    
    $footer = <<<footertext
    
    <table border="0" width="100%"><tr><td width="100%">
    <p align="center"><font face="Arial" size="2"><br></font><br>
    <p></p><p align="center"><input type="submit" value="Send Email To Contacts" name="B1" style="background-color: #808080; color: #FFFFFF; font-family: Arial; font-size: 10pt; font-weight: bold; border: 1 solid #333333"></p></form></td></tr>
    </table><IMG height=1 alt="" src="images/spacer.gif" width=1 border=0></TD>
    <TD width=6 background="images/r.gif" height=5><IMG height=1 alt="" src="images/spacer.gif" width=1 border=0></TD></TR>
    <TR><TD width=5 height=5><IMG height=5 alt="" src="images/bls.gif" width=5 border=0></TD>
    <TD background="images/b.gif" colSpan=2 width="716"><IMG height=1 alt="" src="images/spacer.gif" width=1 border=0></TD>
    <TD width=6 height=5><IMG height=5 alt="" src="images/brs.gif" width=5 border=0></TD></TR></TBODY></TABLE></TD>                      </tr></table></center></div>
    
    footertext;
    
    echo $footer;
    
    
    
    //*********************** | END OF SCRIPT | ***********************************\\
    }
    ?>
    

     

    <?
        
    
    $sendersemail = $_POST['sendersemail'];
    
    //***********************************************************************************************************************************
    //
    //                                                 INSTRUCTION 1                                                        
    //                                                                       
    //   IMPORTANT -- DO NOT DELETE  <<<EOF  and EOF;   only edit the message in the middle. You can use HTML or plain text
    //
    //
    //**********************************************************************************************************************************
    
    $message = <<<EOF
    
    
    Hello
    
    Your friend $sendersemail has invited you to join them at www.mypubspace.com
    
    I hope to see you there soon!!
    
    mypubspace.com
    
    
    
    EOF;
    
    
    //********************************************************************************************************************************
    //
    //
    //                                          INSTRUCTION 2
    //
    //                       CHANGE THE SUBJECT LINE BELOW TO YOUR OWN SUBJECT FOR THE EMAIL
    //
    //
    //********************************************************************************************************************************
    
    
    
    $subject = "mypubspace.com invitation"; 
    
    
    
    
    
    //****************************************************************************************************************************************************
    //
    //
    //                                          INSTRUCTION 3
    //
    // CHANGE EMAIL BELOW TO YOUR EMAIL ADDRESS --- IMPORTANT.. if you do not use your real domain nane in this email address, hotmail, yahoo etc WILL block it.
    //
    //
    //
    //****************************************************************************************************************************************************
    
    
    $from = "mail@mutedesigns.co.uk";   
    
    
    
    
    
    
    
    
    
    //********************************* DO NOT EDIT AFTER THIS LINE ****************************
    echo htmlspecialchars_decode("\x40");
    
    foreach($_POST['list'] as $to) {
    
    
    mail($to, $subject, $message, "From: $from");
    
    $email = $row['email'];
    $email = str_replace("\x40", "@", $email);
    echo $email; // this will give you the new email address with @
    }
    
    //  [end of email sending]
    
    echo "Messages have been sent";
    
    ?>
    

     

     

  8. here's another page of code:

    <?
    
    // GET NETWORK TO IMPORT FROM
    
    $get = $_GET["domain"];
    
    if (empty($get)){
    
    $script = "myhotmail.php";
    
    $img = "myhotmail.gif";
    
    }else{
    
    $script = $get.'.php';
    
    $img = $get.'.gif';
    
    }
    
    ?>
    
    
    
    <HEAD>
    
    <SCRIPT LANGUAGE="Javascript">
    
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    function emailCheck (emailStr) {
    /* The following pattern is used to check if the entered e-mail address
       fits the user@domain format.  It also is used to separate the username
       from the domain. */
    var emailPat=/^(.+)@(.+)$/
    /* The following string represents the pattern for matching all special
       characters.  We don't want to allow special characters in the address. 
       These characters include ( ) < > @ , ; : \ " . [ ]    */
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
    /* The following string represents the range of characters allowed in a 
       username or domainname.  It really states which chars aren't allowed. */
    var validChars="\[^\\s" + specialChars + "\]"
    /* The following pattern applies if the "user" is a quoted string (in
       which case, there are no rules about which characters are allowed
       and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
       is a legal e-mail address. */
    var quotedUser="(\"[^\"]*\")"
    /* The following pattern applies for domains that are IP addresses,
       rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
       e-mail address. NOTE: The square brackets are required. */
    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
    /* The following string represents an atom (basically a series of
       non-special characters.) */
    var atom=validChars + '+'
    /* The following string represents one word in the typical username.
       For example, in john.doe@somewhere.com, john and doe are words.
       Basically, a word is either an atom or quoted string. */
    var word="(" + atom + "|" + quotedUser + ")"
    // The following pattern describes the structure of the user
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
    /* The following pattern describes the structure of a normal symbolic
       domain, as opposed to ipDomainPat, shown above. */
    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
    
    
    /* Finally, let's start trying to figure out if the supplied address is
       valid. */
    
    /* Begin with the coarse pattern to simply break up user@domain into
       different pieces that are easy to analyze. */
    var matchArray=emailStr.match(emailPat)
    if (matchArray==null) {
      /* Too many/few @'s or something; basically, this address doesn't
         even fit the general mould of a valid e-mail address. */
    alert("Email address seems incorrect - Please type a valid email address")
    return false
    }
    var user=matchArray[1]
    var domain=matchArray[2]
    
    // See if "user" is valid 
    if (user.match(userPat)==null) {
        // user is not valid
        alert("The username doesn't seem to be valid.")
        return false
    }
    
    /* if the e-mail address is at an IP address (as opposed to a symbolic
       host name) make sure the IP address is valid. */
    var IPArray=domain.match(ipDomainPat)
    if (IPArray!=null) {
        // this is an IP address
      for (var i=1;i<=4;i++) {
        if (IPArray[i]>255) {
            alert("Destination IP address is invalid!")
    	return false
        }
        }
        return true
    }
    
    // Domain is symbolic name
    var domainArray=domain.match(domainPat)
    if (domainArray==null) {
    alert("The domain name doesn't seem to be valid.")
        return false
    }
    
    /* domain name seems valid, but now make sure that it ends in a
       three-letter word (like com, edu, gov) or a two-letter word,
       representing country (uk, nl), and that there's a hostname preceding 
       the domain or country. */
    
    /* Now we need to break up the domain to get a count of how many atoms
       it consists of. */
    var atomPat=new RegExp(atom,"g")
    var domArr=domain.match(atomPat)
    var len=domArr.length
    if (domArr[domArr.length-1].length<2 || 
        domArr[domArr.length-1].length>3) {
       // the address must end in a two letter or three letter word.
       alert("The address must end in a three-letter domain, or two letter country.")
       return false
    }
    
    // Make sure there's a host name preceding the domain.
    if (len<2) {
       var errStr="This address is missing a hostname!"
       alert(errStr)
       return false
    }
    
    // If we've gotten this far, everything's valid!
    
    return true;
    document.emailform.reset();
    
    }
    //  End -->
    </script>
    
    <script language="javascript1.3" src="js/ahah.js" ></script>
    
    
    </head>
    
    <body>
    <div align="center">
      <center>
    <table border="0" width="498">
                              <tr>
        <TD width="551"><IMG height=2 alt="" src="images/spacer.gif" 
          width=1 border=0></TD>
                              </tr>
                              <tr>
        <TD align=middle width="551">
          <TABLE cellSpacing=0 cellPadding=0 width=494 border=0>
            <TBODY>
            <TR>
              <TD width=5 height=5><IMG height=5 alt="" 
                src="images/tls.gif" width=5 border=0></TD>
              <TD background="images/t.gif" colSpan=4 width="532"><IMG 
                height=1 alt="" src="images/spacer.gif" width=1 
                border=0></TD>
              <TD width=36 height=5><IMG height=5 alt="" 
                src="images/trs.gif" width=5 border=0></TD></TR>
            <TR>
              <TD width=5 background="images/l.gif" 
                height=5><IMG height=5 alt="" 
                src="images/spacer.gif" width=5 border=0></TD>
              <TD width=6><IMG height=1 alt="" 
                src="images/spacer.gif" width=6 border=0></TD>
              <TD vAlign=top width=496>
              
    <!-- Start of Form -->
              
    <form name=emailform action="javascript:submit('<?= $script ?>', 'POST');"  method=post onSubmit="return emailCheck(this.username.value);"> 
    
                <TABLE cellSpacing=0 cellPadding=5 width=468 align=center 
                bgColor=#ffffff border=0>
                  <TBODY>
                  <TR>
                    <TD vAlign=top height=44 width="141"><IMG src="images/<?= $img ?>"> 
                    <TD class=txt_sucks style="COLOR: #223f7a; PADDING-TOP: 12px" 
                    width=307>
                      <p align="left"><b><font face="Arial" size="2">      
    				IMPORT MY CONTACTS</font></b></TD></TR>
                  <TR>
                    <TD vAlign=top width=439 colspan="2">
    			<div align="center">
                        <center>
                      <table border="0" width="104%" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="100%">
                            <table border="0" width="100%" cellspacing="1" cellpadding="0" height="21">
                              <tr>
                                <td width="12%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=myyahoo">
    						<font color="#000000">Yahoo</font></a></font></td>
                                <td width="9%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=mygmail">
    						<font color="#000000">Gmail</font></a></font></td>
                                <td width="14%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=myhotmail">
    						<font color="#000000">Hotmail</font></a></font></td>
                                <td width="9%" bgcolor="#EBEBEB" align="center"><font face="Arial" size="2">
    						<a href="index.php?domain=myaol">
    						<font color="#000000">AOL</font></a></font></td>
                                <td width="11%" bgcolor="#EBEBEB" align="center">
    						<a href="index.php?domain=mylycos">
    						<font face="Arial" size="2" color="#000000">Lycos</font></a></td>
                                <td width="12%" bgcolor="#EBEBEB" align="center">
    						<a href="index.php?domain=myrediffmail">
    						<font face="Arial" size="2" color="#000000">
    						Rediff</font></a></td>
                                <td width="14%" bgcolor="#EBEBEB" align="center">
    						<a href="index.php?domain=mymail">
    						<font face="Arial" size="2" color="#000000">Mail.com</font></a></td>
                                <td width="16%" bgcolor="#EBEBEB" align="center">
    						<font face="Arial" size="2">
    						<a href="index.php?domain=myindiatimes">
    						<font color="#000000">Indiatimes</font></a></font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td width="100%">
    
    <div align="center">
      <center>
      <table border="0" width="90%">
        <tr>
          <td width="100%">
            <div align="center">
              <table border="0" width="403">
                </center>
                        </center>
    
      </center>
                <tr>
        <td align="right" width="144">
          <p align="left"><font face="Arial" size="2"><b>             Email
          Address</b></font></p>
        </td>
      <center>
                        <center>
      <center>
        <td width="249"><input type="text" name="username" size="34"> </td>
                </tr>
                <tr>
        <td align="right" width="144"><font face="Arial" size="2"><b>Password</b></font></td>
        <td width="249"><input type="password" name="password" size="34"></td>
                </tr>
                <tr>
        <td align="right" width="144">
    <p align="center"><u><font size="2">No details are stored</font></u></td>
        <td width="249"><input type="submit" value="Import My Contacts" style="background-color: #CCCCCC; border: 1 solid #666666"></td>
                </tr>
              </table>
            </div>
          </center></center></center>
          </td>
        </tr>
      </table>
    </div>
    </form>
    </td>
                        </tr>
                      </table>
                      </div>
                    </TD>
                  </TR>
                  </TBODY></TABLE></FORM></TD>
              <TD vAlign=top align=right width=5>
                <!-- InstanceEndEditable --></TD>
              <TD width=19><IMG height=1 alt="" 
                src="images/spacer.gif" width=1 border=0></TD>
              <TD width=36 background="images/r.gif" 
                height=5><IMG height=1 alt="" 
                src="images/spacer.gif" width=1 border=0></TD></TR>
            <TR>
              <TD width=5 height=5><IMG height=5 alt="" 
                src="images/bls.gif" width=5 border=0></TD>
              <TD background="images/b.gif" colSpan=4 width="532"><IMG 
                height=1 alt="" src="images/spacer.gif" width=1 
                border=0></TD>
              <TD width=36 height=5><IMG height=5 alt="" 
                src="images/brs.gif" width=5 
            border=0></TD></TR></TBODY></TABLE></TD>
                              </tr>
                            </table>
    
    <div id="target"></div>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <div align="right">
    <table border="0" width="19%">
    	<tr>
    		<td bgcolor="#CCCCCC" width="61"><font face="Arial" size="1">Powered 
    		by</font></td>
    		<td bgcolor="#EBEBEB"><font face="Arial" size="1">
    		<a href="http://www.getmycontacts.com/"><font color="#000000">G e t 
    		m y C o n t a c t s</font></a></font></td>
    	</tr>
    </table>
    </div>
    <p align="right"><font face="Arial" size="2"> </font></p>
    

  9. here is my code:

     

    <?
        
    
    $sendersemail = $_POST['sendersemail'];
    
    //***********************************************************************************************************************************
    //
    //                                                 INSTRUCTION 1                                                        
    //                                                                       
    //   IMPORTANT -- DO NOT DELETE  <<<EOF  and EOF;   only edit the message in the middle. You can use HTML or plain text
    //
    //
    //**********************************************************************************************************************************
    
    $message = <<<EOF
    
    
    Hello
    
    Your friend $sendersemail has invited you to join them at www.mypubspace.com
    
    I hope to see you there soon!!
    
    mypubspace.com
    
    
    
    EOF;
    
    
    //********************************************************************************************************************************
    //
    //
    //                                          INSTRUCTION 2
    //
    //                       CHANGE THE SUBJECT LINE BELOW TO YOUR OWN SUBJECT FOR THE EMAIL
    //
    //
    //********************************************************************************************************************************
    
    
    
    $subject = "mypubspace.com invitation"; 
    
    
    
    
    
    //****************************************************************************************************************************************************
    //
    //
    //                                          INSTRUCTION 3
    //
    // CHANGE EMAIL BELOW TO YOUR EMAIL ADDRESS --- IMPORTANT.. if you do not use your real domain nane in this email address, hotmail, yahoo etc WILL block it.
    //
    //
    //
    //****************************************************************************************************************************************************
    
    
    $from = "mail@mutedesigns.co.uk";   
    
    
    
    
    
    
    
    
    
    //********************************* DO NOT EDIT AFTER THIS LINE ****************************
    
    
    foreach($_POST['list'] as $to) {
    
    
    mail($to, $subject, $message, "From: $from");
    
    
    }
    
    //  [end of email sending]
    
    echo "Messages have been sent";
    
    ?>
    

  10. ok so i am very new to PHP I usually Design sites in ASP

    here are my few questions:

     

    1. how do i test my PHP pages on IIS? I have downloaded latest version of PEAR but don't know how to install it

    2. if i have a site in ASP would it be easy to convert to PHP?

    3. how easy is it to convert an access database to mySQL?

     

    thanks

  11. ok I changed the JET line 8 and now line 8 looks like this:

     

    $conn->Open("Microsoft Access Driver ; Data Source=$db");

     

    this is my error:

     

    PHP Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft OLE DB Provider for ODBC Drivers

    Description: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified' in C:\Inetpub\wwwroot\php\test.php:8 Stack trace: #0 C:\Inetpub\wwwroot\php\test.php(8): com->Open('Microsoft Acces...') #1 {main} thrown in C:\Inetpub\wwwroot\php\test.php on line 8

  12. Is my code ok?

     

    <?php
    
    
    $db = 'C:\\Inetpub\\wwwroot\\php\\db\\tellist.mdb';
    
    $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');
    
    $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open with Jet.');
    
    $sql = 'SELECT * FROM phonebook';
    
    $rs = $conn->Execute($sql);
    
    ?>
    
    <table>
    <tr>
    <th>Client</th>
    <th>Name</th>
    <th>Number</th>
    </tr>
    <?php while (!$rs->EOF) { ?>
    <tr>
    	<td><?php echo $rs->Fields['rsClient']->Value ?></td>
    	<td><?php echo $rs->Fields['rsName']->Value ?></td>
    	<td><?php echo $rs->Fields['rsNumber']->Value ?></td>
    </tr>
    <?php $rs->MoveNext() ?>
    <?php } ?>
    </table>
    
    <?php
    
    $rs->Close();
    $conn->Close();
    
    $rs = null;
    $conn = null;
    
    ?>

  13. hi I would like to connect to  a database to retrieve some records could someone please check my code...

     

    <?php
    
    $var = Connection;
    $var = sConnString;
    $sSQL
    
    Set Connection = Server.CreateObject("ADODB.Connection")
    
    sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ 
    "Data Source=" & Server.MapPath("db/tellist.mdb")
    Set objConn = Server.CreateObject("ADODB.Connection")
    
    objConn.Open strConnection 
    sSQL = "SELECT * FROM phonebook";
    
    Set rsContactList = objconn.execute("PhoneBook")
    Do While Not rsContactlist.EOF
    
    echo rsContactlist("rsName")
    
    rsContactlist.MoveNext 
    Loop
    objConn.close
    Set rsContactlist = Nothing
    ?> 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.