Jump to content

notonurnelly

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

notonurnelly's Achievements

Member

Member (2/5)

0

Reputation

  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
×
×
  • 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.