Jump to content

devain

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by devain

  1. Hello Everyone was wondering if I could get some help with the following code? I am querying a database for results of listings that are in a database these listings are displayed on the page in a form. I am wanting each listing to be on a different page. Below is my code. $lim=1; if (!isset($s) || $s < 1 || !is_numeric($s)) { $s = 1; } $start = ($s - 1) * $lim; $sql = "select id,bussimg,imagewidth,imageheight,email,usridm,company,businesscategory,address1,address2,state,city,zip,website,email,repname,description,phonenumber,country,status from $approvecheckbusinesses where usridm='$user_id'"; $result=db_query($sql); $countpages = $sql; $sql = $sql . " order by id asc limit $start, $lim"; $result=db_query($sql); $pages = ceil(mysql_num_rows(mysql_query($countpages)) / $lim); $result=db_query($sql); for ($i = 0; $i < mysql_num_rows($result); $i++) { $Listid= mysql_result($result, $i, "id"); $usridm= mysql_result($result, $i, "usridm"); $CompanyName= mysql_result($result, $i, "company"); $realname= mysql_result($result, $i, "repname"); $email= mysql_result($result, $i, "email"); $BusinessCategory= mysql_result($result, $i, "businesscategory"); $status= mysql_result($result, $i, "status"); echo ("FORM IS TO BE DISPLAYED HERE"); } if ($pages > 1) { echo("<p align=left style='font-size: 85% color=white'>"); for ($i = 1; $i <= $pages; $i++) { echo("["); if ($i == $s) {echo("<b>");} else {echo("<a id=home_offerLink href='index.html?EditMemberListing&user_id=$user_id&s=$i'>");} echo("Page $i"); if ($i == $s) {echo("</b>");} else {echo("</a>");} echo("] "); } echo("</p>") Page Numbers here using the above code.. The problem I seem to be running into is that it only displats the first record. The page numbers show up page 1 page 3 page 2 and three are blank there is no mysql error or anything for some reason I only get that first result out of three
  2. By the way thanks everyone for the help with this After removing the generic error codes I came up with this error Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /home/eye123/public_html/track.php:44 Stack trace: #0 [internal function]: SoapClient->__doRequest(’<?xml version=”...’, ‘https://gateway...’, ‘track’, 1, 0) #1 [internal function]: SoapClient->__call(’track’, Array) #2 /home/eye123/public_html/track.php(44): SoapClient->track(Array) #3 {main} thrown in /home/eye123/public_html/track.php on line 44 Then after a couple of days of trying to figure out what this error was and trying different soap call constructs I decided that it was not the code and turned to my soap install After recompiling soap with the following below I got everything to work So thanks everyone for the help and input --enable-soap' '--enable-sockets' '--enable-wddx' '-- soap Soap Client enabled Soap Server enabled Directive Local Value Master Value soap.wsdl_cache 1 1 soap.wsdl_cache_dir /tmp /tmp soap.wsdl_cache_enabled 1 1 soap.wsdl_cache_limit 5 5 soap.wsdl_cache_ttl 86400 86400
  3. Is there a function built into php that will do the conversions or something like that
  4. Just a quick question about currency conversion Was wondering what would be the best way to go about converting prices on my site like this site does at the top of the page. If you look where the flags are when clicked it converts the currency through out the site. www.fragrancenet.com
  5. Hello Everyone I am having issues with fexex's new soap and WSDL web services. I am trying to get tracking results with their new service was wondering if I can get some help on this. I am attaching the code, and the wsdl What am I doing wrong?? I get the following error on the page Fault Code:HTTP String:Could not connect to host Below is the code and the link that fedex provided to me I am not sure where to use this link in the following code as I am new to soap https links https gatewaybeta.fedex.com:443/web-services development url https gateway.fedex.com:443/web-services production url all files were downloaded from the fedex.com/developer eyeglasses123.com/track.php require_once('fedex-common.php5'); error_reporting(E_ALL); $newline = "<br />"; $path_to_wsdl = "TrackService_v2.wsdl"; ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($path_to_wsdl, array('trace' => 1)); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information $request['WebAuthenticationDetail'] = array('UserCredential' => array('Key' => 'Nu7mKVoi6CruG3BH', 'Password' => '2WTI0OChPx1U7yprVqjosFpM7')); // Replace 'XXX' and 'YYY' with FedEx provided credentials $request['ClientDetail'] = array('AccountNumber' => '510087542', 'MeterNumber' => '1220784');// Replace 'XXX' with your account and meter number $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['Version'] = array('ServiceId' => 'trck', 'Major' => '2', 'Intermediate' => '0', 'Minor' => '0'); $request['PackageIdentifier'] = array('Value' => '791135731525', // Replace with a valid tracking identifier 'Type' => 'TRACKING_NUMBER_OR_DOORTAG'); $request['IncludeDetailedScans'] = 1; try { $response = $client ->track($request); if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR') { foreach ($response -> TrackDetails -> Events as $event) { if(is_array($response -> TrackDetails -> Events)) { echo $event -> Timestamp . ': '; echo $event -> EventDescription . ' - '; echo $event -> Address -> City . ' '; echo $event -> Address -> StateOrProvinceCode . $newline; } else { echo $location . $newline; } } printRequestResponse($client); } else { echo 'Error in processing transaction.'. $newline. $newline; foreach ($response -> Notifications as $notification) { if(is_array($response -> Notifications)) { echo $notification -> Severity; echo ': '; echo $notification -> Message . $newline; } else { echo $notification . $newline; } } } writeToLog($client); // Write to log file } catch (SoapFault $exception) { printFault($exception, $client); } included fedex-common.php5 define('TRANSACTIONS_LOG_FILE', 'fedextransactions.log'); // Transactions log file /** * Print SOAP request and response */ function printRequestResponse($client) { echo '<h2>Transaction processed successfully.</h2>'. "\n"; echo '<h2>Request</h2>' . "\n"; echo '<pre>' . htmlspecialchars($client->__getLastRequest()). '</pre>'; echo "\n"; echo '<h2>Response</h2>'. "\n"; echo '<pre>' . htmlspecialchars($client->__getLastResponse()). '</pre>'; echo "\n"; } /** * Print SOAP Fault */ function printFault($exception, $client) { echo '<h2>Fault</h2>' . "\n"; echo "<b>Code:</b>{$exception->faultcode}<br>\n"; echo "<b>String:</b>{$exception->faultstring}<br>\n"; writeToLog($client); } /** * SOAP request/response logging to a file */ function writeToLog($client){ if (!$logfile = fopen(TRANSACTIONS_LOG_FILE, "a")) { error_func("Cannot open " . TRANSACTIONS_LOG_FILE . " file.\n", 0); exit(1); } fwrite($logfile, sprintf("\r%s:- %s",date("D M j G:i:s T Y"), $client->__getLastRequest(). "\n\n" . $client->__getLastResponse())); } wsdl file is located at eyeglasses123.com/TrackService_v2.wsdl log file is located eyeglasses123.com/fedextransaction.log If anyone can get this working or any help on this would be appericated I tried to attach a zip of all the files but I cannot
  6. wsdl file is located here eyeglasses123.com/track/wsdl/TrackService_v2.wsdl Has anyone tried to use this method to connect to fedex for tracking information
  7. sorry eyeglasses123.com/track/Track.php
  8. I fixed the code:http error now I am getting the following error Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '/home/eye123/public_html/track/wsdl/TrackService_v2.wsdl' in /home/eye123/public_html/track/Track.php:15 Stack trace: #0 /home/eye123/public_html/track/Track.php(15): SoapClient->SoapClient('wsdl/TrackServi...', Array) #1 {main} thrown in /home/eye123/public_html/track/Track.php on line 15 link is eyeglasses123.com
  9. I cannot attach the wsdl file its to big I get the following error when executing the script CODE:HTTP String:Could not connect to host
  10. Hello Everyone I am having issues with fexex's new soap and WSDL web services. I am trying to get tracking results with their new service was wondering if I can get some help on this. I am attaching the code, and the wsdl What am I doing wrong?? Here are two of the links that fedex gave me two are in the wsdl file and one I dont know what to do with and fedex was no help they did provide the following code which I am posting below it consists of three files the wsdl, a functions file for error and tracking and the track.php code which is suppose to be loaded via http Track.php file require_once('library/fedex-common.php5'); $newline = "<br />"; $path_to_wsdl = "wsdl/TrackService_v2.wsdl"; ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($path_to_wsdl, array('trace' => 'all')); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information $request['WebAuthenticationDetail'] = array('UserCredential' =>array('Key' => 'Nu7mKVoi6CruG3BH', 'Password' => '2WTI0OChPx1U7yprVqjosFpM7')); // Replace 'XXX' and 'YYY' with FedEx provided credentials $request['ClientDetail'] = array('AccountNumber' => '510087542', 'MeterNumber' => '1220784');// Replace 'XXX' with your account and meter number $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['Version'] = array('ServiceId' => 'trck', 'Major' => '2', 'Intermediate' => '0', 'Minor' => '0'); $request['PackageIdentifier'] = array('Value' => '963051995450', 'Type' => 'TRACKING_NUMBER_OR_DOORTAG'); $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request v2 using PHP ***'); $request['IncludeDetailedScans'] = 1; try{ $response = $client ->track($request); if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR') { print $response; foreach ($response -> TrackDetails -> Events as $event) { if(is_array($response -> TrackDetails -> Events)) { echo $event -> Timestamp . ': '; echo $event -> EventDescription . ' - '; echo $event -> Address -> City . ' '; echo $event -> Address -> StateOrProvinceCode . $newline; } else { echo $location . $newline; } } printRequestResponse($client); } else { echo 'Error in processing transaction.'. $newline. $newline; foreach ($response -> Notifications as $notification) { if(is_array($response -> Notifications)) { echo $notification -> Severity; echo ': '; echo $notification -> Message . $newline; } else { echo $notification . $newline; } } } writeToLog($client); // Write to log file } catch (SoapFault $exception) { printFault($exception, $client); } library/fedex-common.php5 define('TRANSACTIONS_LOG_FILE', 'fedextransactions.log'); // Transactions log file /** * Print SOAP request and response */ function printRequestResponse($client) { echo "test $trackingnumber"; echo '<h2>Transaction processed successfully.</h2>'. "\n"; echo '<h2>Request</h2>' . "\n"; echo '<pre>' . htmlspecialchars($client->__getLastRequest()). '</pre>'; echo "\n"; echo '<h2>Response</h2>'. "\n"; echo '<pre>' . htmlspecialchars($client->__getLastResponse()). '</pre>'; echo "\n"; } /** * Print SOAP Fault */ function printFault($exception, $client) { echo '<h2>Fault</h2>' . "\n"; echo "<b>Code:</b>{$exception->faultcode}<br>\n"; echo "<b>String:</b>{$exception->faultstring}<br>\n"; writeToLog($client); } /** * SOAP request/response logging to a file */ function writeToLog($client){ if (!$logfile = fopen(TRANSACTIONS_LOG_FILE, "a")) { error_func("Cannot open " . TRANSACTIONS_LOG_FILE . " file.\n", 0); exit(1); } fwrite($logfile, sprintf("\r%s:- %s",date("D M j G:i:s T Y"), $client->__getLastRequest(). "\n\n" . $client->__getLastResponse())); }
  11. Problem solved and the article on "normalization" is a really good read. I appericate it.
  12. thanks I will read the link and try the code I appericate the post and reply will let you know how it goes
  13. CREATE TABLE `image` ( `id` int(11) NOT NULL auto_increment, `imagename` varchar(200) default NULL, //name of the image `description` text, //description text of the image `picture` varchar(200) default NULL, // location of the image this can be used and pulled to display the image from its location as a variable `customername` varchar(200) default NULL, // customer name `customerid` varchar(200) default NULL, // unique customer id PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; something Like this
  14. I am new to working with arrays and it took me alot of hours to come up with the following Was Wondering if I could get some input on some code to see if I am getting it right. Dont know if this a efficient way of doing it but it seem to work sorta with the exception of the list statement. I am hoping I am posting this in the right section. Products table contains a array categories(cat1,cat2,cat3) What I am wanting to do is display the results by searching the array if the $category listed below is in the array display that product Products Table is as follows id product_name categories 41708 TEST cat1,cat2,cat3,cat4 Here is the test page which is not displaying the results http://72.29.78.150/~restore/test3.php $category='cat1'; // still not sure why you have to have this before the query I am assuming that this tells php that its going to be an array and is blank until query $cat_categories = array(); // still not sure why this has to be here before the query I am assuming that this tells php that its going to be an array and is blank until query $all_categories = array(); /// ---------------------------------------------- // Query the database which is selecting all entries in the products tabls $query = "SELECT product_name,id,categories from products limit 5"; $result = mysql_query($query) or die(mysql_error()); while($row = MySQL_fetch_assoc($result)){ // read this still not really sure why I need the array //merge especially since I am only dealing with one table that contains the array cat1,cat2,cat3 $categories = array_merge($cat_categories,explode(',',$row['categories'])); if (in_array("cat1", $categories,0)) { echo("<br><br>TRUE<br> If $ category='cat1' is in array this is where I want to create vairables for the fields product_name and id to display each product meaning more then one to user<br><br>"); echo "<br>Product ID:<br>" . $row['id'] . "<br>"; echo("<br>"); echo "Product Name:<br>" . $row['product_name'] . "<br>"; // I have tried $result here but nothing also list($product_name, $id) = $row; // Variables I want to use using the list function above but not working echo("<br><br> Trying to use the below Variables which are $ product_name $ ID using the list function but does not seem to be working"); echo("<br><br>Product Name:<br>$product_name<br><br>Product_Id:$id<br>"); /// Else statement if no results exist }else{ echo("<br>-------------------------------------------------------------------------------"); echo("<br><br>false<br><br> This is displaying as the else statement if it does not exits"); } } Thanks any help would be appericated
  15. let me repost the question maybe I will get some help on how to accomplish this so I am going to reword maybe I wasnt clear hopefully I am this time have issues with ordering I have values stored in the database as datetime values when pulled from the database they display as Y-m-d = 2007-04-30 When ordering as follows order by startdate desc it displays the most current according to the startdate of the event for example select Bla, Bla,Bla, startdate from events where event=1 order by startdate desc"]select Bla, Bla,Bla, startdate from events where event=1 order by startdate desc this will display all dates in the furture on down What I am wanting to display all events that are in the current month starting from the current day that it is for example todays date 2007-04-22 April April Events event 1 2007-04-22 event 2 2007-04-23 event 3 2007-04-24 event 4 2007-04-24 May events event 1 2007-05-22 event 2 2007-05-23 event 3 2007-05-24 event 4 2007-05-24 June Events event 1 2007-06-22 event 2 2007-06-23 event 3 2007-06-24 event 4 2007-06-24 and so on: and if there are no events for furture dates then display older events prior to April events. Below is some code I am working with I am wondering if there is a way to do this with the following code or do I have to make seperate statements for each month. Any help wold be greateful Thanks $lim=20; if (!isset($s) || $s < 1 || !is_numeric($s)) { $s = 1; } $start = ($s - 1) * $lim; ///// Current Time Value and Format displays as 2007-m-d Hour:min:sec $time=date("Y-m-d H:m:s"); //// Explode and seperate the date from the time create a array which consists of array 0 and 1 //// Array 0 = Date Array 1 = Time $time_array = explode( ' ',$time); ////// Explode date Array to get Year Month Day Values $time2 = explode("-", $time_array[0]); ///////Day Month Year Values created a vairables $day1=$time2[2]; // displays in format 01 day - 31 days depends on day $month1=$time2[1]; /// displays in format 01 month - 12 month depends on month $year1=$time2[0]; /// Displays as 2007 or whatever year it is //select information from database to be displayed and counted for page results $fquery = "select id,title,summary,hits,status,key1,key2,key3,filename,startdate from pr where event=1 "; /// Counts pages to display page1 page 2 and so on $countpages = $fquery; //// order statement and limit number of pages $fquery = $fquery . "order by startdate desc limit $start, $lim"; //// $res = mysql_query($fquery); $pages = ceil(mysql_num_rows(mysql_query($countpages)) / $lim); //// If pages greater then on based on limit then echo extra pages and display results accord. if ($pages > 1) { echo("<p align=left style=\"font-size: 85%\">"); for ($i = 1; $i <= $pages; $i++) { if ($i == $s) {echo("<b>");} else {echo("<a id=home_offerLink href=userlist.php?y=3&a=$a&s=$i&email_search=$email_search>");} if ($i == $s) {echo("</b>");} else {echo("</a>");} } echo("</p>"); } echo(" <center> <table align=center border=0 cellpadding=2 width=90%> "); //// Loop through results create vairables for each result for ($i = 0; $i < mysql_num_rows($res); $i++) { $id= mysql_result($res, $i, "id"); $title= mysql_result($res, $i, "title"); $filename= mysql_result($res, $i, "filename"); $title=stripslashes($title); $title=stripslashes($title); $summary= mysql_result($res, $i, "summary"); $summary=stripslashes($summary); $summary=stripslashes($summary); $startdate= mysql_result($res, $i, "startdate"); ///// display results order results echo results
  16. Thanks for the reply not quite what I am looking for.. I am having no problems displaying the date and or ordering from latest events in 2007 to eairlest. I am wanting to order the event by current date meaning if I have 12 events in April I want to list the events in April first. Then the events in May June and July. When May comes around I want to be able to show Mays at the top then june and july. Is there a possible way to do this?
  17. Any help on this Subject? Thanks Devain
  18. Hello Everyone I am hoping someone can help me dont know why but for some reason I am having problems ordering by currentdate.. What I have below is a query that pulles values from the database to be displayed. in the Fquery are the values the last being startdate. This value startdate is the event date (with DateTime in the database which is displayed as 4/7/2007 5:00:00 PM) I have no problems sorting by startdate which sorts as follows: Event Date: Jun 12, 2007 8:00 PM Event Date: May 31, 2007 8:15 PM Event Date: May 24, 2007 6:00 PM Event Date: Apr 24, 2007 6:00 PM and so on starts from furture dates and down What I am wanting to do is show the current date April first then may then June etc. If anyone can help would be appericated thanks
  19. Hello I am currently working on some watermark code for a site everything works great as far as the code that I am going to post below my question is when l link to the image what I would like to do is when the person right clicks on the image I would like it to download the png overlay instead of the image and I am not sure how to accomplish this below is the code and How I pull the image and overlay from the file. [code] //session_start(); $db_host = ''; $db_user = ''; $db_pwd = ''; $db_name = ''; mysql_connect($db_host, $db_user, $db_pwd) or die(mysql_error()); mysql_select_db($db_name) or die(mysql_error());    $res=mysql_query("select imageno, picture2 from image where id='$id'"); $data=mysql_result($res,0,"imageno"); $dir=mysql_result($res,0,"picture2"); //session_start(); header('content-type: image/jpeg'); $imagesource =  $dir; $filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); if($filetype == ".gif")  $image = @imagecreatefromgif($imagesource);  if($filetype == ".jpg")  $image = @imagecreatefromjpeg($imagesource);  if($filetype == ".png")  $image = @imagecreatefrompng($imagesource);  if (!$image) die(); $watermark = @imagecreatefrompng('watermark.png'); $imagewidth = imagesx($image); $imageheight = imagesy($image);  $watermarkwidth =  imagesx($watermark); $watermarkheight =  imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/2); $startheight = (($imageheight - $watermarkheight)/2); imagecopy($image, $watermark,  $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); imagejpeg($image); imagejpeg($image); imagedestroy($watermark); imagedestroy($image); [code] this is the image tag that pulls the image <img src="http://www.domain.com/showp1.php?&id={id}"  > any help would be appericated [/code][/code]
×
×
  • 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.