Jump to content

modigy

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

About modigy

  • Birthday 03/25/1974

Profile Information

  • Gender
    Not Telling
  • Location
    Madrid, Spain

modigy's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks TheFilmGod, I will get you some screen shots. I myself can't see the problem because I don't support IE6 either. In fact there is only one person (out of about 15) in the office that is having the problem. She works on accounts and refuses to update her software (including her version of IE) because she is afraid of compatibility issues. I understand her concern, but she should be update. She claims that their are 'others' that are having the same problem. I'm sure the percentage is very small and nearly all of my clients are willing to accept it but this client. By the way, the endless div came about because the client didn't want to pay the extra for my custom design. Therefore we went with a template. Now I am perhaps paying for it with a client that has one employee that refuses to update their software. Anyway, I'll send you a screen shot as soon as they send it my way. Thanks again, M
  2. Hi everyone, Once in awhile I'm here for some PHP help, but this time I'm having problems with a CSS menu I've put together for a client. Here's the page: http://www.chit-chat.es/php/cursos.php Basically this page looks terrible for those (some) using IE 6. I can't for the life of me figure out why. In all versions of FF and IE 7 it looks perfect. Basically those with IE 6 see none of the content and the menu to the left (you should see a mess of blue buttons) shows the buttons overlapping. Can anyone see this problem? Any possible resolution offered would be a big help. Thanks in advance, M
  3. That's exactly what I needed!!! Thanks, Modigy
  4. Hi everyone, I'm still struggling with this problem. :-\ The session variables are available to me in the addbook.php page but not the addbook_lookup.php page. I don't understand why. The difference between the two pages is that addbook_lookup.php has an include 'xmlparser_rc2.php' which retrieves book data from an outside page. This information is then returned to addbook_lookup.php and when it does my session variables are empty??? Please, any ideas??? M
  5. Hi all, Any new ideas?? I'm not sure what else I can do... Thanks, M
  6. Hi all, Another thing, it seems to me that the only difference between the two pages 'addbook.php' and 'addbook_lookup.php' is the use of the 'xmlparser_rc2.php' script. Can anyone determine if somehow the 'xmlparser_rc2.php' script is overwriting the session variables: $_SESSION['distributor'] $_SESSION['theme'] $_SESSION['gradeLevel'] $_SESSION['newUsed'] $_SESSION['specPromo'] I simply don't see why I am unable to extract the values in the session variables 'if they are there' and display them. And, if they are not there, why??? Thanks for any and all help guys... M
  7. Madtechie, Thanks for your help. However, I get no errors. This is driving me crazy. Any other ideas? M
  8. I have added session_start(); to the xmlparser_rc2.php code just in case. However, I still see an empty Array () when I print the session in the 'addbook_lookup.php' page. Any ideas guys? M
  9. Thanks for your response, How would I check the <?php session_start(); ?> for errors? Currently I'm not seeing any errors/warnings... What do you recommend? M
  10. Thanks taith, When I print_r($_SESSION); all I see is Array ( ). I don't know if this indicates that there is indeed data stored?? M
  11. Thanks for the quick responses, All pages have: <?php session_start(); ?> at the top of the pages (no spaces either) Except the xmlparser_rc2.php script does not have the <?php session_start(); ?>. Could this be the problem? Any other ideas? M
  12. Hi everyone, I am working on what I suppose I could call a data entry form. The client is a book store and they want to be able to enter books and have some fields maintain their values after clicking the submit button. For example if they have multiple books of the genre 'Mystery' they want this dropdown menu to remain selected on 'Mystery' after they click submit. I have been able to get this to work EXCEPT the client also has the option of entering the ISBN number of a book in a 'lookup' text field, clicking a button called 'lookup' and the information is retrieved from a public book database. This is where I have the problem with the session variables. The first php form they reach (when logging in) is called 'addbook.php'. This form is blank and if they enter all of the information and click 'Submit' the information in fields with an (*) are maintained when they are returned to the form. However, if they use the 'lookup' field they are sent to a similar form called addbook_lookup.php which has an 'include' (xmlparser_rc2.php) that looks up the data from the public database and then fills in the form with that data. It is here that any variables that they input from the prior page should also be maintain, however, I believe the xmlparser_rc2.php script is overwriting the session variables for those fields designated with the (*). I am not sure what to do. Here is the flow: Without using the lookup field addbook.php -> 'Submit' -> submitbook.php -> addbook.php (fields with an * are maintained) Using the lookup field addbook.php -> 'Lookup' -> addbook_lookup.php w/ include xmlparser_rc2.php -> 'Submit' -> submitbook.php -> addbook.php (fields with an * are NOT maintained) Here is the code: 1st form - addbook.php <?php global $title,$author,$subject,$month,$year,$subject,$publisher,$commentary; $title = $author = $subject = $month = $year = $subject = $publisher = $commentary =""; $isbn=$HTTP_POST_VARS['isbn']; if ($isbn != "") { include 'xmlparser_rc2.php'; } ?> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif">Add Book (<font color="#FF0000"><b>* </b></font>items will be repeated)</font></div> <form name="lookupform" method="post" action="addbook_lookup.php"> <span class="formcontent">ISBN new:</span> <?php echo '<input name="isbn" type="text" value="'.$isbn.'" id="isbn">'; ?> <input type="submit" name="Submit2" value="Lookup" > </form> <form name="form1" method="post" action="submitbook.php"> <p><b></b></p> <table width="100%" border="0"> <tr> <td><input type="submit" name="Submit" value="Submit"><input name="" value="Clear" type="reset" onClick="location='addbook.php'" onMouseDown="<?php session_destroy(); ?>"></td> <td> <?php echo '<input name="isbn" type="hidden" value="'.$isbn.'">'; ?> </td> </tr> <tr> <td><span class="formcontent">J&J Price:</span></td> <td><input name="priceAct" type="text" id="priceAct" maxlength="20"></td> </tr> <tr> <td><span class="formcontent">Number of copies:</span></td> <td><input name="copies" type="text" id="copies" size="4" maxlength="3"></td> </tr> <tr> <td width="22%"><span class="formcontent">Title:</span> </td> <td width="78%"> <?php echo '<input name="title" type="text" id="title" size="50" value="'.$title.'">'; ?> </td> </tr> <tr> <td><span class="formcontent">Author:</span></td> <td> <?php echo '<input name="author" type="text" id="author" size="50" value="'.$author.'" maxlength="200">'; ?> </td> </tr> <tr> <td><span class="formcontent">Publisher:</span></td> <td> <?php echo '<input name="publisher" type="text" id="publisher" size="50" value="'.$publisher.'" maxlength="100">'; ?> </td> </tr> <tr> <td><span class="formcontent">Distributor:</span></td> <td> <?php if (isset ($_SESSION['distributor'])) { echo '<input name="distributor" type="text" id="distributor" value="'.$_SESSION['distributor'].'">'; } else { echo '<input name="distributor" type="text" id="distributor" value="" maxlength="20">'; }echo '<font color="#FF0000"><b> *</b></font>'; ?> </td> </tr> <tr> <td><span class="formcontent">Commentary:</span></td> <td><textarea name="commentary" cols="50" rows="5" id="commentary"><?php echo $commentary ?></textarea></td> </tr> <tr> <td><span class="formcontent">Image</span></td> <td> <?php if ($isbn == "") { echo '<input name="image" type="text" id="image" value="na.gif" maxlength="50">'; } else { echo '<input name="image" type="text" id="image" value="'.$isbn.'.jpg" maxlength="50">'; } ?> </td> </tr> <tr> <td><span class="formcontent">Theme:</span></td> <td> <select name="theme" id="theme"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('bookthemes'); if (isset ($_SESSION['theme'])) { echo '<option value="'.$_SESSION['theme'].'" " selected">'.$_SESSION['theme'].'</option>'; $sql = "SELECT * FROM jandj_jandj.bookthemes WHERE theme != '".$_SESSION['theme']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['theme'].'">'.$row['theme'].'</option>'; } } else { echo '<option value="" "selected">Choose Theme</option>'; $sql = "SELECT * FROM jandj_jandj.bookthemes"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['theme'].'">'.$row['theme'].'</option>'; } } ?> </select><font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">Recommended:</span></td> <td><input name="recommend" type="checkbox" id="recommend" value="1"></td> </tr> <tr> <td><span class="formcontent">Reference Num:</span></td> <td><input name="referenceNum" type="text" id="referenceNum" value="0" maxlength="20"></td> </tr> <tr> <td><span class="formcontent">Tracking Num:</span></td> <td><input name="trackingNumber" type="text" id="trackingNumber" value="000000000000" maxlength="20"></td> </tr> <tr> <td><span class="formcontent">Grade Level:</span></td> <td> <select name="gradeLevel" id="gradeLevel"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('gradelevel'); if (isset ($_SESSION['gradeLevel'])) { echo '<option value="'.$_SESSION['gradeLevel'].'" " selected">'.$_SESSION['gradeLevel'].'</option>'; $sql = "SELECT * FROM jandj_jandj.gradelevel WHERE gradelevel != '".$_SESSION['gradeLevel']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['gradelevel'].'">'.$row['gradelevel'].'</option>'; } } else { echo '<option value="" "selected">Choose Grade</option>'; $sql = "SELECT * FROM jandj_jandj.gradelevel"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['gradelevel'].'">'.$row['gradelevel'].'</option>'; } } ?> </select> <font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">New/Used:</span></td> <td> <select name="newUsed" id="newUsed"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('newUsed'); if (isset ($_SESSION['newUsed'])) { echo '<option value="'.$_SESSION['newUsed'].'" " selected">'.$_SESSION['newUsed'].'</option>'; $sql = "SELECT * FROM jandj_jandj.newUsed WHERE newUsed != '".$_SESSION['newUsed']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['newUsed'].'">'.$row['newUsed'].'</option>'; } } else { echo '<option value="" "selected">Choose New or Used</option>'; $sql = "SELECT * FROM jandj_jandj.newUsed"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['newUsed'].'">'.$row['newUsed'].'</option>'; } } ?> </select> <font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">Special Promotions:</span></td> <td> <select name="specPromo" id="specPromo"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('specPromo'); if (isset ($_SESSION['specPromo'])) { echo '<option value="'.$_SESSION['specPromo'].'" " selected">'.$_SESSION['specPromo'].'</option>'; $sql = "SELECT * FROM jandj_jandj.specPromo WHERE specPromo != '".$_SESSION['specPromo']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['specPromo'].'">'.$row['specPromo'].'</option>'; } } else { echo '<option value="" "selected">Choose Promotion</option>'; $sql = "SELECT * FROM jandj_jandj.specPromo"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['specPromo'].'">'.$row['specPromo'].'</option>'; } } ?> </select> <font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">Shipping Delay:</span></td> <td> <?php if (isset ($_SESSION['shippingDelay'])) { echo '<input name="shippingDelay" type="text" id="shippingDelay" value="'.$_SESSION['shippingDelay'].'">'; } else { echo '<input name="shippingDelay" type="text" id="shippingDelay" value="" size="4" maxlength="4">'; }echo '<font color="#FF0000"><b> *</b></font>'; ?> From here if they enter information for a new book and just click 'Submit' the variables are sent to this php script which puts the information into the MySQL database: 2nd submitbook.php - <?php session_start(); $title=$HTTP_POST_VARS['title']; $isbn=$HTTP_POST_VARS['isbn']; $author=$HTTP_POST_VARS['author']; $publisher=$HTTP_POST_VARS['publisher']; $commentary=$HTTP_POST_VARS['commentary']; $image=$HTTP_POST_VARS['image']; $theme=$HTTP_POST_VARS['theme']; $recommend=$HTTP_POST_VARS['recommend']; $referenceNum=$HTTP_POST_VARS['referenceNum']; $pricePub=$HTTP_POST_VARS['pricePub']; $priceAct=$HTTP_POST_VARS['priceAct']; $day=$HTTP_POST_VARS['day']; $month=$HTTP_POST_VARS['month']; $year=$HTTP_POST_VARS['year']; $trackingNumber=$HTTP_POST_VARS['trackingNumber']; $gradeLevel=$HTTP_POST_VARS['gradeLevel']; $copies=$HTTP_POST_VARS['copies']; $shippingDelay=$HTTP_POST_VARS['shippingDelay']; $distributor=$HTTP_POST_VARS['distributor']; $display=$HTTP_POST_VARS['display']; $newUsed=$HTTP_POST_VARS['newUsed']; $specPromo=$HTTP_POST_VARS['specPromo']; $date=$year."-".$month."-".$day; $tempdate = getdate( ); $entryDate = $tempdate['year'].'-'.$tempdate['mon'].'-'.$tempdate['mday']; //Connect to database $database=mysql_pconnect('localhost','jandj_root'); if (!$database) { header('Location: errorbook?type=1.php'); exit; } mysql_select_db('books'); $query="select * from jandj_jandj.books"; $result=mysql_query($query); $column=mysql_fetch_array($result); $i = 0; while ($i<$copies) { $submit="INSERT INTO jandj_jandj.books VALUES ('','".$title."','".$isbn."','".$author."','".$date."','".$commentary."','','".$image."','','".$theme."','".$recommend."','".$referenceNum."','".$pricePub."','".$priceAct."','".$publisher."','".$trackingNumber."','".$gradeLevel."','".$shippingDelay."','".$distributor."','".$display."','".$entryDate."','".$newUsed."','".$specPromo."')"; $i++; $result=mysql_query($submit) or die("Error submitting books: ".mysql_error()); } if ($result) { // Data submitted. Returning to main book page.'; //unset($_SESSION['theme']); $_SESSION["distributor"] = "$distributor"; $_SESSION["theme"] = "$theme"; $_SESSION["gradeLevel"] = "$gradeLevel"; $_SESSION["newUsed"] = "$newUsed"; $_SESSION["specPromo"] = "$specPromo"; $_SESSION["shippingDelay"] = "$shippingDelay"; header('Location: addbook.php'); } else { // header('Location: errorbook.php?type=2'); echo 'Error submitting book info!<br> $result = '.$result; } ?> Now if the user uses the 'Lookup' field they will be directed to this code (addbook_lookup.php) which is basically the same as 'addbook.php' but has an include called 'xmlparser_rc2.php'. Once the information is retrieved they will click 'Submit' and the variables will be sent to 'submitbook.php' just like the 'addbook.php' page. 3rd using lookup field addbook_lookup.php - <?php global $title,$author,$subject,$month,$year,$subject,$publisher,$commentary; $title = $author = $subject = $month = $year = $subject = $publisher = $commentary =""; $isbn=$HTTP_POST_VARS['isbn']; if ($isbn != "") { // First strip any - from the number $newISBN = str_replace("-", "", $isbn); //echo 'strlen($newISBN) = '.strlen($newISBN); if (strlen($newISBN) > 10) { // Then if the resulting code is longer than the normal ISBN // ... strip off first three digits and anything after the 13th digit $subISBN = substr($newISBN, 3, 9); //echo '$subISBN = '.$subISBN; //echo '<br>'; $total = 0; for ($i = 0; $i<10; $i++) { $a = substr($subISBN,$i,1); $d= $a*(10-$i); //echo '$a = '.$a.' a*(11-i) = '.$d; //echo '<br>'; $total = $total + $d; } $b = ($total % 11); if ($b==0) {$b= 11;} $c = 11 - $b; // Add the check digit to the end of the ISBN number $subISBN .= $c; $isbn = $subISBN; // end of change number //echo 'scanned barcode = '.$newISBN; //echo '<br>'; //echo '$total = '.$total; //echo '<br>'; //echo '$b = '.$b; //echo '<br>'; //echo '$c = '.$c; //echo '<br>'; //echo 'final isbn = '.$isbn; } else { $isbn = $newISBN;} // end of convert to proper ISBN include 'xmlparser_rc2.php'; } ?> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif">Add Book (<font color="#FF0000"><b>* </b></font>items will be repeated)</font></div> <form name="lookupform" method="post" action="addbook_lookup.php"> <span class="formcontent">ISBN:</span> <?php echo '<input name="isbn" type="text" value="'.$isbn.'" id="isbn">'; ?> <input type="submit" name="Submit2" value="Lookup"> </form> <form name="form1" method="post" action="submitbook.php"> <p><b></b></p> <table width="100%" border="0"> <tr> <td><input type="submit" name="Submit" value="Submit"> <input name="" value="Clear" type="reset" onClick="location='addbook.php'" onMouseDown="<?php session_destroy(); ?>"></td> <td> <?php echo '<input name="isbn" type="hidden" value="'.$isbn.'">'; ?> </td> </tr> <tr> <td><span class="formcontent">J&J Price:</span></td> <td><input name="priceAct" type="text" id="priceAct" maxlength="20"></td> </tr> <!--publisher price deleted --> <tr> <td><span class="formcontent">Number of copies:</span></td> <td><input name="copies" type="text" id="copies" size="4" maxlength="3"></td> </tr> <tr> <td width="22%"><span class="formcontent">Title:</span> </td> <td width="78%"> <?php echo '<input name="title" type="text" id="title" size="50" value="'.$title.'">'; ?> </td> </tr> <tr> <td><span class="formcontent">Author:</span></td> <td> <?php echo '<input name="author" type="text" id="author" size="50" value="'.$author.'" maxlength="200">'; ?> </td> </tr> <tr> <td><span class="formcontent">Publisher:</span></td> <td> <?php echo '<input name="publisher" type="text" id="publisher" size="50" value="'.$publisher.'" maxlength="100">'; ?> </td> </tr> <tr> <td><span class="formcontent">Distributor:</span></td> <td> <?php if (isset ($_SESSION['distributor'])) { echo '<input name="distributor" type="text" id="distributor" value="'.$_SESSION['distributor'].'">'; } else { echo '<input name="distributor" type="text" id="distributor" value="" maxlength="20">'; }echo '<font color="#FF0000"><b> *</b></font>'; ?> </td> </tr> <tr> <td><span class="formcontent">Commentary:</span></td> <?php // Check for www.powells.com in commentary string. If there is this indicates too much commentary was grabbed from the site if (strpos($commentary,"owells.com") != '') { echo '<font color="#FF0000"> <b>Warning!</b> The commentary contains the text "www.powells.com" which indicates an error in the capture of the commentary text. Please check the commentary text and edit or delete as needed.</font><br><br>'; } ?> <td><textarea name="commentary" cols="50" rows="5" id="commentary"><?php echo $commentary ?></textarea> </td> </tr> <tr> <td><span class="formcontent">Image</span></td> <td> <?php if ($isbn == "") { echo '<input name="image" type="text" id="image" value="na.gif" maxlength="50">'; } else { echo '<input name="image" type="text" id="image" value="'.$isbn.'.jpg" maxlength="50">'; } ?> </td> </tr> <tr> <td><span class="formcontent">Theme:</span></td> <td> <select name="theme" id="theme"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('bookthemes'); if (isset ($_SESSION['theme'])) { echo '<option value="'.$_SESSION['theme'].'" " selected">'.$_SESSION['theme'].'</option>'; $sql = "SELECT * FROM jandj_jandj.bookthemes WHERE theme != '".$_SESSION['theme']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['theme'].'">'.$row['theme'].'</option>'; } } else { echo '<option value="" "selected">Choose Theme</option>'; $sql = "SELECT * FROM jandj_jandj.bookthemes"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['theme'].'">'.$row['theme'].'</option>'; } } ?> </select><font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">Recommended:</span></td> <td><input name="recommend" type="checkbox" id="recommend" value="1"></td> </tr> <tr> <td><span class="formcontent">Reference Num:</span></td> <td><input name="referenceNum" type="text" id="referenceNum" value="0" maxlength="20"></td> </tr> <tr> <td><span class="formcontent">Tracking Num:</span></td> <td><input name="trackingNumber" type="text" id="trackingNumber" value="000000000000" maxlength="20"></td> </tr> <tr> <td><span class="formcontent">Grade Level:</span></td> <td> <select name="gradeLevel" id="gradeLevel"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('gradelevel'); if (isset ($_SESSION['gradeLevel'])) { echo '<option value="'.$_SESSION['gradeLevel'].'" " selected">'.$_SESSION['gradeLevel'].'</option>'; $sql = "SELECT * FROM jandj_jandj.gradelevel WHERE gradelevel != '".$_SESSION['gradeLevel']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['gradelevel'].'">'.$row['gradelevel'].'</option>'; } } else { echo '<option value="" "selected">Choose Grade</option>'; $sql = "SELECT * FROM jandj_jandj.gradelevel"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['gradelevel'].'">'.$row['gradelevel'].'</option>'; } } ?> </select> <font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">New/Used:</span></td> <td> <select name="newUsed" id="newUsed"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('newUsed'); if (isset ($_SESSION['newUsed'])) { echo '<option value="'.$_SESSION['newUsed'].'" " selected">'.$_SESSION['newUsed'].'</option>'; $sql = "SELECT * FROM jandj_jandj.newUsed WHERE newUsed != '".$_SESSION['newUsed']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['newUsed'].'">'.$row['newUsed'].'</option>'; } } else { echo '<option value="" "selected">Choose New or Used</option>'; $sql = "SELECT * FROM jandj_jandj.newUsed"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['newUsed'].'">'.$row['newUsed'].'</option>'; } } ?> </select> <font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">Special Promotions:</span></td> <td> <select name="specPromo" id="specPromo"> <?php $database=mysql_pconnect('localhost','jandj_root'); mysql_select_db('specPromo'); if (isset ($_SESSION['specPromo'])) { echo '<option value="'.$_SESSION['specPromo'].'" " selected">'.$_SESSION['specPromo'].'</option>'; $sql = "SELECT * FROM jandj_jandj.specPromo WHERE specPromo != '".$_SESSION['specPromo']."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['specPromo'].'">'.$row['specPromo'].'</option>'; } } else { echo '<option value="" "selected">Choose Promotion</option>'; $sql = "SELECT * FROM jandj_jandj.specPromo"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row['specPromo'].'">'.$row['specPromo'].'</option>'; } } ?> </select> <font color="#FF0000"><b> *</b></font> </td> </tr> <tr> <td><span class="formcontent">Shipping Delay:</span></td> <td> <?php if (isset ($_SESSION['shippingDelay'])) { echo '<input name="shippingDelay" type="text" id="shippingDelay" value="'.$_SESSION['shippingDelay'].'">'; } else { echo '<input name="shippingDelay" type="text" id="shippingDelay" value="" size="4" maxlength="4">'; }echo '<font color="#FF0000"><b> *</b></font>'; ?> Finally this is the 'xmlparser_rc2.php' include which I think is messing with my session variables - <?php // echo "<p>Start parsing the XML</p>"; if(!($xmlparser = xml_parser_create())) { die("Cannot create parser"); } function start_tag($parser, $name, $attribs) { // echo "Current tag: ".$name."<br />"; global $current; $current = $name; } function end_tag($parser,$name) { // echo "Reached ending tag ".$name."<br /><br />"; } function tag_contents($parser, $data) { global $current; global $title; global $author; global $publisher; global $commentary; // echo "<p>current = ".$current."</p>"; if ($current == "TITLE") {$title = $data; } if ($current == "AUTHORSTEXT") {$author = $data; } if ($current == "PUBLISHERTEXT") {$publisher = $data; } if ($current == "SUMMARY") {$commentary = $data; } } function LoadJPEG ($imgURL) { ##-- Get Image file from Port 80 --## $fp = fopen($imgURL, "are"); $imageFile = fread ($fp, 3000000); fclose($fp); ##-- Create a temporary file on disk --## // $tmpfname = tempnam ("/home/jandj/", "IMG"); ##-- Put image data into the temp file --## // $fp = fopen($tmpfname, "w"); $fp = fopen("my.jpg", "w"); fwrite($fp, $imageFile); fclose($fp); ##-- Load Image from Disk with GD library --## $im = imagecreatefromjpeg ($tmpfname); // $im = imagecreatefromjpeg ($imageFile); ##-- Delete Temporary File --## // unlink($tmpfname); ##-- Check for errors --## if (!$im) { print "Could not create JPEG image $imgURL"; } //return $im; return $imageFile; } xml_set_element_handler($xmlparser, "start_tag", "end_tag"); xml_set_character_data_handler($xmlparser, "tag_contents"); $filename = "http://isbndb.com/api/books.xml?access_key=58W2HDAC&results=texts&index1=isbn&value1=".$isbn; if (!($fp = fopen($filename, "are"))) {die("cannot open ".$filename);} while ($data = fread($fp, 4096)) { $data = eregi_replace(">"."[[:space:]]+"."<","><",$data); if (!xml_parse($xmlparser, $data, feof($fp))) { $reason = xml_error_string(xml_get_error_code($xmlparser)); $reason .= xml_get_current_line_number($xmlparser); die($reason); } } xml_parser_free($xmlparser); // $imageData = LoadJPEG("http://images-eu.amazon.com/images/P/0552149438.00.LZZZZZZZ.jpg"); // Header( "Content-Type: image/jpeg"); // imagejpeg($imageData, '', 100); echo '<img src="http://images-eu.amazon.com/images/P/'.$isbn.'.02.LZZZZZZZ.jpg" width="158" height="250">'; ?> Any and ALL help would be appreciated!!!! I have spent days and weeks on this and I can't seem to figure out the problem... Thanks in advance folks, M
  13. Craygo, Thanks 'Big, Big' for your help!!  That was exactly what I needed!! Cheers, M
  14. Hey all, I have some php code that returns search results from the database.  It works well except some of the 'commentary' in the DB are very short so the result is the the css style (which is dynamic) results in akward looking results.  [code]<?php echo '<p>'; echo '<img src="../images_books/'.$image.'" width="94" height="138" align="left">'; echo '<font color="#7b8049" face="Geneva, Arial, Helvetica, sans-serif"><b>'; echo $btitle; echo '</b></font><br> <b><font color="#000000" size="1" face="Geneva, Arial, Helvetica, sans-serif"> by '.$bauthor.'   </font></b> </p> <p><font color="#000000" size="1" face="Geneva, Arial, Helvetica, sans-serif">'.$commentary.'</font></p> <p> <a href="../php/moreinfo.php?id='.$id.'">More Info</a> &nbsp;&nbsp; <a href="../php/addtocart.php?id='.$id.'">Add to Cart</a> </p> <br><hr>'; ?>[/code] Is there a way to inject some 'spaces' to maintain the formatting of the results yet keep the results page dynamic? Perhaps this is a css question??? Thanks in advance, M
  15. Obsidian, I'm not sure how I would use the code snippet you gave me. I have an 'if/foreach' loop that pulls the DB information for the customer to view while checking out.  Then the price and shipping, etc. are put together for the transaction with the bank.  This same information is used to create the sales record.  HOWEVER, the sales table as it currently stands on receives ONE new row and that row only contains 'I believe' the last 'ISBN' if it was the last in the loop. How can I put together a list of variables that are retreved and then enter them in to one row in the DB (please see my above grafic)?? Please, help...I'm getting a bit crazy.... Thanks, M
×
×
  • 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.