madmega Posted February 8, 2010 Share Posted February 8, 2010 I have a script that loads up a CSV and than splits it into parts, these parts are called $parts[0] , $parts[1]...etc... In that script you see products, when you click on the shopping cart logo, it should copy the name of the product into the pop-up screen. On this server it does that: http://www.dwmusicstore.com/mark/2bas.php And on this server it doesn't: http://www.dirkwitte.nl/2bas.php These are exactly the same scripts, so why does it not work on one server and why does it on the other. Here is the 'parent' script <html> <head> </head> <body bgcolor=#E2E965 link=#E2E965 vlink=#E2E965 alink=#E2E965 text=#D5DF23> <style type="text/css"> body { scrollbar-arrow-color: #E2E965; scrollbar-face-color: #D7182A; scrollbar-highlight-color: #000000; scrollbar-3dlight-color: #D6DF23; scrollbar-shadow-color: #00000; scrollbar-darkshadow-color: #00000; scrollbar-track-color: #D6DF23; } input:link {text-decoration: none; color: #E2E965;} input:visited {text-decoration: none; color: #E2E965;} input:active {text-decoration: none; color: #E2E965;} .spacer_black { margin: 0px; padding: 0px; border: 5px; height: 2px; width: 100%; line-height: 0px; font-size: 0px; background-color: #000000;} </style> </html> <?PHP $offset = isset($_GET['offset'])?$_GET['offset']:0; $LinesToDisplay = 20; $row = $offset + $LinesToDisplay; $row2 = $offset - $LinesToDisplay; $file_handle = fopen("web.txt", "rb"); error_reporting( E_ALL ); // DEBUGGING while ((($parts = fgetcsv($file_handle,4096,"|")) !== FALSE) && ($LinesToDisplay > 0) && (!feof($file_handle))) { //new code //skip first $offset lines $num = count($parts[5]); if ($parts[5] == 3900) { if ($offset-- > 0) {continue;} $parts[0] = ucwords(strtolower($parts[0])); $parts[1] = ucwords(strtolower($parts[1])); echo "<p style='margin:9px;'><table BACKGROUND='background.jpg' border=0><td width='243' height='105'>"; echo "<font size=-1 face='helvetica' color=#812990><b>$parts[0]</b></font>"; echo "<i>"; ?> <html> <div onMouseOver="this.style.color = 'black';" onMouseOut="this.style.color = '#D5DF23';"></html><?php echo "-$parts[1]"; echo "</div></i>"; echo "<TABLE BORDER='0' cellpadding='0' CELLSPACING='0'><TR><TD WIDTH='70' HEIGHT='20' BACKGROUND='pricebackground.jpg' VALIGN='bottom'><center><font size=2 color=white face='helvetica'><b>€ ". $parts[2] ."</b></td></tr></table><a href='#' title='Koop $parts[0]' onClick=\"window.open('form.php?p=$parts[0]','popuppage', 'width=400,height=400,top=250,left=250, resizable=0, statusbar=0, titlebar=yes, toolbar=no, scrollbars=no, location=no, directories=no');\"><div><img src='ster.jpg' border=0 width='50' align='right'></a>"; echo "<b><font size=3 color=#D7182A>Op Voorraad In:<br></font>"; echo ("<font color=black> Amsterdam </font>"); if ( $parts[3] >= 1 ) echo ("<IMG SRC =green.gif>").""; if ( $parts[3] <= 0 ) echo ("<IMG SRC =red.gif>").""; echo ("<font color=black> Utrecht </font>"); if ( $parts[4] >= 1 ) echo ("<IMG SRC =green.gif>")."</td></table></b><p style='margin:9px;'>"; if ( $parts[4] <= 0 ) echo ("<IMG SRC =red.gif>")."</td></table></b><p style='margin:9px;'>"; $LinesToDisplay--; }} fclose($file_handle); ?> <html> <head> <body> <script language="Javascript"> <!-- if (document.images) { image1 = new Image image2 = new Image image1.src = 'vorige1.jpg' image2.src = 'vorige2.jpg' image3 = new Image image4 = new Image image3.src = 'volgende1.jpg' image4.src = 'volgende2.jpg' } --> </script> </head> </body> <center><a href="bas.php?offset=<?php echo $row2;?>" onMouseOver="document.mouseover.src=image2.src" onMouseOut="document.mouseover.src=image1.src"><img src="vorige1.jpg" border=0 name="mouseover"></a> <a href="bas.php?offset=<?php echo $row;?>" onMouseOver="document.mouseover2.src=image4.src" onMouseOut="document.mouseover2.src=image3.src"><img src="volgende1.jpg" border=0 name="mouseover2"></a> </center> </html> and here is the 'child' script: <HTML> <title>Bestel Formulier</title> <body bgcolor=#E2E965 link=#E2E965 vlink=#E2E965 alink=#E2E965> <font size=4 color=#D7182A><b><center>Bestel Formulier</b></center></font> <style type="text/css"> input:link {text-decoration: none; color: #E2E965;} input:visited {text-decoration: none; color: #E2E965;} input:active {text-decoration: none; color: #E2E965;} </style> <script type="text/javascript"><!--//--><![CDATA[//></script> <center> <font color="#E5C552" size=1> <TABLE cellSpacing=2 cellPadding=0 width=300 align=top> <TBODY> <TR> <FORM METHOD="post" ACTION="cgi-bin/mail-a-form.cgi"> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>Naam</TD> <TD width=300 height=10>* <INPUT TYPE="text" maxlength="50" size="30" NAME="realname"></td> <TR> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>Adres</TD> <TD width=300 height=10>* <INPUT TYPE="text" maxlength="50" size="30" NAME="Adres"></td> <TR> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>Postcode</TD> <TD width=300 height=10>* <INPUT TYPE="text" maxlength="50" size="30" NAME="Postcode"></td> <TR> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>Stad</TD> <TD width=300 height=10>* <INPUT TYPE="text" maxlength="50" size="30" NAME="Stad"></td> <TR> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>Land</TD> <TD width=300 height=10> <INPUT TYPE="text" maxlength="50" size="30" NAME="Land"></td> <TR> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>Produkt</TD> <TD width=300 height=10>* <input type="text" maxlength="50" size="30" name="Produkt" value="<?php echo isset($_POST['Produkt']) ? mysql_real_escape_string($_POST['Produkt']) : $p;?>"></td> <TR> <TD class=txtcatHead width=300 height=10><b><font color="black" size=1>E-mail Adres</TD> <TD width=300 height=10>* <INPUT TYPE="text" maxlength="50" size="30" NAME="email"></td> <INPUT TYPE="hidden" NAME="subject" VALUE="Bestelling"> <INPUT TYPE="hidden" NAME="missing_fields_redirect" VALUE="http://www.dirkwitte.nl/form2.php"> <INPUT TYPE="hidden" NAME="redirect" VALUE="http://www.dirkwitte.nl/form3.php"> <INPUT TYPE="hidden" NAME="recipient" VALUE="[email protected]"> <INPUT TYPE="hidden" NAME="required" VALUE="email, Produkt, Adres, Postcode, Stad, realname"> <table> <i><h7><font color=black>Velden met een <b>*</b> zijn verplicht</h7></i></table> <table><BR><font color=black size=2><b>Eventuele opmerking bij de bestelling.</table> <Td class=txtcatHead width=300 height=10></td> <TD width=150 height=10> <TEXTAREA NAME="Vraag" ROWS="4" COLS="30"></TEXTAREA> <br><br> <button type="submit" VALUE="SEND" style="background:url(verstuur1.jpg);width:147px;height:27px;border:none;" onmouseover="this.style.background='url(verstuur2.jpg)';" onmouseout="this.style.background='url(verstuur1.jpg)';"></button> </FORM> </body> </html> As you can see on the second website, value P is not being copied into the form, how is this possible ? These scripts are the same, but on the top server it copies the value from the 'parent' script to the 'child' script and in the other it doesn't Link to comment https://forums.phpfreaks.com/topic/191383-on-one-server-it-works-on-the-other-it-doesnt/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.