Jump to content

johnh2009

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by johnh2009

  1. yes it is hosted by an outside company, additionally i noticed that i couldnt log into my phpmyadmin CP also so what you said makes sense, thank you my mind is at ease once again
  2. no it is MySQL i typo'ed MSQL tht is my fault sorry
  3. i see, so is this an issue with my hosts server settings or me not closing mine?
  4. UPDATE: Ok it seems to have resolved itself....however im pretty sure ive got an eror in my coding for it to have happened in the first place so if anyone has any advice on how to avoid it i would be so grateful. This site is my livelyhood effectively and i suck majorly at coding, i based my site in tables because i have not got so far as to learn how to layout in css yet:( It is something ill update but after ive got one going. I am sorry im not a very high contributer but my knowledge is very limited and i fear id cause more issues that resolve right now.
  5. Hey guys, im so sorry to plant this here, i was hoping to resolve this myself but im having problems with my self employed website. Been a while since i coded any php so ive been cannibalising old code i had from a few years ago, only now im getting this error: http://www.dotcomuk.co.uk/index1.php - which is Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home/fhlinux128/d/dotcomuk.co.uk/user/htdocs/_admin/oldb.php on line 6. The file that the info comes from looks as follows: <?php //function AvaaTietokanta ($osoite = "127.0.0.1",$tietokanta="igpc") function AvaaTietokanta ($osoite = "******",$tietokanta="*****") { // $yhteysnumero = mysql_connect($osoite,"root",""); $yhteysnumero = mysql_connect($osoite,"******","*****"); mysql_select_db($tietokanta); return $yhteysnumero; } // $id -muuttujan tarkistus // Mikäli $id on jotain muuta kuin numero, niin annetaan virheilmoitus // ja lopetetaan function cuttext($text,$num_characters) { $texto = htmlspecialchars($text); if (strlen($text) > $num_characters) { $text = substr($text, 0, $num_characters); # $text .= " ..."; } return $text; } function convert2proper($strVal){ $iPos = 0; $strValTmp = ""; do { $iSpace = strpos($strVal," ", $iPos); $strValTmp .= strtoupper(substr($strVal, $iPos, 1)); $strValTmp .= strtolower(substr($strVal, $iPos + 1, $iSpace - $iPos)); $iPos = $iSpace + 1; } while(strpos($strVal," ", $iPos) != FALSE); $strValTmp .= strtoupper(substr($strVal, $iPos, 1)); $strValTmp .= strtolower(substr($strVal, $iPos + 1)); return $strValTmp; } function cutString($strVal,$limit){ if(strlen($strVal)>$limit){ return substr($strVal,0,$limit) . "..."; }else{ return $strVal; } } ?> Also the code that is grabbing this is as follows: <?php require '_admin/oldb.php'; $yhteys = AvaaTietokanta();?> <?php if (!$kysely = mysql_query("select * FROM news order by id desc LIMIT 2",$yhteys)) { print "<LI>error on loading news!"; } else { while ($row = mysql_fetch_row($kysely)): $id = $row[0]; $texti = $row[2]; $shownews = cuttext($texti,200); $added=$row[3]; ?> <h2><?php echo "$row[1]"; ?></h2> <h4> » Added on <?php echo gmdate('l jS \of F Y',$added); ?> by <?php echo "$row[4]"; ?></h4> <p><?php print nl2br($shownews); ?>....<span class="orangeHighlight"><a href="fullnews.php?id=<?php echo "$id"; ?>">Read More</a></span></p><br> <?php endwhile; } ?> <h3>5 Most Recent News Items</h3> <?php $kyselyb = mysql_query("select * FROM news order by id desc LIMIT 5",$yhteys); while ($row = mysql_fetch_row($kyselyb)): $idb = $row[0]; $nextheadline = $row[1]; $nextheadline = cuttext($nextheadline,70); ?> <p>» <a href="fullnews.php?id=<?php echo "$idb"; ?>"><?php echo "$nextheadline"; ?></a></p> <?php endwhile; ?> <br> <p><a href="news-archive.php">Click Here for All Archived News Items</a></p> TBH im at a loss, ive tried googling but the pages that came up didnt make much sense to me at all. One site said to log into phpmyadmin and kill processes but when i try to log in i get the too many connections error there too. I dont know what to do Please help The original code was wrote by a Finnish friend of mine many years ago, so sorry about the weird wording on some of the code.
  6. sat with Learning CSS from Lynda.com now
  7. can i add...im very sorry for these questions and please someone say if ive overstepped the boundary of asking for help all the time:S All the help and advice ive recieved here is very much appreciated and i only wish i was in a position to help back You guys are the greatest
  8. i apologise for this in advance, i am not very good as yet - working on all the self teaching stuff i can find on ye olde internet My question is this: I have a "newest" news generator on my aikido site, it basically takes the 5 newest "news" item from a database, limits the amount to 5 and outputs the info into a table row like so: <?PHP require 'admin/funktiot.php'; $yhteys = AvaaTietokanta(); ?> <table width="1024" border="0" align="center"> <tr> <td id="fontt" align="center">Latest News</td> </tr> </table> <table width="1024" border="0" align="center"> <tr valign="top" id="fontp" align="center"> <?php if (!$kysely = mysql_query("select * FROM news order by id desc LIMIT 5",$yhteys)) { print "<LI>error on loading news!"; } else { while ($row = mysql_fetch_row($kysely)): $id = $row[0]; $texti = $row[3]; $shownews = cuttext($texti,200); $added=$row[6]; $title=$row[2]; $addedby=$row[1]; echo "<td width='20%'><b>". $title ." </b><br> ". gmdate('d.m.y',$added) ."<br><br><i>". $shownews ."</i></td>"; endwhile; } ?> </tr> </table> This is the grand extent of my PHP ability, the question i have is how can i do a similar thing but with images form a directory? not newest as such just 5 random images? Any advice would be appreciated. Also how would i resize them to fit like 5 thumbnails? Also how can i make a gallery page with the pictures? Ive seen sites with links for 1-25 pics then 26-50 etc but i have no idea how to do it? Thank you so much in advance John
  9. ill certainly do this thank you for the advice Any more advice you have i will be happy to hear it
  10. this is something i never knew ill certainly do this for here on. Is there any preference between IE and firefox? i have the ability to use both but is there one i should more target for than another
  11. im by no means an expert but simply opening the file in IE wont run the PHP coding, you need some form of development environment ie wamp. IE wont run the code on its own because its server side scripting, namely it is ran before outputting the whole file to IE, most common setup is apache / mysql / PHP (the W stands for Windows in WAMP - Windows, Apache, Mysql, PHP) When you install WAMP you will have a directory of C:/Wamp/www if you used the default...as long as wamp is running place your .php files in a folder in this directory (or the directory itself if you prefer) then run them in IE, the code is ran in apache then output to your IE, this will give the clever guys here more info to work with and help to solve your problem I apologise in advance if you already know this and if you dont i hope it helps:) EDIT: guys if any of my terminology is incorrect please let me know
  12. indeed on the long way to go, still trying to find my feet which is not going well at all. Its all very daunting and i feel very inferior in the design part...struggling plenty id have to say, i wanted this to be a very user friendly site but finding it hard to write the code from memory
  13. i took the id off and removed the text and it looks fine now thanks for taking a look your help is really appreciated
  14. great stuff any suggestions on how to fix it before i start playing with them EDIT: tried changing the size of them, stil not working That is the code for the pics btw: <td valign="top" id="fontpx" align="center"><p><strong><img src="225px-Morihei-Ueshiba.jpg" width="94" height="114"/>O'Sensei <br /> </strong><strong>Morihei Ueshiba</strong> <img src="aikiinvert.jpg" alt="" width="71" height="142" /> </td>
  15. ok in order for you to see it how it is i have temporarily put it online, you can find it on this address: http://213.107.83.111/aikido/
  16. that is so weird, the title of billingham aikido club for example...when i switch from the two on this computer i see it move around an inch to the left, including the pictures i have etc...is it possible that those affect it?
  17. thanks for the quick reply:) here is CSS @charset "utf-8"; /* CSS Document */ #navigation ul { margin-left: 0; padding-left: 0; list-style-type: none; float: left; list-style-type: none; } #navigation a { font-family: Tahoma; display: block; padding: 5px; width: 100px; border-bottom: 1px solid #00F; } #fontti { font-family: Tahoma; font-size:42px; color:#FFF } #font { font-family: Tahoma; font-size:22px; color:#C00 } #fontt { font-family: Tahoma; font-size:22px; color:#00F } #fontp { font-family: Tahoma; font-size:16px; color:#FFF } #navigation a:link, #navlist a:visited { color:#C00; text-decoration: none; } #navigation a:hover { background: #000 url(arrow.gif) 96% 50% no-repeat; background-color: #000; color:#C00; } --> </style> NOTE: i didnt make this just butchered something i found on the net
  18. not really a PHP thing but very annoying... Ok so im making a sitre for my aikido club, im not very good when it comes to layouts but i try none the less... Anyway the problem is this (any help you can give would be great): My main index page loads up and its all fine and well etc etc etc then when i go to the about page i can see an obvious change in size etc but when i look in the coding on dreamweaver they seem to be exactly the same. As i mentioned i am not very good when it comes to layout...i made this site in a table (probably a bad idea but i know nothing else)...ill post both pages: About Page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Billingham Aikido Club</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body bgcolor="#000000"> <p> </p> <table width="1024" border="0" align="center"> <tr> <td width="132"><img src="aikiinvert.jpg" width="71" height="142" /></td> <td width="746" align="center" id="fontti">Billingham Aikido Club</td> <td width="132" align="right"><img src="aikiinvert.jpg" width="71" height="142" /></td> </tr> <tr> <td colspan="3" id="font" align="center">Northfield Sportsdrome, Thames Road, Billingham, Stockton on Tees, TS22 5EG</td> </tr> <tr> <td colspan="3" id="font" align="center"> </td> </tr> <tr> <td colspan="3" id="fontt" align="center">About Aikido</td> </tr> <tr> <td valign="top" align="center"><div id="navigation"> <ul id="navlist"> <li><a href="index.php">Home</a></li> <li><a href="about.php">Aikido</a></li> <li><a href="kogusoku.php">Kogusoku</a></li> <li><a href="phpbb3/index.php">Forum</a></li> </ul></div></td> <td id="fontp" valign="top" align="justify"><p><strong>Aikido</strong> (<span xml:lang="ja" lang="ja">合気道</span>) is a <a href="http://en.wikipedia.org/wiki/Japanese_martial_art" title="Japanese martial art">Japanese martial art</a> developed by <a href="http://en.wikipedia.org/wiki/Morihei_Ueshiba" title="Morihei Ueshiba">Morihei Ueshiba</a> as a synthesis of his martial studies, philosophy, and religious beliefs. Aikido is often translated as "the Way of unifying (with) <a href="http://en.wikipedia.org/wiki/Qi" title="Qi">life energy</a>"or as "the Way of harmonious spirit."Ueshiba's goal was to create an art that practitioners could use to defend themselves while also protecting their attacker from injury.</p> <p>Aikido is performed by blending with the motion of the attacker and redirecting the force of the attack rather than opposing it head-on. This requires very little physical energy, as the <em><a href="http://en.wikipedia.org/wiki/List_of_aikidoka" title="List of aikidoka">aikidōka</a></em> (aikido practitioner) "leads" the attacker's <a href="http://en.wikipedia.org/wiki/Momentum" title="Momentum">momentum</a> using entering and turning movements. The techniques are completed with various <a href="http://en.wikipedia.org/wiki/Throw_%28grappling%29" title="Throw (grappling)">throws</a> or <a href="http://en.wikipedia.org/wiki/Joint_locks" title="Joint locks">joint locks</a>.Aikido can be categorized under the general umbrella of <a href="http://en.wikipedia.org/wiki/Grappling" title="Grappling">grappling</a> arts.</p> <p>Aikido derives mainly from the martial art of <a href="http://en.wikipedia.org/wiki/Dait%C5%8D-ry%C5%AB_Aiki-j%C5%ABjutsu" title="Daitō-ryū Aiki-jūjutsu">Daitō-ryū Aiki-jūjutsu</a>, but began to diverge from it in the late 1920s, partly due to Ueshiba's involvement with the <a href="http://en.wikipedia.org/wiki/Oomoto" title="Oomoto">Ōmoto-kyō</a> religion. Ueshiba's early students' documents bear the term <em>aiki-jūjutsu. </em>Many of Ueshiba's senior students have different approaches to aikido, depending on when they studied with him. Today aikido is found all over the world in a number of styles, with broad ranges of interpretation and emphasis. However, they all share techniques learned from Ueshiba and most have concern for the well-being of the attacker.</p></td> <td valign="top" id="fontpx" align="center"><p><strong><img src="225px-Morihei-Ueshiba.jpg" width="125" height="152"/>O'Sensei <br /> </strong><strong>Morihei Ueshiba</strong></p> <p><img src="aikiinvert.jpg" alt="" width="71" height="142" /></p> <p> </p></td> </tr> </table> <br /><br /> <?php require 'newsbits.php'; ?> <br /><br /> <table width="1024" border="0" align="center"> <tr> <td><img src="kogusoku.jpg" width="1004" height="89" /></td> </tr> </table> <p> </p> </body> </html> Index Page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Billingham Aikido Club</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body bgcolor="#000000"> <p> </p> <table width="1024" border="0" align="center"> <tr> <td width="132"><img src="aikiinvert.jpg" width="71" height="142" /></td> <td width="746" align="center" id="fontti">Billingham Aikido Club</td> <td width="132" align="right"><img src="aikiinvert.jpg" alt="" width="71" height="142" /></td> </tr> <tr> <td colspan="3" id="font" align="center">Northfield Sportsdrome, Thames Road, Billingham, Stockton on Tees, TS22 5EG</td> </tr> <tr> <td colspan="3" id="fontp" align="center"> </td> </tr> <tr> <td colspan="3" id="fontt" align="center">About Billingham Aikido Club</td> </tr> <tr> <td valign="top" align="center"><div id="navigation"> <ul id="navlist"> <li><a href="#">Home</a></li> <li><a href="about.php">Aikido</a></li> <li><a href="kogusoku.php">Kogusoku</a></li> <li><a href="phpbb3/index.php">Forum</a></li> </ul></div></td> <td id="fontp" align="justify"><p>Billingham Aikido Club, is part of the Kogusoku Aikido Association and is ran by Sensei Rob Dowson and Sensei John Harland. </p> <p>The Club takes place every friday night at Northfield school, Billingham (full address above). The club is more known for being held at the Billingham Forum where we have ran for over 15years, until August 2008 when we moved due to impending redevelopment. </p> <p>The home of the Kogusoku Aikido Association lies within Sunderland (North East England) and has several smaller branches throughout the region such as our club in Billingham. </p> <p>The Billingham Aikido Club has been part of the Kogusoku Aikido Association since it formed in April 2007. </p> <p>For more information please look throughout this website, or come along to watch or join in and start training for yourself. </p> <p>We are currently looking for new starters and everyone is welcome and as an added bonus First Lesson is Free!</p></td> <td valign="top" align="center"><p><img src="aikipinv.jpg" width="122" height="121" /></p> <br /> <br /> <p><img src="aiki1.jpg" width="105" height="142" /></p></td> </tr> </table> <br /><br /> <?php require 'newsbits.php'; ?> <br /><br /> <table width="1024" border="0" align="center"> <tr> <td><img src="kogusoku.jpg" width="1004" height="89" /></td> </tr> </table> <p> </p> </body> </html>
  19. excellent, thank you that worked Thank you for the quick reply, i felt like i could not carry on until i had this working
  20. Introductions 1st Hi all im john, im very new to PHP. I made a fansite for F1 sim racing a few years ago but didnt carry it on, now im reteaching myself but its not going too well. I woul dbe very grateful for any help anyone can give I made a website for my F1 simracing a while back, anyway the linking i used is no longer working. i use this link: echo “”. $shownews .”…….Read More“; the url address has the id in it ie: news.php?nid=13 and the news page has the following in it: $kysely = mysql_query(”select * FROM igpcnews WHERE id=’$nid’”,$yhteys); but i always get Notice: Undefined variable: nid in C:\wamp\www\site\news.php on line 41 This used to work a few years ago, im guessing the newer PHP dont work the same as the older because i dont know whats up with it. Can anyone help??
×
×
  • 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.