Jump to content

notonurnelly

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by notonurnelly

  1. Can anyone else help me with this, my page is displaying with the following code, but my onClick actions are not working for each of the thumbnails http://www.runthelakes.co.uk/wain/show_fell.php?SummitNo=137 function display_interest_image_details($image_array,$SummitNo) { if (!is_array($image_array)) { echo '<br/>No images listed in this category<br/>'; } else { ?> <div id="Layer2"><img src="images/basket.jpg" name="walk" width="201" height="110" id="walk" /></div> <?php echo '<table width = "100%" border = 0 cellspacing =5>'; foreach ($image_array as $Image_Row) { $SummitNo = $Image_Row['key_id']; $Comment = $Image_Row['comment']; $ImageNo = $Image_Row['id'].".jpg"; $ImagePath = "/wain/images/fells/uploads/Interest/"; echo '<tr><p></p></tr>'; echo '<tr>'; echo '<td width ="100%"><div align="center">'; echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3';?> onclick="MM_swapImage('walk','','<?php echo $ImagePath . "th_" . $ImageNo; ?>',1)" > <?php //echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3 >'; echo '</div></td></tr><tr>'; echo '<td width ="100%"><div align="center">'; echo '<b>'.$Comment.'</b>'; echo '</div></td></tr>'; } echo '</table>'; } echo '<hr/>'; } I have a feeling the problem could still be in my javascript. Although the function below works on a static page function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } Many Thanks Jamie
  2. Great, many thanks for that Im a little further that has allowed my page to be displayed. My main image is not changing when I click the thumbnails http://www.runthelakes.co.uk/wain/show_fell.php?SummitNo=137 click images tab, then point of interest Any ideas. Many Thanks Jamie
  3. Uhm, I have now added that. When this line of code is in place, the lines of code after do not colour properly (im in dreamweaver) ie on the line that is incorrect the echo statement is blue this is correct the echo statement on the next line is then not the correct colour. Which I assume is telling me that I am not closing my php off correctly. Can this sort of thing be done, I mean embedding java into php Thanks
  4. Im not sure, I have taken them out. With or without those in my page did not display. It only seems to work when I complety delete out the following line echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3';?> onclick="MM_swapImage('walk','','<?php echo ".$ImagePath."th_".$ImageNo." ?>',1)" and change the image dislay code to just echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3 >'; Thanks for oyur help anyhow, but I think the whole line is causing an error, hence my page is not dispaying
  5. Hi All, I have a number of thumbnail images that are pulled from a database, these are currently displayed down the page. I have an image place holder named walk. I want to be able to click any of the thumbnails and the the image in place holder walk will change to the current image. Here is my full code for the function. function display_interest_image_details($image_array,$SummitNo) { if (!is_array($image_array)) { echo '<br/>No images listed in this category<br/>'; } else { ?> <div id="Layer2"><img src="images/basket.jpg" name="walk" width="201" height="110" id="walk" /></div> <?php echo '<table width = "100%" border = 0 cellspacing =5>'; foreach ($image_array as $Image_Row) { $SummitNo = $Image_Row['key_id']; $Comment = $Image_Row['comment']; $ImageNo = $Image_Row['id'].".jpg"; $ImagePath = "/wain/images/fells/uploads/Interest/"; echo '<tr><p></p></tr>'; echo '<tr>'; echo '<td width ="100%"><div align="center">'; echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3';?> onclick="MM_swapImage('walk','','<?php echo "'.$ImagePath."th_".$ImageNo.'" ?>',1)" <?php //echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3 >'; echo '</div></td></tr><tr>'; echo '<td width ="100%"><div align="center">'; echo '<b>'.$Comment.'</b>'; echo '</div></td></tr>'; } echo '</table>'; } echo '<hr/>'; } my problem is on the following line echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3';?> onclick="MM_swapImage('walk','','<?php echo "'.$ImagePath."th_".$ImageNo.'" ?>',1)" I cannnot seem to append the Javascript into my PHP The following php to display the thumbnails works fine echo '<img src="'.$ImagePath."th_".$ImageNo.'" border=3 >'; Can anyone please help me to get this line of code right. Here is my javascript routine also function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } Many Thanks Jamie
  6. Hi All, I have copied the export mysql to excel tutorial from this website and it works fine. I am trying to ammend the program so that the open,save or cancel box does not popup and the file is just saved to a specific location with a certain name. ie C:\temp\export.xls The reason I need the file to be specific is becuase I want to run macros on the data to create charts and tables etc. I am then dragging the data in the named spreadsheet into a sheet that contains all of the macros. Therefore it is essential that the file is saved in the exact location and not named by the user which could lead to errors. Here is the code for the export <?php define (db_host,"mysql.xcalibre.co.uk"); define (db_user,"######"); define (db_pass,"######"); define (db_link,mysql_connect(db_host,db_user,db_pass)); define (db_name,"######"); mysql_select_db(db_name); $select = "select * from tblResultsDesc"; $export= mysql_query($select); $fields = @mysql_num_fields($export); for ($i = 0;$i<$fields;$i++){ $header .= mysql_field_name($export,$i) . "\t"; } while ($row = @mysql_fetch_row($export)){ $line = ''; foreach($row as $value){ if ((!isset($value))or($value=="")){ $value = "t"; } else { $value = str_replace('"','""',$value); //echo $value; $value = '"' . $value . '"' . "\t"; } $line .=$value; } $data .=trim($line)."\n"; //echo $data; } $data = str_replace("\r","",$data); if ($data ==""){ $data = "n(0) Records Found!n"; } header("Content-Type: application/vnd.ms-excel"); header ("Content-Disposition: attachment;fielname=extraction.xls"); header("pragma:no-cache"); header("Expires:0"); print "$header$data"; ob_end_flush(); ?> Many Thanks in Advance Jamie
  7. What I mean is some sort of tool that will generate PDf or something similar, directly from the web page. My PHP pages are not printing very well due to images and varying lengths of lists etc. Thanks Jamie
  8. Hi All, I am interested in generating reports directly from the mySQL database that supports my php site. I originally started to generate the web pages with reports in mind, but this method falls short when it reaches the bottom of the page and images a split over two pages in some instances. Is there a reporting tool that can be linked to mySQL databases that can produce reports when viewed from a web page. Im guessing Crystal reports or something like can be used in these instances. I am familar with creating reports in Access using grouping and filtering from queries etc. I'm guessing crystal reports or an alternative works on a similar basis. Any guidance or direction to software available would be great. I may need to plot graphs Many Thanks Jamie
  9. Hi All, Im a bit of a newbie to this. I am working my way through a book at the moment that is teaching me php through dreamweaver. The book is not really hard coding its about using dreamweavers menu's database, recordset facilties etc. Anyhow heres my problem. I have created a link to my database through the Window menu-databases. I created a link to my web based mysql datase by adding databse names, passwords etc to the dialog box that pops up. I then go onto create a recordset, using the bindings tab, recordset(query) link. The interface pops up and I can create my recordsets no problem. I have done all of the above numerous times, for many pages. Sometimes (at home when) i come back to the page that I have created database links and recordsets upon. the page stalls when I open a page with a recordset on. I then get a progress bar saying "testing database connection" this goes on for about 2 minutes then I get a message saying could not connect to datasbse THis also happens when I go to create new recordsets or connect to my old ones, the form(interface) searches for a while after selecting the databse but doe snot pick up any tables. I then get the value ***no tables found. This is only occassional, and sometimes its works fine. I believe it could be my internet service provider letting me down. I have experimented with connecting to database and creating recordsets at various times during the day, and at peak times it is impossible to create recordsets/connection through the dreamweaver tools and I end up creating them manually by hard coding. Another big issue and this is really annoying, is the fact that if I go to a page that I have previously created a recordset set on using dreamweavers wizards. If the server is struggling to connect everytime I do something on the page or change anything text, go from design view to code view etc. Dreamweaver tries to connect to the database and I get the progress bar for about 2 minutes till it fails. This is really annoying because, I know I cant connect using dreamweaver, so take the hard coding option(good Proactise) but the previous connections I have made, are trying to boot up and failing so. I cant get any work done. It would be 2 much undoing to go back and undo or lose all the automated dreamweaver code. Is this an internet connection problem, it seems fine at low peak usage time ie saturday nights, week nights are a nightmare though I also have no problem uploading my pages by dreamweaver ftp from my site connections and all of my pages with dynamic data are working fine and dandy allbeit a bit slow. I cannot use any of Dreamweavers connection wizards whilst at work, but I suspect this may be a firewall issue. I just get the trying to connect to server progress bar which then fails. Sorry to waffle, has anyone else had this problem Many Thanks Jamie
  10. Hi All, bit of a newbie question here, what I am trying to do is to loop through reocrds within my recordset and write them to a table. I can do that quite easily. what I want to do is to take a repeated value in my one of the columns in my table and make that into a sub heading. Underneath that I want to display all the reocrds for that value. Then display the next repeated value with all of the values for that Say for example my table display is Month            Date            RaceName          Venue January          11/1/06        Ben Nevis          Scotland January          21/1/06        3 Shires            England February        1/2/06          London              England February        5/2/06          Snowdon          Wales February        6/2/06          Paris                France March            6/3/06          hamburg            Germany What i would like to do is, have each month as a sub heading as below                     Date            RaceName          Venue January                   11/1/06        Ben Nevis          Scotland                   21/1/06        3 Shires            England February                        1/2/06          London              England                   5/2/06          Snowdon          Wales                   6/2/06          Paris                France March                              6/3/06          hamburg            Germany This technique can be seen on the following site http://www.scottishhillracing.co.uk/Fixtures.aspx I have tried searching the tutorial section but cannot find anything. Can anyone descibe this technique to me or point me to a tutorial Many thanks jamie              
  11. Im still struggling with this, does anyone have any fresh ideas?
  12. I have just checked my variable type using the code below $varTyi = gettype($Layer2Scroll); echo $varTyi; and it is a string.
  13. sasa that worked okay, thats when I set the variable within the code <div id="scroller" style="position:absolute; width:63px; height:23px; z-index:12; left: 774px; top: 275px; visibility: visible;"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic('initial',0,0,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic(<?php $Layer2Scroll='initial'; echo "'".$Layer2Scroll."'" ?>,0,<?php echo $ScrollVal; ?>,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"> </div> it also works when I do the below $Layer2Scroll = "initial"; then <div id="scroller" style="position:absolute; width:63px; height:23px; z-index:12; left: 774px; top: 275px; visibility: visible;"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic('initial',0,0,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic(<?php echo "'".$Layer2Scroll."'" ?>,0,<?php echo $ScrollVal; ?>,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"> </div> but will not work when I send the variable $Layer2Scroll to the whole function as below function scroller_set($upval,$Layer2Scroll) { echo "Layer ".$Layer2Scroll; $ScrollVal = $upval * -2000; echo $scrollval; ?> <div id="scroller" style="position:absolute; width:63px; height:23px; z-index:12; left: 774px; top: 275px; visibility: visible;"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic('initial',0,0,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic(<?php echo "'".$Layer2Scroll."'" ?>,0,<?php echo $ScrollVal; ?>,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"> </div> <?php } even though the echo statement echo "Layer ".$Layer2Scroll; is revealing initial I just dont get it, am I missing somethnig. Thanks for your help i feel we are getting closer.
  14. Hi Sasa I cant tell, due to the fact that the function is in an external file, that is included. So when i view source i only get the info for that page i think. onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)">   <img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic('',0,-2000,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"> altoguh i did find this code
  15. hi again wildteen The page recgnised the echo, but again the layer did not scroll, its still the $layer2Scroll variable that is causing me problems, if I just replace the '{layer2scroll}'  with 'initial' its works fine. So I still need to get the value of the variable to be read as text. What do you reckon. Thanks Again
  16. hi many thanks for your reply, I have never used that technique before. Wil lthis solve the problem I am having trying to get. Layer variable to be read as its value? Many Thanks Jamie
  17. Hi all, Just a quick question, Im sure it is very simple, I have a line of HTML code that calls a javascript function. The function basically scrolls layers. In order to scroll the javascript is sent a number of variable including in my case A layer and a value to scroll down to the code below is a sample of the code which works. onMouseOver="P7AniMagic('initial',0,-200,5,30,0,0)" the two key values are the word initial and the -200. the initial is the name of the layer I wish to scroll and -200 is by how much I wish to scroll. for each of these I need to send values to in the form of variables so any layer can be scrolled any distance. I can replace the -200 with the variable $ScrollVal onMouseOver="P7AniMagic('initial',0,<?php echo $ScrollVal; ?>,5,30,0,0)" this works fine, i then want to replace the layer name in the following way. onMouseOver="P7AniMagic(<?php echo "'".$Layer2Scroll."'" ?>,0,<?php echo $ScrollVal; ?>,5,30,0,0)" This does not work, Im sure I have some of the "'". the wrong way around. Can anyone tell me how this should be wrote for characters, I seem to have managed the numbers by the $ScrollVal variable working okay. The full code for that line is below <div id="scroller" style="position:absolute; width:63px; height:23px; z-index:12; left: 774px; top: 275px; visibility: visible;"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic('initial',0,0,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"><img src="images/del.jpg" width="31" height="31" onMouseOver="P7AniMagic(<?php echo "'".$Layer2Scroll."'" ?>,0,<?php echo $ScrollVal; ?>,5,30,0,0)" onMouseOut="P7AniMagic('initial',0,0,1,1,2,0)"> </div> Many Thanks jamie
  18. HI all, I have a list box that has the permanent numbers 0 - 9. I simply want to maintain the selected value once the form is submitted. I plan to have a test on the form that looks for fields that are not completed. The listbox at the moment is produced using an if statement. If the variable is not set the list box produces 0-9 and is fine. If the form has been submitted and a variable is sent to the listbox. It manages to show the correct selected value, but when the list box is expanded again that value is repeated 10 times instead of having 0 - 9 the value (say 3) is repeated in the list box. Here is my code hope someone can help. Many Thanks Jamie     print "<SELECT NAME=Q1a value=0>";   for ($i=0; $i<10; $i++){ if (isset ($Q1a)) { print "<OPTION value =$i selected>$Q1a</OPTION>";   }     else     {         print "<OPTION value=$i>$i</OPTION>";     }   }   print "</SELECT><br><br>";
  19. Hi All, I have a list box that is populated directly from an ever growing database feeder table. This works fine, The feeder table has the followign structure CustomerID        CustomerName        CustCategory 1                      Airtours                  Tourist Industry 2                      MacDonanlds          Food Industry The listbox is found on a form, once submitted the main value (CustomerName) from the list box is entered into another database table What I also need to do is extract the CustCategory of the selected and place this into a variable on the click event of the listbox. I then want to automatically populate another textfield on the form with this variable to be submitted into the database. Here is my cod efor the list box.   <?php   $conn = db_connect();   $query_client = "SELECT * FROM tblClients ORDER BY CustomerName ASC";   $result_client =  sql_return($query_client);   $result_client = mysql_query($query_client);   ?> <td width="27%" valign="bottom"> <div align="left">        <?php   print "<SELECT NAME=CustomerName>";   print "<OPTION>Please Select....</OPTION>";           while($client_info = mysql_fetch_array($result_client))   {     $CustomerID=$clent_info['CustomerID'];   $CustomerName=$client_info['CustomerName']; $CustCategory=$client_info['CustCategory'];   echo $CustomerID;   print "<OPTION value='$CustomerID'>$CustomerName</OPTION>";     }   print "</SELECT><br><br>";   ?>   $conn = db_connect(); is in an include file and works fine. Many thanks in advance. Jamie
  20. Hi Thanks for your last reply, that did not seems to work for some reason the chart displayed just seeme dto be the standard line graph. http://www.recruitmentnl.info/training/chart_test.php I have removed all password now. The code i am using now is <?php include "charts.php"; $chart ['chart_type'] = "line"; mysql_connect ("localhost","x04recru_jamie","tatungjj"); mysql_select_db ("x04recru_main"); $res = mysql_query("SELECT Question, Score FROM tblChart ORDER BY Question"); $chart['chartdata'][0] = array('', ''); while (list($q, $s) = mysql_fetch_row($res)) { $chart['chartdata'][] = array($q, $s); } SendChartData ($chart); Hope someone can help Im not sure whats going on here really, Im just following the tutorial on the PHP/SWF web site. are there any other charting options available to me? many Thanks Jamie
  21. Bye the way the  username and password for the page is jamie jamie
  22. Hi all, I am trying to generate a simple line chart using the PHP/SWF http://www.maani.us/charts/index.php?menu=Tutorial&submenu=Chart_Data I am trying to read the values from a mysql database this is not a problem the problem comes from trying to generate an array from the values and plot them as a graph as shown in the tutorial My table is a simpletable structured as below   Question  Score        Q1      14       Q2      7       Q5      12       Q3      2       Q4      8 The code I am using to generate the graphs is shown below <?php include "charts.php"; $chart ['chart_type'] = "line"; $chart ['chart_data'][0][0]=""; $chart ['chart_data'][1][0]="Q1"; $chart ['chart_data'][2][0]="Q2"; $chart ['chart_data'][3][0]="Q3"; $chart ['chart_data'][4][0]="Q4"; $chart ['chart_data'][5][0]="Q5"; mysql_connect ("localhost","x04recru_jamie","tatungjj"); mysql_select_db ("x04recru_main"); $result = mysql_query("SELECT MIN(Score) as MinScore from tblChart"); $MinScore = mysql_result ($result,0,"MinScore"); $result = mysql_query ("SELECT * FROM tblChart"); for ($i=0; $i < mysql_num_rows($result); $i++){ switch (mysql_result ($result,$i,"Question")){ case "Q1": $row = 1; break; case "Q2": $row = 2; break; case "Q3": $row = 3; break; case "Q4": $row = 4; break; case "Q5": $row = 5; break; } $col = mysql_result ($result,$i,"Score")-$MinScore + 1; $chart ['chart_data'][0][$col]=mysql_result($result,$i,"Question"); $chart ['chart_data'][$row][$col]=mysql_result($result,$i,"Score"); } //echo $MinScore; SendChartData ($chart); ?> The vlaues seem to be falling out of the array okay and plotting on the graph as shown below http://www.recruitmentnl.info/training/chart_test.php the trouble is I cannot configure the array correctly to move the line graph from the first column (ie far left) across to the right columns to represent the values. Has anyone any experience of this add in and could possibly help me with this. Many Thanks Jamie
  23. Can anyone help with this one it is still driving me mad Thanks in Adavance
  24. [!--quoteo(post=362152:date=Apr 6 2006, 02:45 AM:name=notonurnelly)--][div class=\'quotetop\']QUOTE(notonurnelly @ Apr 6 2006, 02:45 AM) [snapback]362152[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi All, I am getting the following error when trying to run the following code: <?php do { ?> <tr> <td> <?php echo $row_rstArtists['artist_name']; ?> </td> <td><a href="artists.php?artist=<?php echo $row_rstArtists['arist_pk']; ?>">View</a></td> </tr> <?php } while ($row_rstArtists = mysql_fetch_assoc($rstArtists)); ?> </table> The error reads Warning: mysql_fetch_assoc(): 4 is not a valid MySQL result. The code was automatically generated using dreamweaver server behaviours. Can anyone please help me to solve this problem. Many Thanks Jamie [/quote] Many Thanks for your reply, here is the query code, All of this code was developed by dreamweaver automatically. the example is taken from a book mysql_select_db($database_Apress, $Apress); $query_rstArtists = "SELECT * FROM artist"; $query_limit_rstArtists = sprintf("%s LIMIT %d, %d", $query_rstArtists, $startRow_rstArtists, $maxRows_rstArtists); $rstArtists = mysql_query($query_limit_rstArtists, $Apress) or die(mysql_error()); $row_rstArtists = mysql_fetch_assoc($rstArtists); Thanks
×
×
  • 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.