Jump to content

ptolomea

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by ptolomea

  1. you need something like on your results page $bookTitle = $_POST['BtName'] then mysql_query("SELECT [fields you want] FROM [table ie BOOKTITLE] WHERE BtName='" . $bookTitle . "'");
  2. $con is defined in connect.php $con = msql_connect( etc... but i will give those a try, couldn't hurt , i will edit with results Edit now that worked remvoing the $con from the mysql connect and any mysql function calling $con. care to explain why that would work or is $con not within the scope of functions.php?
  3. I'm helping a friend out with his website we were cruising right along until he made some changes to the file tree. Now we get mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/p/t/o/ptolomea/html/functions.php on line 4 Just to be sure as his files had alot of code in them i built a new set of files and uploaded to my own webspace which is where this error is coming from. This has been bugging me for 2 days now cant make heads or tails everything i try results in the same. Main page (page1.php) <?php require_once 'connect.php'; include 'functions.php'; ob_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <div id="wrapper"> <?php test(); //echo genExpBarLinks(); ?> </div> <?php mysql_close($con); ob_end_flush(); ?> </body> </html> connect.php <?php $con = mysql_connect('DBIP','CIndex','******'); if (!$con){die('Could not connect to database: ' . mysql_error());} mysql_select_db('CIndex',$con); ?> functions.php <?php function test() { $data = "Select * from Books"; $all = mysql_query($data,$con) or die(mysql_error()); $test = mysql_fetch_array($all); var_dump($test); }; ?> If i move the data in functions to page1.php i get results. i have tryed all sorts of things including adding "include and/or require_once connect.php" on/infront of every line in functions.php. My only idea is that functions.php file is not being allowed access to the database connection hence the adding/including of the connection file inside. Thanks for any help -Ptolomea
  4. Fixed it needed some margin changes and position movement div.moduleleft { margin-left: 30px !important;margin-left: 15px; margin-top: -15px; padding: 0; float: left; width: 100%; background: url(/images/leftMenu-cont-left-right.gif) repeat-y top left; font-weight: bold; text-align:left; position: relative; top:15px; } div.moduleleft div { /*margin-top: -10%;*/ padding: 0; background: url(/images/leftMenu-cont-bottom.png) no-repeat 10% 100%; margin-bottom:15px; }
  5. Yes CSS is the way to go I have been messing with it for the past couple of days, learned a little bit about it. this site here has helped me tremendously http://www.w3schools.com/css/default.asp I mainly go to the CSS2 Reference section and CTRL+F to find what i want CSS Help on background http://www.w3schools.com/css/pr_background.asp the answer to your problem i think is Same image in all cells (its either table.td or table td) table.td { background: url(IMAGEURL) no-repeat top left; } Different Image in cells you specify HTML: <td id='image1'> CSS: #image1 { background: url(IMAGEURL) no-repeat top left; } and just make #image2 or which ever you want to call it each time you want a different background for a different <td>
  6. Not quite sure where to put this as my code is part html, js, css which just happen to be 3 different sections here, but I think the main issue is in the HTML section. I already have the code for the menu to collapse and open up the problem is when it is collapsed it is not meeting up with other menus. There is a gap in between the 2 menus. I was expecting a small gap between the menus but not a gap this big, I have exhausted my ideas as to why this is happening but nothing has seemed to work Thanks for any help you are able to give. see it in action at http://www.resultsmayvary.org and now for the code CSS File .mH {color:#60c; cursor:pointer; font-weight:bold; border-top:0px solid #300;} .mO {margin-left:10px; display:block;} #leftcol div.moduletable h3 { margin: 0 0 0 0px; padding-left: 30px; padding-top: 3px; font-size: 13px; font-weight: bold; background: url(/images/leftMenu-button-on.gif) no-repeat top left; height: 23px; color: #d0a701; } div.moduleleft h3 { margin-top: 0px; padding-left: 30px; padding-top: 3px; font-size: 13px; font-weight: bold; background: url('/images/leftMenu-cont-top.gif') no-repeat top left; height: 22px; color: #d0a701; text-align:left; } //Left and right section this is the image that is shown when the modules are collapsed div.moduleleft { margin-left: 30px !important;margin-left: 15px; padding: 0; float: left; width: 100%; background: url(/images/leftMenu-cont-left-right.gif) repeat-y top left; font-weight: bold; text-align:left; } div.moduleleft div { padding: 0; background: url(/images/leftMenu-cont-bottom.png) no-repeat 10% 100%; } Menu.php contains everything related to my menu <div id="leftcol"> <div class="moduleleft"> <h3 class='mH' onClick="toggleMenu('mainMenu')">Menu</h3> <div id='mainMenu'> <table> <tr> <td> <ul id='transMenu'> <li><a href='http://www.resultsmayvary.org' class='mainlevel'><span>Home</span></a></li> <li><a id='guildInfo' class='mainlevel'><span>Guild</span></a></li> </ul> </td> </tr> </table> </div> </div> <div class="moduleleft"> <h3 class='mH' onClick="toggleMenu('other')">Somthing else</h3> <div id='other'> <table> <tr> <td> <ul> <li>1</li> <li>2</li> </ul> </td> </tr> </table> </div> </div> <div class="moduleleft"> <h3 class='mH' onClick="toggleMenu('resources')">Game Resoruces</h3> <div id='resources'> <table> <tr> <td> <ul id='transMenu'> <li><a id='warhammer' class='mainlevel'><span>Warhammer</span></a></li> <li><a id='warcraft' class='mainlevel'><span>Warcraft</span></a></li> <ul> </td> </tr> </table> </div> </div> </div> JS function that opens and closes menu function toggleMenu(objID) { if (!document.getElementById) return; var ob = document.getElementById(objID).style; ob.display = (ob.display == 'block')?'none': 'block'; }
  7. grr time limit on edit post passed while typing edit *EDIT* forgot that would change the cursor to a hand for every image you have inside a <p> tag instead you could go like this CSS file #mailto { cursor: pointer; } and for your img tag i think <img id='mailto' src='images/Email-Logo.gif" and if that does not work you can throw it into the <p> tag <p id='mailto'>
  8. I'm a little new to CSS files so the formatting might be a little bit off but this should do the trick for you p.img { cursor: pointer; } put that into a .css file (assuming you don't have one) and add <link rel="stylesheet" type="text/css" href="YOURCSSFILEHERE" /> to the head section of your site. little reading for you http://www.w3schools.com/css/pr_class_cursor.asp
  9. I figured it out, i remember about 3 weeks ago i crashed the entire install and was unable to recover it, had to reinstall and did not put a check in allow this service to interact with desktop, once i put that check there the app started up just fine
  10. got a problem with my exec() hanging, the code i had used to work but i changed the design and layout of my project and needed to run a different program with different parameters. I started writing the new stuff, got the the point where i can run a valid test and the script hangs, so i reverted to the old code that was working and it to hangs. after much research and looking around i found that each time i run the script the process shows up in the processes list in windows, and if i was to close the process the php page loads but the app never opens. my test page, just trying to get the app to open up, worry about the parameters later. <?php exec("mplayerc.exe") ?> i have also appended 2>&1 to the end to see if there was any errors, none, have tried <?php exec("mplayerc.exe",$responce); var_dump($responce); $responce always comes up empty when i kill the process from my list and tried as stated in php bug http://bugs.php.net/bug.php?id=22526 session_write_close() went to popen() as a test from reading http://bugs.php.net/bug.php?id=30794 and even tried shell_exec(), and system() with same results I have checked to make sure my safe_mode is off, i have seen mention of mod_php but have been unable to locate any reference to it in any of my config/extension files, I have also seen reference to switch from SAPI to CGI, I have not tried this, and its to late for me to figure out how to do so at the moment. the test system is running XP SP2, WAMP5(PHP5.2.2,APACHE2.2.4) -Thanks
  11. i'm not actually getting an error, just a broken image link, but when i type the information in the browser window i'm able to see that it is in fact grabbing an image from the database and that it is in fact searching the right title. which makes me think that this problem is not related to the original problem. edit: getImage.php?title='" . $title . "'> problematic little single quotes. changed to getImage.php?title=" . $title . "> works just fine
  12. make sure $page is > 0 so that you cant go into negative pages ie page -1, -2 etc.
  13. thats sending it now but still unable to load image thought it was because of the + that were now added but adding urldecode still didn't show the image. even threw decode into a new variable same result. $newTitle = urldecode($title); $results = mysql_query("SELECT * FROM currentlist WHERE title = '" . $newTitle . "'");
  14. I found a tutorial on this website about doing kinda what you want. but alas i am unable to find said tutorial right now but what it had done was create 1 giant table with the with your design and what you did was look at the table code till you find the section where you want your pages to go, and make this a file called header.php then take the rest of it and call it footer.php. thats what i did. now on my files i just had the top line include 'header.php'; and when the page was done, include footer.php then build your page the way you want. it was something like frames in html. I did notice you have a fix or sorts already but this is something i have done, it was fun
  15. I'm trying to retrieve an image from my database, the code i have works for anything with out a space but once there is a space in a title it only sends the first word. I have tried str_replace, and addslashes to no avail. request for image. getImage.php?title='" . $title . "'> getImage.php $title = $_REQUEST['title']; mysql_select_db("movies"); $results = mysql_query("SELECT * FROM currentlist WHERE title = '" . $title . "'"); while ($row = mysql_fetch_array($results)){ echo $row['coverFront']; }
  16. .... i feal dumb now that all makes complete sense just not what i was looking for, thanks guys
  17. really weird i can not see where this is having a problem Error says: "Parse error: syntax error, unexpected $end in functions.php on line 9 <?php //Mounts ISO once selected function mount($isoName) { exec("isostuff\daemon.exe -unmount 0"); exec("isostuff\daemon.exe -mount 0, isostuff\" . $isoName); } ?> i did have a few different functions in there but as the error persists i started removing them one by one this is the only function left in the file.
  18. well i dont know why its working like this but I'm getting the information i want so here is my solution if (ereg("^\"(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+)",$currentDKP[$linenum],$regs)){
  19. I've actually split the file into a smaller test file and replaced all the "," with ; which is not found in the file anywhere. heres what it looks like now "10 Things I Hate About You;Buena Vista;Out;5.1;LBX",14.99,"PG-13;1999;Comedy;1.85:1;717951004208",1999-10-12 00:00:00,3,2005-12-17 00:00:00
  20. have made some progress but not quite getting the responce I'm looking for if (ereg("(^[[:punct:]]{1})(.+)([[:punct:]]{3,4})",$currentDKP[$linenum],$regs)){ if i echo $regs[2] i get the first part of what i want but the problem is the rest of the junk that I dont which would start at "," heres an example 10 Things I Hate About You","Buena Vista",,"Out","5.1","LBX",14.99,"PG-13","1999","Comedy","1.85:1 is there a way i can tell it to get digits,text and spaces till "," with all my looking around and reading I have done nothing but made my head hurt alot and get tired. Not to mention I also tried to figure out the one in your sig effigy I'm going to pick this back up in the morning, Night
  21. So wasted a large amount of time trying to get pear installed on my development server and because I was not paying attention durring install had a few wrong directory's and had to reinstall my server (no big deal its a development server for a reason) If you mean changing the double quotes in my text file i'd rather not since there is 127,000 (One Hundred Twenty Seven THOUSAND, the text file is 20mb!) entrys... I don't see how escaping the $ will help as for now I'm off to reread some regex tutorials to see if i can rewrite my search.
  22. I'm getting this error in my ereg() Warning: ereg() [function.ereg]: REG_BADBR in populate.php on line 10 Line 10 if (ereg("^[:punct:]{1}[:alnum:][:punct:]{1,4}[:alnum:][:punct:]{1,4}[:alpha:](.*)$",$currentDKP[$linenum],$regs)){ what i'm trying to read. "Hanover Street (Special Edition)","Columbia/Tri-Star",,"Out","4.0","LBX, 16:9",9.95,"PG","1979","Drama","2.35:1","043396058316",2001-07-31 00:00:00,11881,2006-02-14 00:00:00 "Marathon Man","Paramount",,"Out","5.1","LBX, 16:9",9.99,"R","1976","Mystery/Suspense","1.85:1","097360878943",2001-08-28 00:00:00,12354,2006-08-11 00:00:00 I have a txt file with 127,000 of those i'm trying to get into a mysql database from what i have read and searched on I think it is a repetition error but I don't know where Its all comma seperated values
  23. I have no idea about the script you want, but I started learning PHP using the tutorials right here under the beginners section, and along with the information here I also used php.net to do function searches and get more examples of the ones that I did not understand. And then I also use w3schools.com for more info.
  24. all the images will be the same size and the crop points will be the same, if they are not then I'll have to manually crop the image itself
  25. Thanks, I'll look into that function, all the images are going to be the same size so I hope it wont be to hard.
×
×
  • 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.