Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Checking For Amazon Availability


Rather than reinvent the wheel, I was wondering if anyone had a tried and true and fast way of checking a string containing availabilty information for an Amazon request.




View Complete Forum Thread with Replies

Related Forum Messages:
Checking The Availability Of A Domain
I want to know whats the best way to check if a domain is available or not for registeration? Is there a recommended class i should use or is it easy to code myself?

View Replies !
Checking Room Availability For Hotel Booking System
I was wondering if anyone could help me with a problem I'm having.
I've been using Dreamweaver to create a hotel booking system for a
friend of mine, using MySQL (version 4.0.21) and PHP 5. The bit I'm
struggling with is checking the Room Availability based on dates that
are typed into a textfield and then returning a list of the available
rooms on the next page.

The three tables involved in this function are:

CREATE TABLE `room` (
Room_Number tinyint(1) UNSIGNED NOT NULL,
Price_Double_per_Night decimal(5,2) NOT NULL,
Price_Twin_per_Night decimal(5,2) NOT NULL,
Price_Single_per_Night decimal(5,2) NOT NULL,
Price_Double_per_Week decimal(5,2) NOT NULL,
Price_Twin_per_Week decimal(5,2) NOT NULL,
Price_Single_per_Week decimal(5,2) NOT NULL,
PRIMARY KEY(`Room_Number`),
)
TYPE=InnoDB
ROW_FORMAT=fixed;

CREATE TABLE `room_booking_link_entity` (
Room_Number tinyint(1) UNSIGNED NOT NULL,
Room_Booking_ID int(11) NOT NULL,
Single_Double_Twin enum('Single','Double','Twin') NOT NULL,
PRIMARY KEY(`Room_Number`, `Room_Booking_ID`),
INDEX `Room_Number`(`Room_Number`),
INDEX `Room_Booking_ID`(`Room_Booking_ID`),
FOREIGN KEY `Reference_14`(`Room_Number`)
REFERENCES `room`(`Room_Number`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY `Reference_85`(`Room_Booking_ID`)
REFERENCES `room_booking`(`Room_Booking_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
TYPE=InnoDB
ROW_FORMAT=fixed;

CREATE TABLE `room_booking` (
Room_Booking_ID int(11) NOT NULL AUTO_INCREMENT,
Customer_ID int(11) NOT NULL,
Bill_ID int(11) NOT NULL,
Date_of_Arrival date NOT NULL,
Date_of_Departure date NOT NULL,
Number_of_Nights tinyint(3) NOT NULL,
Date_Booking_Made date,
Status_of_Booking enum('Booked','Arrived','Departed') NOT NULL,
Total_Cost decimal(7,2) NOT NULL,
PRIMARY KEY(`Room_Booking_ID`),
INDEX `Room_Booking_ID`(`Room_Booking_ID`),
INDEX `Customer_ID`(`Customer_ID`),
INDEX `Bill_ID`(`Bill_ID`),
INDEX `Date_of_Arrival`(`Date_of_Arrival`),
INDEX `Date_of_Departure`(`Date_of_Departure`),
INDEX `Status_of_Booking`(`Status_of_Booking`),
FOREIGN KEY `Reference_03`(`Customer_ID`)
REFERENCES `customer`(`Customer_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY `Reference_14`(`Bill_ID`)
REFERENCES `bill`(`Bill_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
TYPE=InnoDB
ROW_FORMAT=fixed;

I've just discovered that MySQL 4.0.21 does not support subqueries.
I'm basically stuck with this version of MySQL. I think I've got
round the subquery problem by using a multi query option as follows:

1.Create a temptable that will store all of the room numbers that
have bookings for the particular dates requested as follows:

SELECT DISTINCT a.room_number INTO temptable
FROM booking_link_entity AS a INNER JOIN room_booking AS b
WHERE b.departure_date >$_POST[‘ARRIVAL'] And b.arrival_date <
$_POST[‘DEPART'];

2.Left join this with the room table and pull out rows with no match

SELECT a.room_number, b.room_number
FROM room AS a LEFT JOIN temptable AS b ON a.room_number=b.room_number
WHERE b.room_number IS NULL;

3.Delete temp table

I've tried doing this in Dreamweaver, but to no avail. I have a
feeling it is too complex for Dreamweaver.

My php knowledge is very basic and was wondering if anyone could give
me some pointers as how to do this in PHP?.

View Replies !
What's The Easiest Way To Build An Amazon "web Store" On My Site - Using Amazon Web Services?
I want to add some shopping pages to my site. I'd lilke to use the easiest
things possible, thought I am a PHP developer.

What's the easiest way to add a "web store" using Amazon web services or a
drop in availabel through someone.

I'm surprised it has not been written about in the Macromedia's web site.

View Replies !
PEAR Availability
I'm starting to look into PEAR, and it looks like there's some interesting
stuff in there. I'm wondering how much I can rely on it for a distributed
app. If I understand correctly, it's now included in the PHP distro, and
installed by default. What version did this start with? Is the default
installation just the base class, or are some of the packages included as
well? The tricky question is: does anyone have any idea of how commonly
it's installed? Do most hosting companies provide it? I know end users can
install it for themselves, but I have enough support issues without having
to hold users' hands on that.

View Replies !
PHP Availability Calendar
Do you guys know somewhere where i can find a script which creates a Calendar which can be controled via a database, so if a date is "occupied" then the date will be marked at BOOKED.

View Replies !
Availability Checker
I'm trying to build a site for Broadband and I am wanting to put a Broadband availability checker on my site like alot of other site have, However i am quite  new to PHP. Could someone point me in the right direction as how to go about producing the above?

View Replies !
Availability Calendar
where I could get a PHP based availability calendar for a holiday apartment website? I currently have the calendar as a html tables based affair that is updated via DW, but I am trying to migrate the site to PHP and wish to introduce a web based calendar that can be updated online.

I am looking for something similar to http://www.lanzarotebreaks.com/vill...ar.php/3882.htm that displays in a table format
but is controlled by PHP/MySQL, would like it to have online admin functionality. Am willing to learn how to handcode one if there are any good tutorials. Any help is gratefully received.

View Replies !
Availability Script
i have a number of villas in spain but id like to be able to show there availability online to prosepctive clients to cut down on wasting there time when a particular villa is not available!

i need to be able to show booked and available periods from anything from 1 day to two months, does anyone know i way i could do this, are there any ready made scripts out there doing this.

View Replies !
PEAR Availability On Web Hosts
Just wondering if anybody knew the availability of PEAR classes on most web hosts... i mean like if i write a script using say the PEAR db abstraction class, would most web hosts have the PEAR class installed and in the include_path so that my script would work?

View Replies !
Varying Availability Of Libraries
I'm having problems connecting to postgres via php.  Error message = 'undefined function' when I make the call to pg_connect.  I have modified the php.ini file to enable the extension=php_pgsql.dll line.  The .dll in question exists in both windows and the defined php extensions directory.  I have confidence that the php.ini file in question is the one in use by Apache (if I rename, everything bombs). Code:

View Replies !
Writing Pseudo For Availability
creating an online store for a project in on of my classes. I've searched around and cant really find how to create some availability scripts. How can I create a script to check our database on whether certain things are available? Any suggestions? Just asking for a good starting point.

View Replies !
Check Availability Button
I have a form that accepts user info. I want to create a button that enables the user to check for the availability of the username entered before continuing with the rest of the form. I have tried using the button onclick to call a JS function. The JS function have codes to compare the username with database select.

View Replies !
Date Columns Availability
I done an availabilitycheck that until now seems to work just perfect, except 1 problem. For exampel in the database if I have an booking in datecolumns llegada and salida dates 25/11 and 15/12, I would like the days 25/11 and 15/12 to be marked as available. This is the code I have:

$result = mysql_query ("SELECT llegada, salida, propiedad from bookings where ( propiedad = '$propiedad' )
AND (('$llegada' BETWEEN llegada AND salida) or ('$salida' BETWEEN llegada AND salida) or (llegada < '$llegada' AND salida > '$salida') or (llegada > '$llegada' AND salida < '$salida'))", $dbh);

In this piece of the code this is what I would like to do but don´t work:
('$llegada' BETWEEN llegada AND salida-1) or ('$salida' BETWEEN llegada-1 AND salida)

View Replies !
Calender - Availability Chart
I have availability on my site in an calendar and I manually introduces if available for that day or not. But I want to do it autmatically. At the moment I have the reservations in an database table, I have arrival in one column and departures in another column, both date types.

View Replies !
Redirection And Server Availability
I have two servers, one hosted and one local. My local server uses dynamic dns and I am trying to write a script on my hosted server that will check to see if my local server is accessible. If it is accessible I would like the script to do a browser redirect to my local server. If the connection can't be made I would like the script to be in the header of an index page on the hosted server or redirect to a valid page one the hosted server. From what I've found on the net it should be possible using socket() but am not sure how to go about it.

View Replies !
Amazon PHP Lib
Is there any PHP library out there to access the amazon API?

View Replies !
Amazon AWS
I've recently signed up and want to build an app that'll query the Amazon db via their XML API and dump the results into a MySQL db where I can do more complex queries and such. I'd like to automate the dump so that it happens every 12 hours. Has anyone here done this one yet?

View Replies !
Check Room Availability System
I am super new to php/mysql etc. i am just trying to do a room availability system.
I have 5 rooms in 5 different category. i like to know how to design a DB and write a php that takes two different dates[checkin date / checkout date] and verifies the DB for availble rooms.

View Replies !
Ajax Script To Search Domain Name Availability In Php
hai friends can any one of you do my favour and send the script to
"search domain name availability in php using ajax"

View Replies !
Amazon E-Commerce Service And PHP
Hi, I was trying to implement the Amazon E-Commerce Service on my php
powered website. For a start, the Amazon Developer center only has
examples for C# and Asp.NET ... anyone has a resource where I can find
specific help about implementing that service on php?

View Replies !
Check To See If IMG Exist At Amazon
Im trying to check if a textbook image exist at Amazon.com. I use the link below to display the textbook img by the particular isbn #.

<img src="http://images.amazon.com/images/P/<?php echo "$isbn";?>.01.MZZZZZZZ.jpg">

I have tried using the code below but it does not work because Amazon's image server returns a 807 byte image (looks empty) when it is accessed. Unfortunately I think this code requires a 404 response. Any ideas?
Thank for your help

<?php
//check if image exists
if($img = @GetImageSize("http://images.amazon.com/images/P/echo '$isbn'.01.MZZZZZZZ.jpg"))
{
echo "image exists";
}
else
{
echo "image does not exist";
}
?>

View Replies !
Uploading To Amazon Marketplace
Anyone familiar with amazon marketplace? I've got some products on, but the upload process is SO laborious, and I can't seem to find any info an an API for uploading products. I've got a perl script, but I can't get it to do much, and I'm not sure if it's suitable for UK market place anyway. Anyone know if there's a php api for uploading products, and can be used for marketplace uk?

View Replies !
Build Amazon Store Using PHP
I would like to build a "store" offering products related to my web site. Only when they are ready to check out are they sent to amazon.com. Amazon only has examples for Pearl, Java and .Net. I use PHP and feel out of luck. Any ideas for the easiest way to build this "store"?

View Replies !
Pulling Info From Amazon.com
Does anyone know how this site created these pages from Amazon.com? I'd like to do something similar but don't know if Amazon is providing the RSS or if they get they're code from a 3rd party.

View Replies !
Amazon-Web Services Without Fopen () - Is That Possible
want to run a AWS product feed and - unfortunatley my server is limited - it is configured with allow_url_fopen to off! that means:

i may have troubles to process requests - since (in my humble opinion) Amazon web services only function with the fopen-option: is this correct. Does any AWs (even in the new standard ecs 4 ) make usage of the fopen - function? Code:

View Replies !
Amazon Like Online Book
I am building an online book store in PHP. I need all the catogories and then sub-categories and then sub and so on just like in Amazon

eg: Books --> Computer --> Software Applications --> Web Development --> Scripting --> PHP


View Replies !
Extract And Display Amazon.com Xml Feed
I was wondering if anyone could demonstrate using php to extract and display an Amazon xml feed. Lets say the following one:

http://xml.amazon.com/onca/xml2?t=w...te&page=1&f=xml

Something very simple will do, such as extracting the first image and link within the file and outputting it. I'm just learning php and xml, and am having heeps of trouble getting my code to work (using php DOM).

View Replies !
Amazon Api - Call To Undefined Function
i've used the Amazon PHP api for several months now to pull amazon data into
my affiliate site - but recently i'm starting to get "call to undefined
function" errors

" Fatal error: Call to undefined function: asinsearchrequest() in"

What's strange is that problem is intermittent - and there is no way to
reproduce it exactly - it just appears to come and go. I'm using nusoap as
well.

Whilst googling around , i noticed another site has a similar issue:

if the page appears normally, just refresh a few times to get the amazon
error.

Another else notice this problem and if there's any solution? I suspect
Amazon might have done something to their API ?

View Replies !
Multidimesional Arrays With Amazon Script
My PHP skills are very rudimentary, i understand arrays but i don't understand how THIS array is indexed

Basically i have an XML document that is parsed from Amazon. I can access the XML tags using for eg. $item['ItemAttributes']['Author'] (inside a foreach loop where there are multiple items inside of ItemResponse->Items) But i can't seem to drill down to a third level. For example $item['OfferSumary']['Offers']['Currency']

This is the class that parses the xml and makes the array. Code:

View Replies !
Getting Amazon Images Remotely...slow
I'm working on a script to load my database up with some product info from Amazon's AWS.
As you may know, the AWS does not return dimensions with the image url.

I tried using getimagesize on the remote URL, it would literally take over a minute per image.

I used a script at from O'Reilly's hackbook (#477) to cache the .jpg locally and then getimagesize it. Here it is: Code:

View Replies !
Amazon Web Services Without Fopen - Doable
well i have some troubles i want to run a AWS product feed and - unfortunatley my server is limited - it is configured with allow_url_fopen to off! that means:

i may have troubles to process requests - since (in my humble opinion) Amazon web services only function with the fopen-option: is this correct. Does any AWs (even in the new standard ecs 4 ) make usage of the fopen - function? Code:

View Replies !
Star Rating System - Similar To Amazon
I'm looking at adding a rating system to my site, similar to that seen on Amazon. Basically users can rate the product out of 5 stars.

I've been racking my brains to think of the calculation to get the average customer rating... but I can't think how to do it.

And looking at Amazon's system, I think their caculation may be incorrect. If you take this page for example:

View Replies !
Is There A Way To Pull Out Book Review Data From Amazon?
I know their I can use the rss feed for their books with their API, but is there a way to pull out book review data from Amazon???

View Replies !
Amazon "Plug And Play" API
I am looking to add certain widget related products to my site and am researching Amazon's API. Not knowing a whole lot about XML I was hoping there would be a PHP script that takes care of that part, while I can customize the functionality and presentation. Am I missing something? Amazon talks about how easy it is to implement but I can't get started. Do you have to know XML to run it? Anythin open source out there?

View Replies !
Amazon "Lite" Version
Create a PHP script which will read in a variable keyword and, with the data contained in that variable, query Amazon for items related to that data, and return those items. This amounts to adding &Keywords= to your standard Amazon query string. Post it on your website as midterm.php

I've made the html and the xml file okay, but it's the php file that's giving me trouble. The point of the project is to create a search bar that will reference one of Amazon's items (like books, movies, etc.), then allow the user to type in whatever and search for it. My php file looks like this: Code:

View Replies !
I Want To Create Something Like AMAZON: Those Who Liked Page A Also Liked Page B
I want to create something like AMAZON: those who liked page A also liked
page B (I am going to apply the concept to a few different selections, but
to keep it simple I will talk about page popularity here - like AMAZON talks
about purchase patterns: those who bought A also bought B, C and D).

In my mysql table, I record everytime a visitor looks at a particular page
(I keep track of people with sessions and they can only look at a page
once).

Next, what I want to do is to show a small list of similar likes. That is,
people who had an interest in page A also had an interest in page B.

The structure of my table is:
id
timestamp
session_id
page_name

There is a unique index on the combination of session_id and page_name.

To work out similar likes for page X, my idea was to make an array of all
the session ids that looked at page X and then select the top 10 of pages
that these folk looked at.

My question is, should I do this in PHP with a bunch of arrays, adding total
counts while looping through an array or shall I use SQL statements. I
could even make a really long string of WHERE session_id = A or session_id =
B, etc..... Although this seems really inefficient.

Another question I have is whether you think this will be a self-fulfilling
prophecy (e.g. if you say that page Y is also popular then people will check
it out and therefore make it more popular).

View Replies !
URL Checking?
how do you check if a browser came from a specific URL??

View Replies !
Checking For XSS ?
Does the check below ensure that the files are originating from my server,
i.e. to prevent or detect
any type of XSS ? Or is the HTTP_HOST easily spoofed ?

function test ($refer)
{
if (!stristr($refer, $_SERVER["HTTP_HOST"])) {
die();
} else {
}
}

test ($_SERVER["HTTP_HOST"]);

View Replies !
IP Checking
I have to do this for security measures on a script I am doing: To ensure the authenticity of the HTTP requests you should only accept requests from the following IP addresses: 80.87.132.0/26 (ie .0 -> .63) is there a simple way to do a range of IPs ie
IF $ipaddress == 80.87.132.* If not does anyone have a good function for this?

View Replies !
Checking %'s
Is there a built in function to check if a value is a certain % of a different value?

Like:
If($Value < 10% $value2)

sort of thing ?

Or do i have to work out the 10% first then check against that?

View Replies !
Value Checking
I have a select menu generated using PHP. One option is to have a value of 0

PHP Code:

echo '<option value="0">Select Course</option>'

Then the following code is to check what option is selected...

PHP Code:

if($course == 0)
{
   echo '<p>Please select a course</p>'
     echo '<p><a href="javascript:history.back(1)">Return</a></p>'
     exit;
}

My problem is I can't get the checking working correctly.

View Replies !
Checking URL
I want to check the URL, and if it is the one I am looking for, then I want to show something. So how would I check the URL?

View Replies !
Spell Checking
How can i spell check without including the aspell or pspell libraries ( can't include them because i'm on a virtual host ). I don't mind if its an external service. Spellchecker.net was great, expect now you have to pay for it.

View Replies !
Checking A Field
I've seen a couple of form generation and validation scripts.

View Replies !
Checking Input Of An Url Or Ip?
i do use the following code:

Code:
if ($siteurl == "") {
$badreg = true;
$valid_url = false;
echo "<span class='main'><font color='#C10000'><b>Error:</b></font> Please check your url.<br>
";
} else {
$valid_url = true;
$siteurl = ereg_replace("http://", "", $siteurl);
list($domain, $file) = explode("/", $siteurl, 2);
$siteurl = "http://" . $domain . "/" . $file;
}

Any idea how i could extend the " if ($siteurl == "") { " for checking for valid domain names and ip-addresses?

View Replies !
Checking If A Url Works
ok i need to check a url to make sure it works, and if it does, then
i want to print out "online", and if it returns 404 then i want to
print out "offline". how do i check if the url works or not?

View Replies !
Checking Paramters In The Url Bar
<?php
if ((!isset($s)) && (!isset($msg))) {
echo("<table>
....

I want some pictures displayed on the main page if its a new visit, but when they search and the url bar changes its skips displaying them, to save scrolling down all the time.

I tried the above to read the parameters but get an error when they are not set.

Is there something simple like this :

if (url has no parameters) {
echo("...draw front page section")

View Replies !
PHP And CGI Checking Of The Code
im trying to write a php app for my forums so when a user posts a message that has some programming code in it they can click on a link i plan on setting up that has a text box for them to paste the code into and hit a button (well call it submit) after they hit the button then the code is read and the syntax of this code is colorized much like Crimson editor does for its differant sytanx.

programming the checking of the code isnt my problem im having trouble figureing out a way to make it so when they inpute it it gets sent to a php program to be checked and then sent back with the proper color tages..so if they were to enter in the text box:

<?php
// blah blah blah
then soem more crap here
?>

they then hit submit the program checks it and sees the syntax for php so it coloriz's it as php syntax and sends back the text liek this

<?php
// blah blah blah
then some more crap here
?>
Quote:
and the code would looke liek this the [] are () so it doesnt show colors in this part but the code will be with the []
<?(color=blue)php(/color)
(color=green)// blah blah blah(/color)
then some more crap here
?>

and then when they copy and paste it into the forum its then colorized as php syntax, any ideas or a tutorial on how to get a CGI script to call a php file to runs checks would be great.

View Replies !
Password Checking
I am having a problem with a script that i am using for a user logging, especially regarding the password comparison. what i am trying to do is search mysql database for usernames from the user inputs. this should then put the results into the variable and then i am comparing the database password to the password the user entered.

if it matches then the user is logged into the system. Here is the code, any comments would make me a v happy man! I have declared all the database variables but i wont include them for obvious reason =) Code:

View Replies !
Credential Checking
I was wondering if you anyone knew of a good credentail checking
script to give me a starting point for some scripts.

View Replies !
Checking For Sessions
I have built a cms which is password protected. Each page uses a session to check for the password, and presents info if the password is registered. This all works fine on my server, but when I put it on the clients server, the session doesn't work. And yes, I have changed all the needed info to correlate with her server.

I think the session isn't working. Is there a way I can check the session functionality of the php engine. Like php.ini or something?

View Replies !
Checking URL Problem!!!
I've been writing a page to check whether a url is alive or dead. But
I keep having problem with my php function. The code below is my php
function and 2 urls to test (one is always alive and one is dead-not
valid).
============== check url function ==========
<?php

//This function return HTTP code.
function check_url($url){

// Break the URL down into its parts.
$url_pieces = parse_url ($url);
$path = ($url_pieces['path']) ? $url_pieces['path'] : "/";
$port = ($url_pieces['port']) ? $url_pieces['port'] : 80;
$host = $url_pieces['host'];

$fp = fsockopen ($host, $port, &$errno, &$errstr, 10);
if (!$fp) {
return "$errstr ($errno)";
} else {
fputs($fp, "HEAD $path HTTP/1.0

");
fputs($fp, "HOST: $host
");
fputs($fp, "CONNECTION: close

");

$data = fgets ($fp,128 );

//echo $data;

fclose ($fp);

$array = explode (" ", $data);
return $array[1]; // Return the HTTP code.
}
}

$url1="http://yahoo.com";
$url2="http://www.kdkdkdkdkdkdkdkdk.com";

$check1 = check_url($url1);

echo $url1." ".$check1."<br>";

$check2 = check_url($url2);
echo $url2." ".$check2;

?>
=============================================

The output that I have looks like 2 lines below:

http://yahoo.com 200
http://www.kdkdkdkdkdkdkdkdk.com 200

where 200 represents that a link is alive. However for the second url,
HTTP code can't be 200 because that url doesn't exist.

I don't know what wrong with my code,

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved