Jump to content

rathfon

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rathfon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=378970:date=Jun 1 2006, 03:21 AM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ Jun 1 2006, 03:21 AM) [snapback]378970[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] if(mysql_num_rows($result) == 0 ) {   echo "No Rows Found"; } [/code] [/quote] Thank you, don't know how I missed that.
  2. Ok, I've got the query working fine, it is to find the row in the table and then displays the data. Well, if I give it something it can find it displays what I need and works perfectly. But if I give it something it can't, it won't return an error (obviously because the query worked fine, just couldn't find anything to return), so how do I go about handling that? [code]$link = mysql_connect($db_server, $db_user, $db_password) or die("Could not connect."); mysql_select_db($db_name) or die("Could not select database."); $query = "SELECT * FROM images WHERE idnumber=('$id')"; $result = mysql_query($query) or die("Oops, a no go."); while ($line = mysql_fetch_assoc($result)) { // all that other stuff, above and below[/code] Like I said, works perfectly it's just I want to be able to handle when it doesn't find anything. I tried echoing the $result after it looks for $id that it won't find, but it just gives me "Resource ID #2."
  3. Try setting the quality in the imageJPEG? Hm.. Lemme know. Like: ImageJPEG($destimg,$dest_path.$dest_image_name, 100)
  4. [code]<?php require 'calinc.php'; $searchstr = $_POST['initials']; function displayadds($result) { print "<center><h1>Your Results</h1></center>"; print "\n<TABLE>\n<tr>\n" . "\n\t<th><b>School Name</b></th>" . "\n\t<th><b>Location</b></th>" . "\n\t<th><b>Date</b></th>" . "\n\t<th><b>Time</b></th>" . "\n\t<th><b>Number Working</b></th>" . "\n\t<th><b>Notes</b></th>" . "\n</tr>"; while ($row = @ mysql_fetch_row($result)) { print "\n<tr>"; foreach($row as $data) print "\n\t<td> {$data} </td>"; print "\n</tr>"; } print "\n</table>\n"; } $query = "SELECT SCHOOL, LOCATION, DATE, TIME, NOWORK, NOTES FROM calendar WHERE SB1 LIKE '%$searchstr%' or SB2 LIKE '%$searchstr%' or SB3 LIKE '%$searchstr%' or SB4 LIKE '%$searchstr%' or SB5 LIKE '%$searchstr%' or SB6 LIKE '%$searchstr%' or SB7 LIKE '%$searchstr%' or SB8 LIKE '%$searchstr%' or SB9 LIKE '%$searchstr%' or SB10 LIKE '%$searchstr%'"; if (!($connection = @ mysql_connect($hostname, $username, $password))) die("Unable to Connect"); if (!(mysql_select_db($databaseName, $connection))) showerror(); if (!($result = @ mysql_query ($query, $connection))) showerror(); displayadds($result); ?>[/code] First of all, you can use HTML in PHP files it is used the same way, so all those 'prints' are unnecessary. As far as I can tell, without running it, I see that you are slapping the results into a few tablerows. If you could take a picture of the results you get, and specify what you don't like about it, that'd be great and I could help you a lot easier if I knew what you wanted. If you don't have a host for files just upload here [a href=\"http://www.rathfun.com\" target=\"_blank\"]rathfun[/a].
  5. Well, I'm assuming it catches the "page requests" so if you have the dual frames like that, and type that into the bar and hit "Go" on the frame -- it will send out the request for that URL and yes, they can still log that. If your connection runs through/from that server, they can see anything they want (concerning data coming/going). Sorry. I did that once in highschool last year. I made a page with javascript exactly like you are speaking of, because we could only have windows open with a certain title (eg. "Cisco"). So I made the <title> Cisco. All was well, until they kicked me out of that class for a browser I had made, they called it 'hacking.' Horrible school. Principal told me, "We had our techs analyze it and it is exploiting the network and the whole network is at risk."
  6. [code]<?php // Include init file include "init.php"; //$md5 = md5($_GET['hash']); //$base = base64_decode($_GET['stamp']); $sql = "UPDATE users SET status='0' WHERE password='0b78601ab862c0c13becef26327f4f9c' AND timestamp='1149021727'"; // And lastly, store the information in the database mysql_query ($sql) or die(mysql_error()); // ?>[/code] Try that and let me know what error it gives.
  7. Well, first of all, how does process.php know that the text file is ready to be opened (read: finished)? or do you have it set to open the file after a certain amount of time? You might be able to set up a middle-man page that checks for.. I suppose the 'existance' of the certain text file, and then wait's atleast 10 seconds if it's not found, then looks again (while displaying 'Loading' or whatever you may want). The external program, hopefully written by you, or having the possibility to be modified should be set to hold the data in it's buffer then to write all the data to the textfile at once if you happened to use the check for the existance of the file method I just specified so it doesn't open the file mid-write. I'm not that experienced with external program use and PHP, so I might just be totally wrong on this. But I'm sure there is someone else here who could help.
  8. I'm new here, so please excuse me if I happen to do something wrong at first, I'll learn. I run a file host and am re-writing the scripts to maintain ease of use for myself and the users. Now I am using header() to display the files, and I have noticed that without applying header('Content-type:whatever') that in some browsers, the file is not recognized as the right format. But if I apply: [code]header('Content-type: application/octet-stream'); header('Content-Disposition: inline; filename=realFile.exe'); readfile($theFileURL);[/code] it works correctly. [b]But my question is:[/b] can I just use application/octet-stream for all file types (exe, jpg, bmp, zip, anything) and have it work correctly with all of them? I tried: [code]header('Content-type: application/octet-stream'); header('Content-Disposition: inline; filename=realFilename.jpg'); readfile($thefileURL);[/code] and it worked correctly, displaying the image and all. In IE, firefox, and Opera. So I am wondering whether I need to make it so it does define the correct mime-type for all the file types or if I can just use the application/octet-stream for all of them? Oh yes, and with Content-Disposition, can anyone clearly explain the difference between using 'inline' and 'attachment' to me? I have noticed that using 'attachment' usually steers more towards having to download the file, but can I just use 'inline' for all files because it seems to work correctly (tested in IE, Firefox, Opera)? Please excuse the long first post, but it's late and I'm just trying to get a few problems out of the way. Thank you in advance. Edit: I just realized I stated that I tried using the method and it worked, and yet I still come here and ask questions about it. But I'm wondering if you think it will work with stability or if it just doesn't seem like a good idea in general?
×
×
  • 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.