Jump to content

hotdog1983

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by hotdog1983

  1. Thank you for the replies. I'll go look into table linking. Both of you recommended keeping all the pageview data instread of deleting them, I was just worried if it's going to slow down the server when the database gets big. But it's better if I can keep them. @The Little Guy, I don't understand that method. If I make 3 columns like that, would I be able to put more than 1 data into the page column? Sorry if I got it wrong.
  2. Hi, I have a mysql table like this ----------------------------------------------- UserID Email Joined Country ----------------------------------------------- Justin jj@a.com 110815 USA ----------------------------------------------- What I want to achieve is to keep the 5 recent pages viewed by each user. For example, --------------------------------------------------------------------------------------------------- UserID Email Joined Country Act5 Act4 Act3 Act2 Act1 --------------------------------------------------------------------------------------------------- Justin jj@a.com 110815 USA 8.php 6.php 5.php 3.php 1.php --------------------------------------------------------------------------------------------------- So only the 5 recent pages are inserted and when the user views the 6th page, the oldest record gets dropped and the 4 last pages moves to the right by 1 column. --------------------------------------------------------------------------------------------------- UserID Email Joined Country Act5 Act4 Act3 Act2 Act1 --------------------------------------------------------------------------------------------------- Justin jj@a.com 110815 USA 8.php 6.php 5.php 3.php --------------------------------------------------------------------------------------------------- And then the last viewed page gets inserted. --------------------------------------------------------------------------------------------------- UserID Email Joined Country Act5 Act4 Act3 Act2 Act1 --------------------------------------------------------------------------------------------------- Justin jj@a.com 110815 USA 11.php 8.php 6.php 5.php 3.php --------------------------------------------------------------------------------------------------- I know how to use php to take the page name value to mysql query but I don't know how to use the SQL commands to do this. Does anyone know how to do this? or is there a better way to do it? Some help would be great, thank you.
  3. Thanks for your reply. I'm in a hurry to finish a site and I actually got that code from watching a Youtube PHP tutorial clip. I thought that the code itself must be correct. After struggling for a few hours, I've come up with this. $query = mysql_query("SELECT * FROM users WHERE username='$username' and password='$password'"); It works as I wished and I hope this one is properly coded. Please advise me if it's not. Thank you!
  4. Thank you for your answer. No, I'm getting wrong password error. When the username and password in the database are abc and abc I can login with abc/abc but not with ABC/abc, abc/ABC, or ABC/ABC.
  5. Hi, I'm making a login page and I want to allow users type in case-insensitive username and password. I'm using utf8_general_ci collation. Here's my PHP code. $username= $_POST['username']; $password = $_POST['password']; if ($email&&$password){ $connect = mysql_connect("localhost","root","") or die("Couldn't connect to the database"); mysql_select_db("nemo") or die("Couldn't find the database."); $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername= $row["username"]; $dbpassword = $row["password"]; } if ($username==$dbusername&&$password==$dbpassword) { echo "Logged in"; } else echo "Wrong password." } else die("Username not found."); } else die("Enter your username and password."); After doing some search, I found that collation ending with ci means case insensitive. But I can't log in with ABC if the username in database is abc. I know I can use strtolower to make everything to lower case but I'm really curious why this happens. Thank you.
  6. This is a bit off topic but I'm asking in this board because there are lots of computer geniuses here. I'm trying to get a direct link to a media file on a media storage site. On this website, instead of letting me download the file on the browser directly, it lets me install a small pop-up downloader program (ActiveX maybe?) and download files though it. I tried URL snooper and Wireshare but still could not get any links. URL snooper gives me something like this. http://www.nuripop.com/contents/contents_chk.php?dmethod=C&idx=437304 http://www.nuripop.com/contents/contents_download_start.php?dmethod=C&idx=437304&downkind=0 http://216.151.177.131/function.fopen http://nuripop.com/fs_prg/activex/XBoomUpDown_axn71106.cab#version=1,1,0,6 Is there any way that I can find the link? I'm pretty sure that there must be a link since it comes into my computer. Thank you very much.
  7. Hi guys, I've been struggling with this cURL code that post variables in foreign languages to another site. I tried to encode the UTF-8 characters to html entities before posting them via cURL and I tried lots of these variations... $firstname = htmlentities($_POST['firstname'],ENT_COMPAT,'UTF-8'); $firstname = htmlentities($_POST['firstname'],ENT_COMPAT); $firstname = htmlentities($_POST['firstname'],ENT_QUOTES); $firstname = iconv('utf-8','iso-8859-1',$_POST['firstname']); $firstname = iconv('utf-8','windows-1253',$_POST['cfirstname']); and so on... but the foreign characters I get through cURL look like ì��ë��í��ì�¸ì�� ì �ë�� ë��구ì�¼ê¹�ì��? The way I want to see them is something like this I believe it's called html entities 안녕하세요 저는 so I can see all the other languages on an iso-8859-1 page. Is it possible for cURL to post the variables in html entities?
  8. Thanks again for your reply. I really appreciate it. When I look at the HTTP headers, I see Set-Cookie: PHPSESSID=2btu73afurcpm632sr9dsqpjo2; path=/ I'm not really sure how sessions work.. How do I test if the target site takes session ID from URL? Can I type like www.3rdparty.com/index.php?PHPSESSID=2btu73afurcpm632sr9dsqpjo2 on a different browser like Chrome while I'm logged in on Firefox? Arggggg this is driving me crazy. I got my contact mail form page secured, signup page secured using cURL, and it's going to be funny to see my login page sending plain text data lol. What can I do if I don't have any control over the target site's security policy? I just wanted to make it a bit safer at least at the user end. Thanks again BlueSkyIS, hope you have a good one.
  9. Thanks a lot for your reply. Now I understood why I couldn't be logged in while I can post the data. I found a thread of someone else who had the same issue at http://www.webhostingtalk.com/showthread.php?t=696569 Some one there said Send login data to remote site, and receive the response (result). You can either fopen/fget or cURL. Extract the PHP session ID from the result and put it in a variable like $session. Redirect the user to the remote site, with the session ID: header("location: http://website.tld/after_succesful_login_page.php?PHPSESSID=$session") Do you think this is possible?
  10. Hi guys, what I'm struggling to do is 1) Users land on https://www.mysite.com/login.php 2) Users type their email and password 3) POST data submitted to http://www.3rdparty.com/login.php with cURL 4) Users redirected to http://www.3rdparty.com/index.php (logged in). I've been using this simple form to POST directly to the 3rd party site. <form name="loginform" method="post" target="_blank" action="http://www.3rdparty.com/login.php"> Email <input name="email" type="text"> Password<input name="password" type="password"> <input name="submit" type="submit" id="loginbutton" value="login"></form> This works great. But now I've installed a SSL on my site and I've just realised that using the form above, the data is still POSTed as a plain text because the 3rd party site is not https. So I want to submit the form to my login.php form and let this form take the users to the 3rd party site. So at least the user inputs to my site is encrypted. My new code looks like this. <form name="loginform" method="post" target="_blank" action="login.php"> Email <input name="email" type="text"> Password<input name="password" type="password"> <input name="submit" type="submit" id="loginbutton" value="login"></form> <?php if(isset($_POST['email'])) $email= $_POST['email']; if(isset($_POST['password'])) $password= $_POST['password']; if(isset($_POST['submit'])) $submit = $_POST['submit']; $Curl_Session = curl_init('http://www.3rdparty.com/login.php'); curl_setopt ($Curl_Session, CURLOPT_POST, 1); curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, "email=$email&password=$password&submit=$submit"); curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec ($Curl_Session); curl_exec ($Curl_Session); curl_close ($Curl_Session); print $result; ?> What this code is doing now is it's just rendering the www.3rdparty.com's login page (not logged in) on my site. When I type wrong values, it renders www.3rdparty.com's login page with an error message on it. So I think at least the values are being POSTed but it doesn't log me in. All of the cURL codes available out there seem to POST the data and fetch some results back not redirecting the users to another site. My ultimate goal is to POST the form and redirect the users to the 3rd party site's member area as well. I tried header("Location: http://www.3rdparty.com/index.php"); but it just takes user to that page without being logged in. Could anyone give me some hints?
  11. Thank you very much. I'm now looking in to prototype.js and it helps a lot. I really appreciate it.
  12. Thanks a lot for your reply. But um... I'm still trying to understand your answer 1) What I understand is that In the 1st code The whole page will be reloaded as I surf around the website. In the 2nd code Only the content part of the page will be loaded as I surf around the website. Is this correct?
  13. Hi all! I'm a real noob and this is my first time making a website and I haven't hosted it yet. I'm trying to make a website that is fast and secure. My pages look something like this. <?php include("header.php");include("sidebar.php"); ?> HTML CODES <?php include("footer.php"); ?> 1. Are these php files cached after their first load? When I go to another page, those parts seem to stay still. 2. Is this code secure? And now I'm starting to make product pages which will be around 40 pages. So I'm considering something like this... <?php include("header.php");include("sidebar.php"); ?> <a href="index.php?page=a">Page A</a> <?php $page = $_GET['page']; if (file_exists('pages/'.$page.'.php')) { include('pages/'.$page.'.php'); } ?> <?php include("footer.php"); ?> 3. Is it better to make every page like this since it will load header, sidebar, footer only once? 4. How should I protect from the user input data, by making an array of allowed files or by prohibiting "." and "/" ? Thank you in advance.
  14. I'm really new to php and javascript and I'm now doing the hardest part of my website. I have this sidebar.php that contains a price list which is included in index.php. <tr> <td>Product 1</td> <td>30 USD</td> </tr> <tr> <td>Product 2</td> <td>50 USD</td> </tr> <tr> <td>Product 3</td> <td>25 USD</td> </tr> I'm going to add a dropdown menu which will change the prices in different currencies like this. <form method="get" action="sidebar.php"> <select name="currency"> <option value="0">Select Currency</option> <option value="1">USD</option> <option value="2">EURO</option> <option value="3">GBP</option> <option value="4">AUD</option> </select> <input type="submit" value="GO"/> </form> And I got this currency exchange code which works fine. <?php //error_reporting(0); $path=pathinfo($_SERVER['PHP_SELF']); $path=$_SERVER['DOCUMENT_ROOT'].$path['dirname']; require_once("$path/currencyexchange_class.php"); $cx=new currencyExchange(); $cx->getData(); ?> <?php if ($euro=$cx->Convert("USD","EUR",1)){ $euro=number_format($euro,4); echo "€$euro Euros "; } But now I'm not sure how I will combine all these codes. All I want is a currency selection dropdown menu which will use php to calculate the prices in another currency and show them on the table without reloading the page. I think I will need some javascript in here if I don't want the page to reload. I need to launch my website as soon as possible but it's taking too long for me to learn all the javascript and php. I'd really appreciate if someone could show me some direction so I can focus studying on a particular subject. Thank you.
  15. Thank you mjdamato. I actually got the codes I posted working. I enabled cURL on WAMP and they worked. I'm sorry if you went through the code. Actually the google api looks much simpler. I'm trying to get it work (Ive changed them to straight quote marks). Thanks again.
  16. Thank you so much. I'm trying the google api you've given. I'm having syntax error on these lines $data = explode( ‘ " ’, $rawdata); $data = explode( ‘ ‘ , $data[‘3′]); I will try do some more testing.
  17. Unfortunately, I have got nearly zero knowledge in PHP. I'm just trying to add a drop-down menu on my website which will turn the prices in USD to other currencies. I'm trying hard to learn but it's too difficult for me at the moment. Here are codes written by someone else which I want to modify and apply to my website. I've tried the second PHP on my WAMP local server but it returns nothing. Both files were in the same folder. I don't know if these codes are correct. I'd appreciate if someone could tell me if the codes are wrong or they just don't work on WAMP server. Sorry the codes are quite long. Thanks in advance. <?php /* File: currencyexchange.php Author: Gary White Last modified: July 6, 2005 Copyright (C) 2005, Gary White This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the included GNU General Public License for more details. If you received this file without the gpl.txt file, you may view it at: http://www.gnu.org/copyleft/gpl.html See the readme.txt file for usage. July 6, 2005 added the RON, Romania New Leu, to the currency list. */ // this simply gets an array of possible currency countries and names $allCurrencies=getCurrencyNames(); class currencyExchange{ ///////////////////////////////////////////////////////////////////////////////////////// // Public Properties // Note that these properties are public, but the values are all generated internally. // You should consider them read only during normal usage. // The only one you may want to access would be the $localFile property, if you wanted // to change the name of the local file used to cache a copy of the data. ///////////////////////////////////////////////////////////////////////////////////////// // $Supplier property will be the European Central Bank, assuming we get the data var $Supplier=""; // $Date property is the date of the exchange rate publication var $Date=""; // $Rates property is an associative array of rateobj objects with the three letter identifier as the array keys var $Rates=array(); // $Source property will be either "Local" or "Remote" depending on where the data comes from var $Source=""; // $Error property will contain any error messages generates along the way var $Error=""; // $localFile property is the file name used to cache a local copy of the XML file var $localFile="currencies_local.xml"; // $url property is the URL of the XML file at the European Central Bank var $url="http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; ///////////////////////////////////////////////////////////////////////////////////////// // Public Methods ///////////////////////////////////////////////////////////////////////////////////////// function getData(){ $olderr=error_reporting(0); $this->Source="Local"; if(file_exists($this->localFile)){ // load it $this->xml=@file_get_contents($this->localFile); $this->parse(); // check if it's a weekend // what day of the week is it? $weekday=date("w"); // if it's a Sunday or Saturday if($weekday==0 || $weekday==6){ // go back to last Friday $date=date("Y-m-d",strtotime("last Friday")); } else { $date=date("Y-m-d"); } // if the date in the local file is not the same // as our current date, or last Friday for weekends if($this->Date!=$date){ // clear the data $this->clearData(); // get the remote file $this->xml=$this->getRemoteFile($this->url); if($this->parse()){ $this->Source="Remote"; // write the remote file data to a local copy of the file $this->saveLocalCopy(); } } // if we have a local copy }else{ $this->xml=$this->getRemoteFile($this->url); if($this->xml) // write the remote file data to a local copy of the file $this->saveLocalCopy(); } if(!$this->xml) $this->error="Failed to get data"; else{ $this->parse(); } // sort our rates on the keys ksort($this->Rates); error_reporting($olderr); return count($this->Rates); } function getRemoteFile($url){ $curl_handle = curl_init(); // Where should we get the data? curl_setopt ($curl_handle, CURLOPT_URL, $url); // This says not to dump it directly to the output stream, but instead // have it return as a string. curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1); // the following is optional, but you should consider setting it // anyway. It prevents your page from hanging if the remote site is // down. curl_setopt ($curl_handle, CURLOPT_CONNECTTIMEOUT, 1); // Now, YOU make the call. $buffer = curl_exec($curl_handle); // And tell it to shut down (when your done. You can always make more // calls if you want.) curl_close($curl_handle); // This is where i�d probably do some extra checks on what i just got. // Paranoia pays dividends. return $buffer; } function Convert($from, $to, $amount=1){ // Converts from one currency to another. The method expects at least two // parameters. The first param , $from, it the three letter identifier for // the currency you are converting from. The second param, $to, is the // three letter identifier for the currency you are converting to. The final // param, $amount, is the amount of the $from currency to convert. If omitted // the amount defaults to 1 and the function will return the amount of $to // currency that corresponds with 1 unit of the $from currency. if(array_key_exists($from, $this->Rates) && array_key_exists($to, $this->Rates)){ return ($amount * (($this->Rates[$to]->rate)/($this->Rates[$from]->rate))); }else{ $this->Error->Error = ""; if (!array_key_exists($from, $this->Rates)) $this->Error.="$from is not a recognized currency identifier "; if (!array_key_exists($from, $this->Rates)) $this->Error.="$to is not a recognized currency identifier"; return false; } } function setBaseCurrency($currency){ // This function converts all currencies to be based on one unit of // $base currency. It's only really useful if you want to output a // table of conversion factors. // get a factor to do our conversion based on our base currency $factor=$this->Rates[$currency]->rate; // modify the rates based on the base currency foreach(array_keys($this->Rates) as $k){ $rate=$this->Rates[$k]->rate / $factor; $this->Rates[$k]->rate=$rate; } return (count($this->Rates)>0); } ///////////////////////////////////////////////////////////////////////////////////////// // Private Methods // You should not need to call any of the following methods. ///////////////////////////////////////////////////////////////////////////////////////// function clearData(){ $this->Supplier=""; $this->Date=""; $this->Rates=array(); $this->Source=""; $this->xml=""; } function saveLocalCopy(){ $fp=fopen($_SERVER['DOCUMENT_ROOT'].$this->localFile,"w") or die("failed to write file"); fwrite($fp,$this->xml); fclose($fp); $this->parse(); $this->Source="Remote"; } function parse(){ if($this->xml){ $this->parser = xml_parser_create(); @xml_set_object($this->parser, $this); @xml_set_element_handler($this->parser, "startElement", "endElement"); @xml_set_character_data_handler($this->parser, "characterData"); $this->Rates['EUR']=new rateobj(); $this->Rates['EUR']->rate=1.00; $this->Rates['EUR']->currency="Euro"; xml_parse($this->parser, $this->xml, true) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser))); xml_parser_free($this->parser); } } function currencyExchange(){ $dir=pathinfo($_SERVER['PHP_SELF']); $dir=$dir['dirname']; $this->localFile="$dir/$this->localFile"; } function startElement($parser, $name, $attrs) { global $allCurrencies; $this->temp=""; $gwCurrencyExch=&$GLOBALS['gwCurrencyExch']; if($name=="CUBE"){ if(array_key_exists("TIME",$attrs)){ $this->Date=$attrs["TIME"]; } if(array_key_exists("CURRENCY",$attrs)){ $this->Rates[$attrs["CURRENCY"]]=new rateobj(); $this->Rates[$attrs["CURRENCY"]]->rate=$attrs["RATE"]; $this->Rates[$attrs["CURRENCY"]]->currency=$allCurrencies[$attrs["CURRENCY"]]; } } } function characterData($parser, $data){ $this->temp.=$data; } function endElement($parser, $name) { switch($name){ case "GESMES:NAME": $this->Supplier=$this->temp; break; case "GESMES:SUBJECT": $this->Report=$this->temp; break; } $temp=""; } } // end of ratelist class class gwSocket{ var $ClassName="gwSocket"; var $Version="0.6"; var $error=""; var $headers; var $maxRedirects=3; var $page=""; var $result=""; var $redirects=0; var $userAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"; function getUrl( $url ) { $retVal=""; $url_parsed = parse_url($url); $scheme = $url_parsed["scheme"]; $host = $url_parsed["host"]; $port = $url_parsed["port"]?$url_parsed["port"]:"80"; $user = $url_parsed["user"]; $pass = $url_parsed["pass"]; $path = $url_parsed["path"]?$url_parsed["path"]:"/"; $query = $url_parsed["query"]; $anchor = $url_parsed["fragment"]; if (!empty($host)){ // attempt to open the socket if($fp = fsockopen($host, $port, $errno, $errstr, 2)){ $path .= $query?"?$query":""; $path .= $anchor?"$anchor":""; // this is the request we send to the host $out = "GET $path ". "HTTP/1.0\r\n". "Host: $host\r\n". "Connection: Close\r\n". "User-Agent: $this->userAgent\r\n"; if($user) $out .= "Authorization: Basic ". base64_encode("$user:$pass")."\r\n"; $out .= "\r\n"; fputs($fp, $out); while (!feof($fp)) { $retVal.=fgets($fp, 128); } fclose($fp); } else { $this->error=$errstr; } $this->result=$retVal; $this->headers=$this->parseHeaders(trim(substr($retVal,0,strpos($retVal,"\r\n\r\n")))); $this->page=trim(stristr($retVal,"\r\n\r\n"))."\n"; if(isset($this->headers['Location'])){ $this->redirects++; if($this->redirects<$this->maxRedirects){ $location=$this->headers['Location']; $this->headers=array(); $this->result=""; $this->page=""; $this->getUrl($location); } } } return (!$retVal=""); } function parseHeaders($s){ $h=preg_split("/[\r\n]/",$s); foreach($h as $i){ $i=trim($i); if(strstr($i,":")){ list($k,$v)=explode(":",$i); $hdr[$k]=substr(stristr($i,":"),2); }else{ if(strlen($i)>3) $hdr[]=$i; } } if(isset($hdr[0])){ $hdr['Status']=$hdr[0]; unset($hdr[0]); } return $hdr; } } // end of gwSocket class class rateobj{ var $currency=""; var $rate=0; } function getCurrencyNames(){ $retVal['AED']="United Arab Emirates Dirham"; $retVal['AFA']="Afghanistan Afghani"; $retVal['ALL']="Albania Leke"; $retVal['ARS']="Argentina Peso"; $retVal['ATS']="Austria Schilling*"; $retVal['AUD']="Australia Dollar"; $retVal['BBD']="Barbados Dollar"; $retVal['BDT']="Bangladesh Taka"; $retVal['BEF']="Belgium Franc*"; $retVal['BGN']="Bulgaria Leva"; $retVal['BHD']="Bahrain Dinar"; $retVal['BMD']="Bermuda Dollar"; $retVal['BRL']="Brazil Reai"; $retVal['BSD']="Bahamas Dollar"; $retVal['CAD']="Canada Dollar"; $retVal['CHF']="Switzerland Franc"; $retVal['CLP']="Chile Peso"; $retVal['CNY']="China Yuan Renminbi"; $retVal['COP']="Colombia Peso"; $retVal['CRC']="Costa Rica Colone"; $retVal['CYP']="Cyprus Pound"; $retVal['CZK']="Czech Republic Koruny"; $retVal['DEM']="Germany Deutsche Mark*"; $retVal['DKK']="Denmark Kroner"; $retVal['DOP']="Dominican Republic Peso"; $retVal['DZD']="Algeria Dinar"; $retVal['EEK']="Estonia Krooni"; $retVal['EGP']="Egypt Pound"; $retVal['ESP']="Spain Peseta*"; $retVal['EUR']="Euro"; $retVal['FIM']="Finland Markkaa*"; $retVal['FJD']="Fiji Dollar"; $retVal['FRF']="France Franc*"; $retVal['GBP']="United Kingdom Pound"; $retVal['GRD']="Greece Drachmae*"; $retVal['HKD']="Hong Kong Dollar"; $retVal['HRK']="Croatia Kuna"; $retVal['HUF']="Hungary Forint"; $retVal['IDR']="Indonesia Rupiahs"; $retVal['IEP']="Ireland Pounds*"; $retVal['ILS']="Israel New Shekel"; $retVal['INR']="India Rupee"; $retVal['IQD']="Iraq Dinar"; $retVal['IRR']="Iran Rial"; $retVal['ISK']="Iceland Kronur"; $retVal['ITL']="Italy Lire*"; $retVal['JMD']="Jamaica Dollar"; $retVal['JOD']="Jordan Dinar"; $retVal['JPY']="Japan Yen"; $retVal['KES']="Kenya Shilling"; $retVal['KRW']="South Korea Won"; $retVal['KWD']="Kuwait Dinar"; $retVal['LBP']="Lebanon Pound"; $retVal['LKR']="Sri Lanka Rupee"; $retVal['LTL']="Lithuanian Lita"; $retVal['LVL']="Latvian Lat"; $retVal['LUF']="Luxembourg Franc*"; $retVal['MAD']="Morocco Dirham"; $retVal['MTL']="Malta Liri"; $retVal['MUR']="Mauritius Rupee"; $retVal['MXN']="Mexico Peso"; $retVal['MYR']="Malaysia Ringgit"; $retVal['NLG']="Dutch (Netherlands) Guilder*"; $retVal['NOK']="Norway Kroner"; $retVal['NZD']="New Zealand Dollar"; $retVal['OMR']="Oman Rial"; $retVal['PEN']="Peru Nuevos Sole"; $retVal['PHP']="Philippines Peso"; $retVal['PKR']="Pakistan Rupee"; $retVal['PLN']="Poland Zlotych"; $retVal['PTE']="Portugal Escudo*"; $retVal['QAR']="Qatar Riyal"; $retVal['ROL']="Romania Lei"; $retVal['RON']="Romania New Leu"; $retVal['RUB']="Russia Ruble"; $retVal['SAR']="Saudi Arabia Riyal"; $retVal['SDD']="Sudan Dinar"; $retVal['SEK']="Sweden Kronor"; $retVal['SGD']="Singapore Dollar"; $retVal['SIT']="Slovenia Tolar"; $retVal['SKK']="Slovakia Koruny"; $retVal['THB']="Thailand Baht"; $retVal['TND']="Tunisia Dinar"; $retVal['TRL']="Turkey Lira*"; $retVal['TRY']="Turkey New Lira"; $retVal['TTD']="Trinidad and Tobago Dollar"; $retVal['TWD']="Taiwan New Dollar"; $retVal['USD']="United States Dollar"; $retVal['VEB']="Venezuela Bolivare"; $retVal['VND']="Vietnam Dong"; $retVal['XAF']="CFA BEAC Franc"; $retVal['XAG']="Silver Ounce"; $retVal['XAU']="Gold Ounce"; $retVal['XCD']="Eastern Caribbean Dollar"; $retVal['XDR']="IMF Special Drawing Right"; $retVal['XOF']="CFA BCEAO Franc"; $retVal['XPD']="Palladium Ounce"; $retVal['XPF']="CFP Franc"; $retVal['XPT']="Platinum Ounce"; $retVal['ZAR']="South Africa Rand"; $retVal['ZMK']="Zambia Kwacha"; return $retVal; } ?> <?php /* This is a sample file that demonstrates the usage of the currencyExchange class. For purposes of this example, make certain that currencyexchange_class.php is saved in the same directory as this file. */ //error_reporting(0); $path=pathinfo($_SERVER['PHP_SELF']); $path=$_SERVER['DOCUMENT_ROOT'].$path['dirname']; require_once("$path/currencyexchange_class.php"); $cx=new currencyExchange(); $cx->getData(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="imagetoolbar" content="no"> <meta name="mssmarttagspreventparsing" content="true"> <meta http-equiv="MSThemeCompatible" content="No"> <title>Currency Conversion Example</title> <style type="text/css"> body{ background-color: #eee; color: #333; font: small Verdana, Arial, Helvetica, sans-serif } #pricebox{ background-color: #f7f7f7; border:1px solid #000; margin: 50px auto; padding: 10px; width: 300px; } #pricebox h1, #pricebox h2, #pricebox p{ margin: 0; padding: 0; text-align: center; } h1{font-size: 160%;} h2{font-size: 140%;} </style> </head> <body> <div id="pricebox"> <h1>Get the New Widget</h1> <h2>Price $250.00 U.S. dollars</h2> <p><?php if ($euro=$cx->Convert("USD","EUR",250)){ $euro=number_format($euro,2); echo "€$euro Euros "; } if ($pound=$cx->Convert("USD","GBP",250)){ $pound=number_format($pound,2); echo "<br>\n£$pound British Pounds</p>\n" ."<p style=\"font-size:smaller;border-top: 1px solid #666;\">Non U.S. pricing based on exchange rates<br>\nin effect as of $cx->Date"; } ?></p></div> </body> </html>
  18. Thanks a lot for your help. I've been posting this question around on quite a few websites and you are the only one who replied. I really appreciate it. I'm just starting to learn php by the way. Just a few more questions if you don't mind. My understanding is that after my clients signup from my website. Form data (SSL) -> My server -> Validate -> cURL (Unencrypted) -> www.3rdparty.com/signup.php And the clients will stay on my website. Is this correct? - How about the Login process? I want my clients to login from my website (SSL enabled) and also have them land on www.3rdparty.com/interface as well. Can I also use cURL in this case? - I shouldn't worry about cURL travelling without encryption from my server to the 3rdparty's server, or should I? Thanks again.
  19. Hi, this is a bit complicated (for me at least). I'm noob in security. I'm making a reseller website and on my website there are user Signup and Login links which will redirect the user to my wholesaler's form pages. I can also place the forms on my own website and send the form values over to the wholesaler's php. So basically, I will be just putting up a website and won't be collecting any user information on my database. The issue is, the signup and login forms on the wholesaler's website are not secured. No SSL and no encryption. Is it possible to put my own secure form pages with SSL or encryptions? I want to make my site more trustworthy and I think it's my responsibility to protect customers credentials as well. But my feeling says that if I use SSL or encryptions on my form pages, the values must be decoded before they are sent to the wholesalers php, aren't they? So do I need to set up a server on my hosting to receive the encrypted data, decode them, and transfer them to the wholesaler's website? Is there any way that I can protect my customers from things like eavesdropping when they sign up for my website and I redirect the data to the wholesaler's part without having need to set up my own database? Or is it gonna make no difference because the wholesaler's form pages are not secured? I'm completely lost here. Geniuses please enlighten me.
×
×
  • 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.