Jump to content

Nothadoth

Members
  • Posts

    119
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Nothadoth's Achievements

Member

Member (2/5)

0

Reputation

  1. I can't see any error logs being created. So i'm not really sure. However I tested it in chrome and it works fine - so it must be an issue with IE10. I guess it's not really a problem then, it doesn't effect the end user anyway. Thanks for the help guys.
  2. I am re-designing the theme so I created a new directory to work in and when it is finished ill just transfer the files. I havent modified any files in the old directory but now it is causing the error. An example of this is the following URL - http://eventav.biz/s...&cmd=close&e=20 If I click the form button to change the event status it takes me to the above url but displays the "HTTP 400 Bad Request" error. But if I then just click the url at the top of the browser and click enter then it loads fine and works... I can perform the action on my iphone and it works, but using my laptop or my dads causes the error. PS - To bring this to a moderators attention. I cannot post messages properly on this forum using internet explorer 10. The quick reply box wont allow me to type and when I created this thread I was unable to create a new line. I am having to use Chrome.
  3. Hey guys. I had my site working fine, but now all of a sudden when I click on certain hyperlinks it goes to 'HTTP 400 Bad Request'. But then if I just refresh the page it works fine. Why is this happening? Any clues??????
  4. Hey, I am trying to create a fairly simple website for my dads business. However I require to be able to run multiple php sessions at once and I'm not entirely sure of the best way to do this. Basically there will be different product lists displayed based on the $eventId variable set in the URL. For instance index.php?e=1 shows the products for event 1, and index.php?e=2 shows products for event 2 etc. He wants them to have to require a password for each event. I thought about using something like this: $_SESSION[$eventId]['loggedIn'] Would that sort of thing work? Or is there a better way of creating simultaneous sessions? Much appreciated, Tom
  5. Thanks very much i'll take a look at that. Also, I found that my problem was that the variable I was trying to use contained a speech mark, so I fixed it by using str_replace. Anyway, the jquery looks much tidier thanks.
  6. Hey guys, im not very good with javascript so I used a script from DynamicDrive.com to give me a tooltip on mouse over for a div. It works fine, except for if I want to use a php variable as the tooltip text. Why? Here is the javascript code: var offsetfromcursorX=22 //Customize x offset of tooltip var offsetfromcursorY=20 //Customize y offset of tooltip var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1). document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV document.write('<img id="dhtmlpointer" src="images/tooltiparrow.gif">') //write out pointer image var ie=document.all var ns6=document.getElementById && !document.all var enabletip=false if (ie||ns6) var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "" var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : "" function ietruebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function ddrivetip(thetext, thewidth, thecolor){ if (ns6||ie){ if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px" if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor tipobj.innerHTML=thetext enabletip=true return false } } function positiontip(e){ if (enabletip){ var nondefaultpos=false var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft; var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop; //Find out how close the mouse is to the corner of the window var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20 var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20 var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000 //if the horizontal distance isn't enough to accomodate the width of the context menu if (rightedge<tipobj.offsetWidth){ //move the horizontal position of the menu to the left by it's width tipobj.style.left=curX-tipobj.offsetWidth+"px" nondefaultpos=true } else if (curX<leftedge) tipobj.style.left="5px" else{ //position the horizontal position of the menu where the mouse is positioned tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px" pointerobj.style.left=curX+offsetfromcursorX+"px" } //same concept with the vertical position if (bottomedge<tipobj.offsetHeight){ tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px" nondefaultpos=true } else{ tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px" pointerobj.style.top=curY+offsetfromcursorY+"px" } tipobj.style.visibility="visible" if (!nondefaultpos) pointerobj.style.visibility="visible" else pointerobj.style.visibility="hidden" } } function hideddrivetip(){ if (ns6||ie){ enabletip=false tipobj.style.visibility="hidden" pointerobj.style.visibility="hidden" tipobj.style.left="-1000px" tipobj.style.backgroundColor='' tipobj.style.width='' } } document.onmousemove=positiontip Here is the code on my php pageecho "<div onmouseover=\"ddrivetip('Test Description', 300)\" onmouseout=\"hideddrivetip()\"><img src=\"$thumbnail\" alt=\"$pd_name\"></div> "; If I swap "Test Description" with $pd_name or anything else the tooltip does not show up at all. Why not? PS. Sorry about the post! I cannot seam to start a new line on this text editor????? The enter key does nothing. Problem with ie10??
  7. Hi, I have set up my database so that there are 3 sizes (A5, A4, A3). There is a price and quantity for each - so the column names are: a5_price, a5_qty, a4_price, a4_qty, a3_price, a3_qty In a form the user submits the size they want and it returns $size and $qty to add it to the cart. I want to query the database and get the quantity field which contains $size (so a3_qty for example) and then retrieves the current stock. How can I do this? At the moment I tried $sql = "SELECT pd.pd_id, pr.a3_qty, pr.a4_qty, pr.a5_qty, pr.postcard_qty FROM tbl_product pd, tbl_print pr WHERE pd.pd_id = $productId AND pr.pd_id = $productId"; $result = dbQuery($sql); extract($row); if (strstr($a3_qty, $ct_pd_size)) { $currentStock = $a3_qty; } elseif (strstr('$a4_qty', '$ct_pd_size')) { $currentStock = $a4_qty; } elseif (strstr('$a5_qty', '$ct_pd_size')) { $currentStock = $a5_qty; } Obviously that doesnt work as it is searching the contents of the field. How can I make it search the field name and then return the contents? Thank you.
  8. I am looking in to that "many to many" method now. It seams a tidy solution. I'll set about learning this. Thanks
  9. Thanks for the replies. ChristianF: Yeah I could make the database so that each value had its own field. But I figured that this would be too messy. Which is why I decided to store multiple values in a single field. Do you think that it would be better then to just put each value in its own column and have a lot of columns? I'm intersted though. Why exactly do you say that it is such a problem to store data like this in a single column? And why are variable variables so bad to use? Thanks for your help
  10. maxudaskin: Yes I was going to mark as solved. However I was waiting to see if ChristianF (or anyone) happened to know a way around the problem in my last post, since everyone was saying my original method wasn't very good. Never mind.
  11. Thanks for your replies. ChristianF: I did try to use an array. But mysql would not split it. I tried adding the data to the database field pd_color(eg. black,black.jpg,000000). Then i retrieved that as $color = $row['pd_color'] and tried to make an array out of it but it would not split it. I ended up having to use SPLIT_STR() and define each individual part manually.
  12. Yes i looked up variable variables before I started this and from what I saw it looked fine. I cant figure out why it isn't working. So what would you suggest. EDIT: The reason I want to do this is because I am gathering multiple variables from a database that look like this: mens_color, mens_size, mens_price, womens_color, womens_size, womens_price, etc. (there are a fair amount more). The $gender variable is set according to which we want to view. So the data would be returned using ${$gender}_color, etc. It just seams a neater way than doing if ($gender = "mens") { $color = $mens_color } and the same for womens. I would have a long string down the page defining variables.
  13. Hey, I would like to be able to select a variable using another variable. I have tried the code displayed but it does not work. Any ideas? $gender = "mens"; $test_mens_test = "test"; echo $test_{$gender}_test; Thanks
  14. I have solved it. The new mysql version used a longer encryption. The password field I was using before was limited to VARCHAR 32 where the new password string was 41 chars long. So i changed it to VARCHAR 50 just in case and it works fine. I also replaced all PASSWORD() functions with SHA1() as I have researched and found that it is a strong encryption. Hope this helps anyone.
  15. I thought it may have been because of the MySQL version so I ran a MySQL query on the new site with the following: (Username: admin, Password: admin) $sql = "INSERT INTO tbl_user (user_name, user_password, user_regdate) VALUES ('$userName', PASSWORD('$password'), '$config_datetime')"; This returned the password string in the database as: *2470C0C06DEE42FD1618BB99005ADCA Then in the login function it runs the following (and returns "Wrong Username or Password"): if ($userName == '') { $errorMessage = 'You must enter your username'; } else if ($password == '') { $errorMessage = 'You must enter the password'; } else { // check the database and see if the username and password combo do match $sql = "SELECT user_id FROM tbl_user WHERE user_name = '$userName' AND user_password = PASSWORD('$password')"; $result = dbQuery($sql); if (dbNumRows($result) == 1) { $row = dbFetchAssoc($result); $_SESSION['plaincart_user_id'] = $row['user_id']; // log the time when the user last login $sql = "UPDATE tbl_user SET user_last_login = '$config_datetime' WHERE user_id = '{$row['user_id']}'"; dbQuery($sql); // now that the user is verified we move on to the next page // if the user had been in the admin pages before we move to // the last page visited if (isset($_SESSION['login_return_url'])) { header('Location: ' . $_SESSION['login_return_url']); exit; } else { header('Location: index.php'); exit; } } else { $errorMessage = 'Wrong username or password'; } } return $errorMessage; } Im completely confused. If i remove the user_password = PASSWORD('$password') and put the password string from the top of the post in to the Password box then it works fine. So it seams that it is just that the PASSWORD() function is giving the same result on both queries...
×
×
  • 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.