frank1002us
-
Posts
10 -
Joined
-
Last visited
Never
Posts posted by frank1002us
-
-
the second value of the xmlhttpPost("test.php","c385982294011B") is not available in the function xmlhttpPost(strURL,form_name) . if i define a value for the form_name inside the function, it is passed with "getquerystring(form_name)" what is the stupid problem :'(
<input value="Respond" type="button" onclick='javascript:xmlhttpPost("test.php","c385982294011B")'>
function xmlhttpPost(strURL,form_name) { var xmlHttpReq = false; var self = this; // Mozilla/Safari formname=form_name; if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq.open('POST', strURL, true); self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { updatepage(self.xmlHttpReq.responseText); } } self.xmlHttpReq.send(getquerystring(form_name)); }
-
the form has multiple buttons. thanks for the help. i finally used document.getElementById again and it works.
-
i hove someone has a little time to help this old man. i have this line that works.
<?php echo "<input type=\"button\" onclick=\"window.location='ebay_syncitems.php?action=updateremote&Quantity=0&ItemID=".$items_id."';\" value=\"Delete Item \" /><br/>";
but i want to pass the value of the selected choice of this dropdown along with the rest of variables.
<select name="EndReasonCodeType"> <option value="NotAvailable"><?php echo ChooseOne ;?></option> <option value="Incorrect"><?php echo Incorrect ;?></option> <option value="LostOrBroken"><?php echo LostOrBroken ;?></option> <option value="NotAvailable"><?php echo NotAvailable ;?></option> <option value="OtherListingError"><?php echo OtherListingError ;?></option> <option value="SellToHighBidder"><?php echo SellToHighBidder ;?></option> </select>[code]
-
thank you very much
-
i am trying to print out some of the values that is returned using this
foreach($results->Item->ShippingDetails->CalculatedShippingRate as $key => $value) { if($key == "PackageDepth") $PackageDepth = $value ; if($key == "PackageLength") $PackageLength = $value ; if($key == "PackageWidth") $PackageWidth = $value ; if($key == "WeightMajor") $WeightMajor = $value ; if($key == "WeightMinor") $WeightMinor = $value ; if($key == "OriginatingPostalCode") $OriginatingPostalCode = $value ; if($key == "ShippingIrregular") $ShippingIrregular = $value ; if($key == "ShippingPackage") $ShippingPackage = $value ; if($key == "PackagingHandlingCosts") $PackagingHandlingCosts = $value ; }
i get the correct value for $OriginatingPostalCode. but for $PackageLength, $PackageWidth, $WeightMajor and some other ones i get Object id #35 and Object id #36 and so on. What i have noticed is that these values are repeated in two different array, and i get the same result no matter which one i try.
also if you notice there are two <ShippingServiceOptions> and i want to access the values in both these array
but i get the same Object id #51 result.
bellow is the response from ebay. i would appreciate any help :'(
<Item> <AutoPay>false</AutoPay> <BuyerProtection>ItemIneligible</BuyerProtection> <BuyItNowPrice currencyID="USD">42.79</BuyItNowPrice> <Country>US</Country> <Currency>USD</Currency> <Description>Regional Code: 2 (Japan, Europe, Middle East, South Africa).
 <br />
 Languages: English, Deutsch.
 <br />
 Subtitles: English, Deutsch, Spanish.
 <br />
 Audio: Dolby Surround 5.1.
 <br />
 Picture Format: 16:9 Wide-Screen.
 <br />
 Length: (approx) 122 minutes.
 <br />
 Other: Interactive Menus, Chapter Selection, Subtitles (more languages).</Description> <GiftIcon>0</GiftIcon> <HitCounter>NoHitCounter</HitCounter> <ItemID>110099292495</ItemID> <ListingDetails> <Adult>false</Adult> <BindingAuction>false</BindingAuction> <CheckoutEnabled>true</CheckoutEnabled> <ConvertedBuyItNowPrice currencyID="USD">42.79</ConvertedBuyItNowPrice> <ConvertedStartPrice currencyID="USD">20.0</ConvertedStartPrice> <ConvertedReservePrice currencyID="USD">0.0</ConvertedReservePrice> <HasReservePrice>false</HasReservePrice> <StartTime>2012-05-29T14:53:01.000Z</StartTime> <EndTime>2012-06-01T14:53:01.000Z</EndTime> <ViewItemURL>http://cgi.sandbox.ebay.com/Die-Hard-Vengeance-/110099292495</ViewItemURL> <HasUnansweredQuestions>false</HasUnansweredQuestions> <HasPublicMessages>false</HasPublicMessages> <BuyItNowAvailable>true</BuyItNowAvailable> <ExpressListing>false</ExpressListing> <ViewItemURLForNaturalSearch>http://cgi.sandbox.ebay.com/Die-Hard-Vengeance-/110099292495</ViewItemURLForNaturalSearch> </ListingDetails> <ListingDesigner> <LayoutID>10000</LayoutID> <ThemeID>10</ThemeID> </ListingDesigner> <ListingDuration>Days_3</ListingDuration> <ListingType>Chinese</ListingType> <Location>United States</Location> <PaymentMethods>PayPal</PaymentMethods> <PayPalEmailAddress>xxx@hotmail.com</PayPalEmailAddress> <PrimaryCategory> <CategoryID>175677</CategoryID> <CategoryName>Computers/Tablets & Networking:Laptop & Desktop Accessories:Case Mods, Stickers & Decals</CategoryName> </PrimaryCategory> <PrivateListing>false</PrivateListing> <Quantity>1</Quantity> <ReservePrice currencyID="USD">0.0</ReservePrice> <ReviseStatus> <ItemRevised>false</ItemRevised> </ReviseStatus> <SecondaryCategory> <CategoryID>175680</CategoryID> <CategoryName>Computers/Tablets & Networking:Laptop & Desktop Accessories:Hard Drive Pouches</CategoryName> </SecondaryCategory> <Seller> <AboutMePage>false</AboutMePage> <Email>xxx@gmail.com</Email> <FeedbackScore>117</FeedbackScore> <PositiveFeedbackPercent>0.0</PositiveFeedbackPercent> <FeedbackPrivate>false</FeedbackPrivate> <FeedbackRatingStar>Turquoise</FeedbackRatingStar> <IDVerified>true</IDVerified> <eBayGoodStanding>true</eBayGoodStanding> <NewUser>false</NewUser> <RegistrationDate>1995-01-01T00:00:00.000Z</RegistrationDate> <Site>US</Site> <Status>Confirmed</Status> <UserID>testuser_osc-frank</UserID> <UserIDChanged>true</UserIDChanged> <UserIDLastChanged>2012-05-24T15:12:21.000Z</UserIDLastChanged> <VATStatus>NoVATTax</VATStatus> <SellerInfo> <AllowPaymentEdit>true</AllowPaymentEdit> <CheckoutEnabled>true</CheckoutEnabled> <CIPBankAccountStored>false</CIPBankAccountStored> <GoodStanding>true</GoodStanding> <LiveAuctionAuthorized>false</LiveAuctionAuthorized> <MerchandizingPref>OptIn</MerchandizingPref> <QualifiesForB2BVAT>false</QualifiesForB2BVAT> <StoreOwner>false</StoreOwner> <ExpressEligible>false</ExpressEligible> <ExpressWallet>false</ExpressWallet> <SafePaymentExempt>true</SafePaymentExempt> </SellerInfo> <MotorsDealer>false</MotorsDealer> </Seller> <SellingStatus> <BidCount>0</BidCount> <BidIncrement currencyID="USD">0.5</BidIncrement> <ConvertedCurrentPrice currencyID="USD">20.0</ConvertedCurrentPrice> <CurrentPrice currencyID="USD">20.0</CurrentPrice> <LeadCount>0</LeadCount> <MinimumToBid currencyID="USD">20.0</MinimumToBid> <QuantitySold>0</QuantitySold> <ReserveMet>true</ReserveMet> <SecondChanceEligible>false</SecondChanceEligible> <ListingStatus>Active</ListingStatus> </SellingStatus> <ShippingDetails> <ApplyShippingDiscount>false</ApplyShippingDiscount> <CalculatedShippingRate> <OriginatingPostalCode>10075</OriginatingPostalCode> <PackageDepth measurementSystem="English" unit="inches">10</PackageDepth> <PackageLength measurementSystem="English" unit="inches">12</PackageLength> <PackageWidth measurementSystem="English" unit="inches">5</PackageWidth> <PackagingHandlingCosts currencyID="USD">10.0</PackagingHandlingCosts> <ShippingIrregular>false</ShippingIrregular> <ShippingPackage>PackageThickEnvelope</ShippingPackage> <WeightMajor measurementSystem="English" unit="lbs">2</WeightMajor> <WeightMinor measurementSystem="English" unit="oz">0</WeightMinor> </CalculatedShippingRate> <SalesTax> <SalesTaxPercent>0.0</SalesTaxPercent> <ShippingIncludedInTax>false</ShippingIncludedInTax> </SalesTax> <ShippingServiceOptions> <ShippingService>UPSGround</ShippingService> <ShippingServicePriority>1</ShippingServicePriority> <ExpeditedService>false</ExpeditedService> <ShippingTimeMin>1</ShippingTimeMin> <ShippingTimeMax>5</ShippingTimeMax> </ShippingServiceOptions> <ShippingServiceOptions> <ShippingService>UPSNextDay</ShippingService> <ShippingServicePriority>2</ShippingServicePriority> <ExpeditedService>true</ExpeditedService> <ShippingTimeMin>1</ShippingTimeMin> <ShippingTimeMax>1</ShippingTimeMax> </ShippingServiceOptions> <ShippingType>Calculated</ShippingType> <ThirdPartyCheckout>false</ThirdPartyCheckout> <ShippingDiscountProfileID>0</ShippingDiscountProfileID> <InternationalShippingDiscountProfileID>0</InternationalShippingDiscountProfileID> <SellerExcludeShipToLocationsPreference>false</SellerExcludeShipToLocationsPreference> </ShippingDetails> <ShipToLocations>US</ShipToLocations> <ShipToLocations>Europe</ShipToLocations> <ShipToLocations>CA</ShipToLocations> <Site>US</Site> <StartPrice currencyID="USD">20.0</StartPrice> <TimeLeft>P1DT12H34M49S</TimeLeft> <Title>Die Hard With A Vengeance</Title> <HitCount>0</HitCount> <GetItFast>false</GetItFast> <SKU>12</SKU> <PostalCode>10075</PostalCode> <PictureDetails> <GalleryType>Gallery</GalleryType> <GalleryURL>http://xxx.com/osc/catalog/images/dvd/die_hard_3.gif</GalleryURL> <PhotoDisplay>None</PhotoDisplay> <PictureURL>http://xxx.com/osc/catalog/images/dvd/die_hard_3.gif</PictureURL> <ExternalPictureURL>http:/xxx.com/osc/catalog/images/dvd/die_hard_3.gif</ExternalPictureURL> </PictureDetails> <DispatchTimeMax>3</DispatchTimeMax> <ProxyItem>false</ProxyItem> <BuyerGuaranteePrice currencyID="USD">20000.0</BuyerGuaranteePrice> <IntangibleItem>false</IntangibleItem> <ReturnPolicy> <RefundOption>MoneyBack</RefundOption> <Refund>Money Back</Refund> <ReturnsWithinOption>Days_14</ReturnsWithinOption> <ReturnsWithin>14 Days</ReturnsWithin> <ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption> <ReturnsAccepted>Returns Accepted</ReturnsAccepted> <Description>Return Policy</Description> <ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption> <ShippingCostPaidBy>Buyer</ShippingCostPaidBy> </ReturnPolicy> <PaymentAllowedSite>eBayMotors</PaymentAllowedSite> <PaymentAllowedSite>CanadaFrench</PaymentAllowedSite> <PaymentAllowedSite>Canada</PaymentAllowedSite> <PaymentAllowedSite>US</PaymentAllowedSite> <ConditionID>1000</ConditionID> <ConditionDisplayName>New</ConditionDisplayName> <PostCheckoutExperienceEnabled>false</PostCheckoutExperienceEnabled> <ShippingPackageDetails> <PackageDepth measurementSystem="English" unit="inches">10</PackageDepth> <PackageLength measurementSystem="English" unit="inches">12</PackageLength> <PackageWidth measurementSystem="English" unit="inches">5</PackageWidth> <ShippingIrregular>false</ShippingIrregular> <ShippingPackage>PackageThickEnvelope</ShippingPackage> <WeightMajor measurementSystem="English" unit="lbs">2</WeightMajor> <WeightMinor measurementSystem="English" unit="oz">0</WeightMinor> </ShippingPackageDetails> </Item>
-
no just within the script and the value would change within the script also.
it is a loop
the second function is called after the first function. i want the second function to use the new value each time that it is called.
-
The way you're using it in the code you pasted is correct. Is it not acting how you expect it to?
no it is not, i am not getting it in the second function
The variable would need to be a main program (global) variable to get what you are trying to work.
However, if you have variable that has meaning to both functions so that it would normally be shared between those functions, you should be using a class, not functions.
this is a gpl code that i am trying to make it work for me. i really can't write the whole thing. is there a work around? i appreciate any help you can provide
-
i want to use a variable that is created inside of a function in another function
some thing like this
function show_category ($cats, $index, $level) { global $categories_use_categories_top_only; $categories_use_categories_top_only='no'; . . $catRow = '<tr class="scPL-' . $level . '">' . "\n" . '<th colspan="' . PL_COLCOUNT . '">' . $cats[$index]['categories_name'].'<br><i>'. $categories_use_categories_top_only . '</i><br><i>'. $cat_top . '</i></th>' . "\n" . '</tr>' . "\n"; return $catRow; } function show_product ($cats, $cat_index, $prod_index) { global $categories_use_categories_top_only; . . if ($categories_use_categories_top_only=='no' ) { include(DIR_WS_MODULES . 'options.php'); } . .
i want to use $categories_use_categories_top_only which its value determined in the first function in the second function as i showed. the first function acts correctly
how can i do this?
-
can i do something like this and why it is not working
[code]MYSQL_QUERY( "DELETE pa.products_attributes_id ,pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, pa.products_options_sort_order , pa.products_attributes_weight,pa.options_type_id,pa.attribute_sort, pa.products_attributes_weight_prefix,pa.options_values_weight,pa.options_values_qty,pa.options_values_image,pa.sort_order FROM products_attributes pa,products_options po WHERE pa.products_id = '$current_product_id'and po.products_options_id=pa.options_id and po.products_options_type ='$type'" ); [/code]
button not passing variable to function
in Javascript Help
Posted
if i put
inside the function xmlhttpPost(strURL,form_name) then it works.
and if i put an alert instead of
self.xmlHttpReq.send(getquerystring(form_name));
then i do get the correct values in the alert message
but it will not pass the value of form_name to the other function