Hardwarez
Members-
Posts
37 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Hardwarez's Achievements
Member (2/5)
0
Reputation
-
[SOLVED] selecting 3 values for same item in table
Hardwarez replied to Hardwarez's topic in MySQL Help
Ok, sorry. Stupid mistake in the while loop Thanks! -
[SOLVED] selecting 3 values for same item in table
Hardwarez replied to Hardwarez's topic in MySQL Help
There is no error. It returns a single result and will not return anything else. -
I am trying to select 3 different values from a table on the same row/entry. I am using this, but it does not seem to work. Can you tell me the correct way? SELECT * FROM techwork WHERE assignstatus = '3' OR assignstatus='1' OR assignstatus ='0' ORDER BY '' DESC
-
[SOLVED] Java script not running/working with my php
Hardwarez replied to Hardwarez's topic in Javascript Help
I cought the mistake that was printing document.write("hello world"); NOT just hello world. The alert placed in the function does not come up when I defocus from the job number input box, so I know the script is not even being called.. WHY? -
Ok, new problem. I pasted some java script into my php page. The java script will not execute. I put is some obvious stuff that should execute, but it does not. At once the top I inserted document.write("hello world"); When I view the page I see document.write("hello world"); NOT just hello world. I suspect I have a misplaced character or something, I cant find. here the page code: <script language="LiveScript"> alert("java script"); document.write("Hello World!"); function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq(action) { http.open('get', 'dynamic.php?job='+action); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; /*document.myForm.email.value=response;*/ var varArray = response.split('|'); document.myForm.client.value=varArray[0]; document.myForm.descript.value=varArray[1];*/ } } function clientcheck(form) { /*.form.email.value document.myForm.email.value = varArray[0]; */ alert("Active"); if (form.jobnumber.value !=""){ sndReq(form.jobnumber.value); } } </script> <?php echo "<html><head><title>Stanger Surveying LLC Technician Management System</title> </head>"; // BEGIN PHP //**************************************************************************************************************** //JAVA NOTE: setTimeout(window.open("http://66.76.55.66/joblist/index.php"),5000); $user = "X; $password = "xxx"; $database = "G"; $host = "localhost"; $link = mysql_pconnect($host, $user, $password); mysql_select_db("stanger") or die(mysql_error()); //******************************************************************************************************** // INCLUDES //******************************************************************************************************** //********************************************************* // MAIN BODY //********************************************************* echo '<style type="text/css"> html, body { height: 100%; } #container { min-height: 100%; position: relative; } #header { margin:0; padding:0; background-color:gray; color:white; z-index: 3; } #nav { position: absolute; top:37px; float:left; width:100%; height: 400px; float:left; margin:0; padding:0; border-left:1px solid gray; z-index: 3; } #footer { height: 10px; width: 100%; position: absolute; top:59px; margin:0; padding:0; background-color:gray; color:white; z-index: 3; } #content { position: absolute; top:80px; } </style>'; //=================================MAIN CODE============================================== echo 'document.write("Hello World!");'; $user=$_GET['user']; $user=mysql_real_escape_string($user); echo '<div id="container"> <div id="header"><h1 class="header">Jobs In Progress</h1></div> <iframe src="http://66.76.55.66/tech/progress.php?user='.$user.'" width="100%" height="130px"></iframe> <div id="header"><h1 class="header">Request Technician Work</h1></div> <div style="position:relative; font-size:16px; top:0; left:0; z-index:1;"> <form name="myForm"><B>Job Number: </b><input type=text name="jobnumber" value="" onBlur="clientcheck(this.form)"> <B>Client Name: </b><input type=text name="client" size=60 maxlength=100><BR><b>Description:  </b><input type="text" size=101 maxlength=100 name=descript></form> </div> <div style="position:relative; top:-14; left:5; color:red; font-size:16px; z-index:2"> Layer 2 </div> '; mysql_close($link); //Close data base!!!!!!!! echo "</body></html>" ?> What this should be doing is getting data from a php page when you tab out of job number and the client and description fields of the form should be filled in. However the script is not running at all.. Please help!
-
[SOLVED] How do I pass two variables from php to java script?
Hardwarez replied to Hardwarez's topic in Javascript Help
Never mind I got it. I was using a split that I pasted in from somewhere else. Thank you for your help!!!!!!!!!!!!!!!! -
[SOLVED] How do I pass two variables from php to java script?
Hardwarez replied to Hardwarez's topic in Javascript Help
Ok I am getting the data I wanted however the problem I seem to be having is splitting the two variables out. How to I access each var? Here is the code I have now: <script language="LiveScript"> function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq(action) { http.open('get', 'dynamic.php?job='+action); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; /*document.myForm.email.value=response;*/ var varArray = xmlHttp.responseText.split('|'); document.myForm.email.value=varArray[0]; /*document.myForm.email.value=varArray[1];*/ } } function emailcheck(form) { /*.form.email.value document.myForm.email.value = varArray[0]; */ if (form.email.value !=""){ sndReq(form.email.value); } } </script> <?php echo '<form name="myForm"><B>Enter your Email address :</b><BR> <input type=text name="email" value="" onBlur="emailcheck(this.form)"> <BR></form> '; ?> It should return the first of two vars into the form I typed in, but it does not -
[SOLVED] How do I pass two variables from php to java script?
Hardwarez replied to Hardwarez's topic in Javascript Help
This is the code I have set up to test with. Please tell what I am doing wrong. It returns undefined in the text box. <script language="LiveScript"> function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq(action) { http.open('get', 'dynamic.php?job='+action); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); document.getElementById(update[0]).innerHTML = update[1]; } } } function emailcheck(form) { /*.form.email.value */ var thing; thing=sndReq(form.email.value); document.myForm.email.value = thing; } </script> <?php echo '<form name="myForm"><B>Enter your Email address :</b><BR> <input type=text name="email" value="" onBlur="emailcheck(this.form)"> <BR></form> '; ?> -
[SOLVED] How do I pass two variables from php to java script?
Hardwarez replied to Hardwarez's topic in Javascript Help
I barely know what AJAX is. I do not seem to be able to make this work. -
Ok, I need to read data from a from text field when the user tabs or clicks out of the box then I need to submit that data to a php page and get two returned values from that page then I need to take that data and fill in two of the text fields in the form automatically. Can anyone tell me how to use java script to do this? Example of what I want to happen: User enters name then tabs or clicks to next element in form. Script reads first field then calls php, which searches database for that name. If that name is found the php page will return two other strings like address and phone number. The java script needs to automatically fill in the two text fields, address and phone in the form IF data is returned.
-
I wanted to list several things in buttons that span the entire frame. The problem is the image of the button splits when the text is to long and making the image wider just causes the ends of the image to disappear. CSS: <style type="text/css"> a.squarebutton{ background: transparent url(\'square-blue-left.gif\') no-repeat top left; display: block; float: left; font: normal 14px Arial; /* Change 12px as desired */ line-height: 15px; /* This value + 4px + 4px (top and bottom padding of SPAN) must equal height of button background (default is 23px) */ height: 23px; /* Height of button background height */ width: 100%; padding-left: 4px; /* Width of left menu image */ text-decoration: none; } a:link.squarebutton, a:visited.squarebutton, a:active.squarebutton{ color: #494949; /*button text color*/ } a.squarebutton span{ background: transparent url(\'square-blue-right2.gif\') repeat top right; display: block; padding: 4px 9px 4px 0; /*Set 9px below to match value of \'padding-left\' value above*/ } a.squarebutton:hover{ /* Hover state CSS */ background-position: bottom left; } a.squarebutton:hover span{ /* Hover state CSS */ background-position: bottom right; color: black; } .buttonwrapper{ /* Container you can use to surround a CSS button to clear float */ overflow: hidden; width: 100%; } </style> PHP: $temp = 'our cool button that is really a link . blah blah blah bla ect ect ect ect ect ect gfd g dfg fksdfasdfsdf asdf sd fsd fsd sdf'; echo ' <div class="buttonwrapper"> <a class="squarebutton" href="http://www.google.com"><span>'.$temp.'</span></a> </div> <div class="buttonwrapper"> <a class="squarebutton" href="#"><span>Submit</span></a> <a class="squarebutton" href="#" style="margin-left: 6px"><span>Reset</span></a> </div>';
-
PHP ImageJpeg function will not work if I call mysql commands
Hardwarez replied to Hardwarez's topic in PHP Coding Help
It would seem that my sql query was incorrect. I was trying to limit the returned results to 30, but it seems that Idont know how to do that. Removing the LIMIT part of the query lets the immage display. -
PHP ImageJpeg function will not work if I call mysql commands
Hardwarez replied to Hardwarez's topic in PHP Coding Help
If I comment out the header() then I can see the image data and it is infact starting with a sql error here are the first 8 lines of the data: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in test.php on line 83 ÿØÿà�JFIF������ÿþ�>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛ�C� $.' ",#(7),01444'9=82<.342ÿÛ�C 2!!22222222222222222222222222222222222222222222222222ÿÀ�4"�ÿÄ����������� ÿÄ�µ���}�!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ�������� ÿÄ�µ��w�!1AQaq"2B‘¡±Á #3RðbrÑ -
PHP ImageJpeg function will not work if I call mysql commands
Hardwarez replied to Hardwarez's topic in PHP Coding Help
I tried moving the header() to the bottom just before the imageJpeg() function. Same error :-\ A command like $number = mysql_num_rows($result) should not output anything to the document.