Jump to content

dlebowski

Members
  • Posts

    262
  • Joined

  • Last visited

Everything posted by dlebowski

  1. $account="54646456456464"; $station= "12345"; $options="11-1"; $image="C:/Desktop/Sample Images/usco1.jpg"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://dfdgfsfs.com/kgdfgd.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'image' => '@'.$image, 'account' => $account, 'station' => $station, 'options' => $options)); $postResult = curl_exec($ch); curl_close ($ch); $xmlobj = simplexml_load_string($postResult); echo (string)$xmlobj->ID->attributes()->value; echo (string)$xmlobj->FullName->attributes()->value; All, I have spend days trying to figure this out without any luck. I am now in crisis mode. I need to get this working asap. The following code works perfect on my local xampp machine. As soon as I upload it to my web server, I don't get any data back. I have narrowed it down to the image i am trying to send is not being received properly. Thanks in advance.
  2. I understand. I wasn't trying to just tell you "bits at a time". I thought I could figure it out if I had the first part of my question answered. I'm not able to. So what you see in this post is the whole story. Any help would be appreciated. Thanks.
  3. Thank you for the reply! What if I want to specify whether I start with "0" or "100" as my starting point? AND I only wanted it for a certain date. So for example: If I start with "0" and date of 2012-11-15, the next available number is: 3. If I start with "101" and date of 2012-11-15, the next available number is: 103. Also, what if my table looked like this: LotNumber Date 1 2012-11-15 2 2012-11-15 3 2011-10-12 4 2012-11-15 5 2012-11-15 6 2012-11-15 7 2012-11-15 100 2012-11-15 102 2012-11-15 103 2011-10-12 104 2012-11-15
  4. Ok. I have spent a couple of days on this and have had no luck figuring it out. It seems easy enough, but apparently i'm not smart enough to figure it out. Anyway, here is what I want to do: Table "lots" has the following column: LotNumber 1 2 4 5 6 7 100 102 104 Here is my code: $j = mysql_num_rows($res); $i = 0; while ($i++ < $j and mysql_result($res, $i - 1, 0) == $i); This code works great if I need the next available number starting from "0". That value would be "3". But lets say I want to get the next available number starting at 100. How do I do that? For example, the next available number after 100 is "101". I can't get it to do this for me. Any help would be appreciated. Thank you in advance. Ryan
  5. theyear is just a javascript variable that will be used in a function. And when the results are returned, the variable doesn't change. I don't get any errors or anything in firebug. The variable just doesn't change at all. Is that what you were asking me. Thank you for helping me out. Ryan
  6. Any help with this would be greatly appreciated! When I use "response[0].Data" to assign a value to innterhtml, it works great. If I try to assign the value to a javascript variable (theyear = response[0].Data1;), it doesn't assign it. How do I do this? Thank you for your help! Here is the value: [{"Data":"3025.00","Data1":5}] var theyear; function runPost(thedate, thelotnumber, myid) { $jq.post("current.php?q="+moreurl, { data: thedate, data2: thelotnumber, data4: myid }, function(response, status) { document.getElementById("thecurrent").innerHTML = response[0].Data; theyear = response[0].Data1; }, 'json');
  7. Okay. I'm getting closer. Here is my code: var date1, date2, sec, hours, min; window.onload = function () { //MM/DD/YYYY HH:MM:SS PM or AM date1 = new Date("04/12/2011 07:14:00 PM"); date2 = new Date("04/12/2011 07:14:20 PM"); sec = (date2.getTime() / 1000.0) - (date1.getTime() / 1000.0); hours = parseInt(sec / 60 / 60); sec = sec - hours * 60 * 60; min = parseInt(sec / 60); ses = sec - min * 60; calc(); } function calc() { if (hours<=0&&min<=0&&sec<=0) { alert("cool"); } else { sec--; var day=Math.floor(hours/(60*60*1000*24)*1) day.innerHTML = day; hrs.innerHTML = hours; mins.innerHTML = min; secs.innerHTML = sec; setTimeout("calc()", 1000); } } All I need to do now, is just have the hours become days if they are more than 24. For example if hours are 25, this is what it would look like: 1 days 1 hours 1 minute 10 seconds Current it does this: 25 hours 1 minutes 10 seconds Again, any help would be great. Thank you.
  8. I want to be able to take two dates with times and want to show a realtime countdown. I need it to be to the second. For example: Start: Year: 2012 Day: 09 Month: 12 Hour: 10 Minute: 12 Second: 35 End: Year: 2012 Day: 09 Month: 12 Hour: 10 Minute: 13 Second: 45 Displayed: 0 days 0 hours 1 minute 10 seconds I want this countdown realtime on the screen. So far, all of the scripts I have found have been to the minute and also used the client sides clock to determine the countdown. I just need it to countdown in seconds and utilize to specified dates and times. Any help with this would be awesome. Thanks in advance.
  9. I understand what you posted, I'm looking through the php.ini files and comparing them and there is nothing in the MYSQL section that is different. Anyway, I will see what else I can come up with. Thank you. Ryan
  10. If i do that, it WILL work. I am just concerned because I didn't want to have to modify all these scripts to make sure it works. I was hoping I could figure out what is different on this server as oppose to my old one. Ryan
  11. This is how I connect: include("dbinfo.inc.php"); mysql_connect($myserver,$uname,$pword); @mysql_select_db($database) or die( "Unable to select database");
  12. View source displays nothing. What is wierd, is that it works on the other server. I took your advice, and removed the "mysql_real_escape_string" and it works now. So, that is definitely the problem. So, is there a setting in my PHP config that is affecting this on my new server? Thank you for your quick replies. Ryan
  13. This is literally all that is on this page: My URL: myurl.com/editlot.php?LotID=100121361 <? print $LotID=mysql_real_escape_string( $_GET['LotID']); ?> It won't output anything to the screen.
  14. I moved my application to a new server with a new install of PHP. Anyway, some of my "mysql_real_escape_string( $_GET['ID'])" requests work, some do not. Does anyone know why this would be? It works fine on my old server. Thank you. Ryan
  15. Hello. I am not a java expert and therefore do not understand why I keeping getting NaN for the total on this? I understand that it is saying I am trying to add "non-number", but I can't figure out why this won't work. Any help would be appreciated great. Thanks <script type="text/javascript"><!-- function updatesum() { var elems = document.getElementsByClassName('toAdd'); var myLength = elems.length, total = 0; alert(myLength); for (var i = 0; i < myLength; ++i) { total += elems[i].value - 0; } document.getElementById('sum').value = total; } //--></script> <body> <div class="toAdd"> Enter a number: <div><input id="Quantity[0]" onChange="updatesum()" /></div> and another number: <div><input id="Quantity[1]" onChange="updatesum()" /></div> </div> Their sum is: <input id="sum" readonly style="border:0px;">
  16. I need to take this a step further. I can actually get it to run using mysqldump, but my DB server is independent of my web server. I need this file that is created on my DB server in "/home/stuff/wwwroot/stuff/appnew/backup/" to actually be put in a directory on my web server. How would I do that? Thank you for the reply.
  17. Any help on this would be greatly appreciated. I am trying to run a mysqldump from my site for my client when they want to back up. They basically will jsut click a button to run the backup. With my script below, the backup file is genrated, but there is no table data in the file. There are the headers in the file with the server IP, linux versin, etc..., but there is no data in the file. Does this look right? Thank you for helping me out. Ryan ini_set ("display_errors", "1"); error_reporting(E_ALL); $dbhost = 'localhost'; $dbuser = 'databaseuser'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'database'; mysql_select_db($dbname); $tableName = 'lots'; $backupFile1 = '/home/stuff/wwwroot/stuff/appnew/backup/'; $backupFile = $backupFile1.$dbname . date("Y-m-d-H-i-s") . '.gz'; $command = "mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname | gzip > $backupFile"; system($command); $result = mysql_query($command);
  18. Hi. I have a table that looks like the following: +------+---------------+ | Price | ItemNumber | +------+---------------+ | 1 | 33 | | 2 | 66 | | 3 | 66 | | 4 | 44 | | 5 | 44 | | 6 | 44 | +------+--------------- What I want to do is takes the highest Price for each ItemNumber, and sum those values. For example: 1 - 33 3 - 66 6 - 44 --------- Total: 10 I am assuming that I am going to use MAX function and SUM, but how do I use both. Here is my query: SELECT MAX(Price), ItemNumber FROM mytable GROUP BY ItemNumber ORDER BY ItemNumber This query gives me this: 1 - 33 3 - 66 6 - 44 --------- So how do I use that same query to give me a SUM of those values? Than you in advance!
  19. Below is my image upload and resize script. The issue I am running into is when an image is wider than 800px (i'm not even sure how much wider, i just know that an image that is 800px wide will upload, but larger ones won't). Anyway, is there a "dimension limit" on images when using "imagecopyresized"? Thank you for your time? $uploaddir3 = "/my/server/path/coname/images/"; $thumbDirectory3 = "/my/server/path/test"; $thumbWidth3 = "640"; $target_encoding3 = "ISO-8859-1"; echo '<pre>'; if(count($_FILES) > 0) { $arrfile3 = pos($_FILES); $uploadfile3 = $uploaddir3 . iconv("UTF-8", $target_encoding3,basename(strtoupper($arrfile3['name']))); if (move_uploaded_file($arrfile3['tmp_name'], $uploadfile3)) echo "File is valid, and was successfully uploaded.\n"; $imageName3 = basename(strtoupper($arrfile3['name'])); function createThumbnail3($uploaddir3, $imageName3, $thumbDirectory3, $thumbWidth3) { $srcImg3 = imagecreatefromjpeg("$uploaddir3/$imageName3"); $origWidth3 = imagesx($srcImg3); $origHeight3 = imagesy($srcImg3); $ratio3 = $thumbWidth3 / $origWidth3; $thumbHeight3 = $origHeight3 * $ratio3; $thumbImg3 = imagecreatetruecolor($thumbWidth3, $thumbHeight3); imagecopyresized($thumbImg3, $srcImg3, 0, 0, 0, 0, $thumbWidth3, $thumbHeight3, $origWidth3, $origHeight3); imagejpeg($thumbImg3, "$thumbDirectory3/$imageName3"); } createThumbnail3("/my/server/path", "$imageName3", "/my/server/path/coname/images/test", $thumbWidth3); } else { }
  20. Hi all. I have a PHP application that appears to slow down when there are many simultaneous connections to the same PHP file. I want to do some load testing on it. Does anyone recommend a load testing program? Thank you.
  21. Hi. Using the example below, I want to be able to make one call to a PHP file, but have it update multiple DIVS. For example, if I have <div id="txtHint"</div> and <div id=""txtHint2"></div>, I want to be able to make one AJAX request to a PHP file, grab two values out of MYSQL and update multiple DIV's. Does anyone know if this is possible? Thank you for your time! HTML: <html> <head> <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?q="+str,true); xmlhttp.send(); } </script> </head> <body> <form> <select name="users" onchange="showUser(this.value)"> <option value="">Select a person:</option> <option value="1">Peter Griffin</option> <option value="2">Lois Griffin</option> <option value="3">Glenn Quagmire</option> <option value="4">Joseph Swanson</option> </select> </form> <br /> <div id="txtHint"><b>Person info will be listed here.</b></div> </body> </html> PHP: <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'peter', 'abc123'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ajax_demo", $con); $sql="SELECT * FROM user WHERE id = '".$q."'"; $result = mysql_query($sql); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> <th>Hometown</th> <th>Job</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "<td>" . $row['Age'] . "</td>"; echo "<td>" . $row['Hometown'] . "</td>"; echo "<td>" . $row['Job'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?>
  22. I want to change the SELECT value based off of a javascript variable value. For example, I want var myvariable = NULL; If myvariable = ONLINE do this: <label class="solddropdown" style="display: none;"> <select id='onlineonsite' style="font-size: 10px;"> <option value="ONLINE" SELECTED >ONLINE</option> <option value="ONSITE" >ONSITE</option> </select> </label> else If myvariable = ONSITE do this: <label class="solddropdown" style="display: none;"> <select id='onlineonsite' style="font-size: 10px;"> <option value="ONLINE" >ONLINE</option> <option value="ONSITE" SELECTED >ONSITE</option> </select> </label> Any help on this would be greatly appreciated! Thank you.
  23. What I want to be able to do is this: If I have a list of values in my database: 1 13 26 15 12 4 I do a query of this database and sort it asc so it looks like this: 1 4 12 13 15 26 I want to know how I can use php and/or sql query to find these values based off of "position" in the list. If I wanted the 3rd value in the list, that value would be 12. If i wanted the 2nd value in the list it would be 4. How would I go about doing this? Thank you in advance.
×
×
  • 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.