Jump to content

cleary1981

Members
  • Posts

    210
  • Joined

  • Last visited

Everything posted by cleary1981

  1. the output to that is array(9) { ["accno"]=> string(4) "uhuh" ["compName"]=> string(4) "uhuh" ["contact"]=> string(4) "uhuh" ["add1"]=> string(4) "uhuh" ["add2"]=> string(4) "uhuh" ["town"]=> string(4) "uhuh" ["county"]=> string(4) "uhuh" ["pcode"]=> string(4) "uhuh" ["tel"]=> string(4) "uhuh" }
  2. What do you mean multiple database connections? I am querying one table in one db. I have seen examples of mysql_query used in this way.
  3. Can anyone tell me where i have went wrong here? when I submit the database isn't updated. <form id=addCompany action="addCompany.php" method="POST"> <label for="accno">Account Number</label> <input type = "text" value = "" name = "accno" id = "accno"></br> <label for="compName">Company Name</label> <input type = "text" value = "" name = "compName" id = "compName"></br> <label for="contact">Contact Name</label> <input type = "text" value = "" name = "contact" id = "contact"></br> <label for="add1">Address</label> <input type = "text" value = "" name = "add1" id = "add1"></br> <input type = "text" value = "" name = "add2" id = "add2"></br> <label for="town">Town/City</label> <input type = "text" value = "" name = "town" id = "town"></br> <label for="county">County</label> <input type = "text" value = "" name = "county" id = "county"></br> <label for="pcode">Post Code</label> <input type = "text" value = "" name = "pcode" id = "pcode"></br> <label for="tel">Telephone No.</label> <input type = "text" value = "" name = "tel" id = "tel"></br> <input type = "submit" value = "Submit"> <?php if($_POST['submit']) { require "config.php"; // database connection details //convert all the posts to variables: $accno = $_POST['accno']; $compName = $_POST['compName']; $contact = $_POST['contact']; $add1 = $_POST['add1']; $add2 = $_POST['add2']; $town = $_POST['town']; $county = $_POST['county']; $pcode = $_POST['pcode']; $tel = $_POST['tel']; //Insert the values into the correct database with the right fields $result=MYSQL_QUERY("INSERT INTO company VALUES ('$accno', '$compName', '$contact', '$add1', '$add2', '$town', '$county', '$pcode', '$tel')"); } ?>
  4. Hi, I have an if statement in my php and if true i want to go to the next page. How do I code that? if ($access_level == 3) { setcookie("super", "1", 0, "/", "", 0); setcookie("cost", "1", 0, "/", "", 0); supermain.php
  5. I would need to see more of the code to be sure but what I can tell from that is inp1.setAttribute("Name", "Name" +inputs); element.setAttribute(name, value) is setting the value of "Name" to what ever "Name"+inputs is. hope this helps. Post more code if u need more help
  6. Doh.. why didnt i see that. lol Cheers
  7. it isn't needed to solve this. I simply want to pass the variable from the first function to the second
  8. Hi, I have added in a drag and drop function from a tutorial and it works well. The problem I am having is that I need my variable g_objName to be associated with dragobj. Has anyone any ideas? function showObject (){ if (request.readyState == 4) { var returned = request.responseText; var splitResult = returned.split(" "); var h = splitResult[0]; var w = splitResult[1]; h = h/5; w = w/5; cv = document.getElementById("canvas"); var newObject = document.createElement('div'); newObject.Class = g_objName; newObject.id = "newObject"; newObject.innerHTML = g_objName; newObject.style.height = h; newObject.style.width = w; newObject.onmousedown=function(){grab(this);} cv.appendChild(newObject); } function grab(context) { document.onmousedown = falsefunc; // in NS this prevents cascading of events, thus disabling text selection dragobj = context; dragobj.style.zIndex = 10; // move it to the top document.onmousemove = drag; document.onmouseup = drop; grabx = mousex; graby = mousey; elex = orix = dragobj.offsetLeft; eley = oriy = dragobj.offsetTop; update(); }
  9. got the help of a genius from another source as there doesnt seem to be anyone helping in this forum. The solution was as follows for anyone intersted. newObject.onmousedown=function(){grab(this);}
  10. Hi, I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" Error: Line: 116 Char: 3 error: 'dragobj.newObject' is null or not an object code:0 heres the code <html> <head> <title>Drag and drop module</title> <style type="text/css"> #canvas { margin:auto; padding:0px; position: absolute; background-color:grey; border:dashed gray 1px; top: 5px; margin:auto; padding:0px; width:100%; height:400px; float:left; font-size: 8px; font-family:Arial, Helvetica, sans-serif; overflow: hidden; } #controls { margin:auto; padding:10px; position: absolute; width:100%; top:415px; float:left; background: grey; border:dashed black 1px; height: 150px; } #newObject { position: absolute; left: 10px; top: 10px; background-color:green; border:solid gray 1px; margin:10px; padding:4px; width:50px; height:50px; float:left; zIndex:1; cursor:pointer; font-size: 8px; font-family:Arial, Helvetica, sans-serif; } </style> <script type = "text/javascript"> function createObject (){ cv = document.getElementById("canvas"); var newObject = document.createElement('div'); newObject.Class = "newObject"; newObject.id = "newObject"; cv.appendChild(newObject); newObject.onmousedown=grab(this); } var mousex = 0; var mousey = 0; var grabx = 0; var graby = 0; var orix = 0; var oriy = 0; var elex = 0; var eley = 0; var algor = 0; var dragobj = null; function falsefunc() { return false; } // used to block cascading events function init() { document.onmousemove = update; // update(event) implied on NS, update(null) implied on IE update(); } function getMouseXY(e) // works on IE6,FF,Moz,Opera7 { if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event) if (e) { if (e.pageX || e.pageY) { // this doesn't work on IE6!! (works on FF,Moz,Opera7) mousex = e.pageX; mousey = e.pageY; algor = '[e.pageX]'; if (e.clientX || e.clientY) algor += ' [e.clientX] ' } else if (e.clientX || e.clientY) { // works on IE6,FF,Moz,Opera7 mousex = e.clientX + document.body.scrollLeft; mousey = e.clientY + document.body.scrollTop; algor = '[e.clientX]'; if (e.pageX || e.pageY) algor += ' [e.pageX] ' } } } function update(e) { getMouseXY(e); // NS is passing (event), while IE is passing (null) document.getElementById('xpos').value = elex; document.getElementById('ypos').value = eley; document.getElementById('object').value = dragobj ? (dragobj.id ? dragobj.id : 'unnamed object') : '(null)'; } function grab(context) { document.onmousedown = falsefunc; // in NS this prevents cascading of events, thus disabling text selection dragobj = context; dragobj.newObject.zIndex = 10; // move it to the top ###########line 116################# document.onmousemove = drag; document.onmouseup = drop; grabx = mousex; graby = mousey; elex = orix = dragobj.offsetLeft; eley = oriy = dragobj.offsetTop; update(); } function drag(e) // parameter passing is important for NS family { if (dragobj) { elex = orix + (mousex-grabx); eley = oriy + (mousey-graby); dragobj.newObject.position = "absolute"; dragobj.newObject.left = (elex).toString(10) + 'px'; dragobj.newObject.top = (eley).toString(10) + 'px'; } update(e); return false; // in IE this prevents cascading of events, thus text selection is disabled } function drop() { if (dragobj) { dragobj.style.zIndex = 0; dragobj = null; } update(); document.onmousemove = update; document.onmouseup = null; document.onmousedown = null; // re-enables text selection on NS } </script> </head> <body onload="init();"> <div id = "canvas"> </div> <div id = "controls"> <input type = "button" value = "New Object" onClick = "createObject()"> <input type = "text" value = "" name = "xpos" id = "xpos"> <input type = "text" value = "" name = "ypos" id = "ypos"> <input type = "text" value = "" name = "object" id = "object"> </div> </body> </html>
  11. Is it possible to add an onmousedown event to the objects i am creating in the code below? function showObject() { if (request.readyState == 4) { var returned = request.responseText; var splitResult = returned.split(" "); var h = splitResult[0]; var w = splitResult[1]; // the dimensions must be set to a scale as they are to big for the screen. 25px represents 100mm h = h/4; w = w/4; // this bit of code creates the new img object and sets the attributes var yy = document.getElementById("container"); var newImgElement = document.createElement("img"); //create a new img element newImgElement.className = "obj"; //for css reference newImgElement.src = "box.gif"; newImgElement.id = g_objName; newImgElement.border = 1; newImgElement.height = h; newImgElement.width = w; yy.appendChild(newImgElement); }
  12. Hi all, Found a great guide for setting up virtual hosts (http://guides.jlbn.net/) plus a few other goodies. Problem im having though is that the sever on which i want to install wamp already has a localhost. Has anyone else come accross this problem? is there a work around (eg, rename localhost to something else)
  13. Hi all, I have installed wamp 2.0 on my server. have changed to port 8080 in the httpd conf file. I'm a little confused though. if i'm on another machine in the network what do i type to access the files in the www folder?
  14. Hi, just a quick question. I'm completely new to this so apologies if sound completely stupid. I am writing an application using html and javascript for my frontend and using php to query a database that is held on the server. Will someone connecting over vpn be able to access it just as someone in the office would? Thanks in advance
  15. I'm not an expert but it looks to me that your first line is a filter that only allows certain characters to be used. Spaces are not included in web links. Could you change the path to use underscores instead of spaces? That would solve your problem. ie; http://path/to/file/Upatstvo_voip_mk_v1_5.doc
  16. I want my variable return to be made up of the value of height + a space + the value of width. Is this right? $return = '$row['height']." ". $row['width']';
  17. Hi All, I am in the middle of developing an application using WAMP. I have just been told the server it wil be running on has windows 2003 server installed and already has MS SQL running on it. I have no knowledge of MS SQL at all. This is probably a really stupid question, but could I not just move the files onto this server without installing WAMP. Is there any difference in using a different server and version of SQL?
  18. I noticed something myself in the line i mentioned. I forgot the = in the line var url = "create_object.php?g_model=" + escape(g_model) + "?g_objName=" + escape(g_objName); when i made this change i was getting a module_name value of SSa1?g_objName= when i made your change to $_GET I still got same result.
  19. I tried both of those as you suggested. Neither one showed any values. I'm nearly sure its my line var url = "create_object.php?g_model" + escape(g_model) + "?g_objName" + escape(g_objName); but i'm not sure where
  20. I gave it a try there and the two values are still showing as blank in the db.
×
×
  • 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.