Jump to content

FVxSF

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Everything posted by FVxSF

  1. If you're slow to echo from a DB it's probably the query. What's your query code?
  2. I've been looking at IonCube protection. It is a route I'd like to take to not only protect my code, but also help prevent malicious abuse ( I figure if they can't view the source it's going to be harder to hack ). My question though, is if I Cube my Code is there a way to allow people call functions that have been protected? Thanks
  3. Did you get it working yet then?
  4. so you printed out just the mime? If so that 10 should not be there at all.
  5. Ok, well I saw the screen http://www.imgx.org/public/view/full/11321 I see 10image/jpeg I don't know where the 10 came from but it should be just image/jpeg. check your database. for that entry. If you remove the 10 I think it should work.
  6. Yeah, this is a weird problem you're having. One last thing I can think about is the mime type. What is the mime? image/jpeg image/png? can you add die( $row['MimeType'] ); After $fdata = $row['FileData']; $ftype = $row['MimeType']; $fname = $row['FileName']; And post what that says. The only, last thing I can think of then is an invalid mime type... And if you posted that link to show us what's going on we can't see it since it's on your localhost. Can you post an example on the web at all?
  7. Ahhhh I think I know what it is. Take a close look at header('Content-type: $ftype'); you're tossing a variable in a set of single quotes. change the ' to " like this header("Content-type: $ftype"); Additionally you can also do this: header('Content-type: ' . $ftype);
  8. You said the image is stored in a BLOB? What's the encoding? Can you change it to BINARY? That's what's coming to my mind right now is the encoding. I could be wrong.
  9. One thing that caught my eye was "Group" GROUP is sql syntax maybe that's causing the problem? If Maq's advice doesn't work try renaming the Group field to something else. Try giving it a prefix like gr_Group or something. I had a similar problem when I first started only I had a field named Order. ** getting beaten to posting... **
  10. I don't fully understand what you're asking. But maybe GROUP BY could help? Or are you asking to also get the quantity ordered from the table? Which would be easy just add order_qty (or what ever you named the table) after products_id: SELECT products_id, order_qty FROM
  11. After $ResultMatch = mysql_query("SELECT Group FROM SubNav WHERE Parent='$Type'"); add this: if( !$ResultMatch ) { die( mysql_error() ); } This will tell you the error.
  12. Ah ok. The way you want to do it is a little more complex because you're going to have to "jump around". I'm scratching my head on this one. You know the feeling on how you know how to solve something but it's hard to explain. I'll see if I can work up an example. And if any one else reads this, I'm thinking of a foreach loop and dumping the results to an array.
  13. Well you beat me to it. I have some code to show you. I'm not sure if you wanted the second image to be so light but here's my version. The image has 100% opacity. One thing too, is since you're using PNG files you might want to change the white background of the second image to an alpha then use the imagealphablending function: Preview -> http://astuckpixel.com/subs/dev/merge/merge.php <?php header("Content-type: image/png"); // Main Image (550x250) $dest = imagecreatefrompng("sig.png"); // OverLay Image (60x74) $src = imagecreatefrompng("1.png"); //imagealphablending($src, true); // Copy and merge imagecopymerge($dest, $src, 75, 100, 0, 0, 60, 75, 100); // Output and free free from memory imagepng($dest); imagedestroy($dest); imagedestroy($src); ?>
  14. **Not no to slapdashgrim, he beat me to the post** No, SESSIONS are used for many things. They are used to track guests, page views, you can log how long people are staying at your site, security tokens, user authentication and more. When I work on my app that users inter act with, I use the session to store their User ID, User Name, Login Time, Their Power level (then match with DB) and a few other things if needed. So if the user is not logged in, you can create a variable say UserLoggedIn and have it equal FALSE if they are not or TRUE if they are. This also adds a little more security.
  15. Take a look where you placed session_start(). This might be the cause. All way stick session_start() at the top of the file. right after <?php See if that helps. Also. When you post mysql_connect() leave out the DB username and password. Don't want peps to hack yer site
  16. PHP.net has a huge list of GD function you might want to look at: http://www.php.net/manual/en/ref.image.php I believe one function you'll want to look at is the imagecopymerge() funcion http://www.php.net/manual/en/function.imagecopymerge.php
  17. You could save as an INT then once you pull it from the database you can use the php number_format() function.
  18. From my understanding your tables are all listed in one row. Like Unit No. Company FirstName LastName Email Address City State Zip Phone But you want it to look like: Unit No. - Company - FirstName - LastName - Email - Address - City - State - Zip - Phone If I understand correctly you could try/work with this <?php // Make a MySQL Connection include 'config.php'; $con = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db("vetmanpc") or die(mysql_error()); // echo "Connected to Database <br>"; // Retrieve all the data from the "lakestmill" table $result = mysql_query("SELECT * FROM lakestmill") or die(mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <title></title> <head> <link rel="stylesheet" href="./stylesheet/stylesheet1.css" media="screen"> <style type="text/css" media="screen">@import url("./stylesheet/stylesheet2.css");</style> </head> <body> <table border='1' width='300'> <tr> <th>Unit No.</th> <th>Company</th> <th>FirstName</th> <th>LastName</th> <th>Email</th> <th>Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>Phone</th> </tr> <?php while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table // I use <?= ... which is a cleaner way of saying <? echo ... ?> <tr> <td><?= $row['unit']; ?></td> <td><?= $row['company']; ?></td> <td><?= $row['firstname']; ?></td> <td><?= $row['lastname']; ?></td> <td><a href="mailto:<?= $row['email']; ?>"><?= $row['email']; ?></a></td> <td><?= $row['address']; ?></td> <td><?= $row['city']; ?></td> <td><?= $row['state']; ?></td> <td><?= $row['zip']; ?></td> <td><?= $row['phone']; ?></td> </tr> <?php } // END WHILE LOOP ?> </table> </body> </html> What I noticed is that you were using <TR> for every field. I don't know how much you know about HTML or PHP but <TR> creates a new Table Row, so by stripping out a few <TR> tags you should get the result you're looking for? Hope this helps.
  19. I'm working on an image gallery when people can upload their images, get ratings and comments and so on. Kind'a like Image Shack but not so much as an image host. My host has given their customers unlimited storage and bandwidth so I'm not worried about that. I know I have at least 600GB of space when I first signed up. Any way, what I'm worried about is a huge database. I'll be using MySQL but if my users have submitted a few hundred thousand images where the image names, descriptions, dates, comments and ratings are saved in the DB can MySQL handle that amount of data? I have never tried this, but can you use php to connect to a few databases at one? Lets say I have 3 DBs: PixDBA, PixDBB, PixDBC. Is it possible to use php and link these databases together and perform a SELECT query? Is it even wise to do that if possible?
  20. I'm working on a php interface to get some game server information. So far everything is looking really good, but there are some quirks I'm trying to fix. Let's say I want to get the players from the server. I've been using substr and strpos to get the section I need <?php $PlayerNamesRaw = substr($PlayerDCopy, strpos($PlayerDCopy, "player_"), (strpos($PlayerDCopy, "score_") - strpos($PlayerDCopy, "player_"))); ?> This seems to work well and fast but ever one in a while I get 2 "player_" but the second "player_" is wedged in the name of a player. Look below: player_�� TheGeaRGrindeR�.iNs. Zeropa�T.M.D kaaskop�=LTL= murasaki_imo� Lanimret� SpongeBucket�=HHaz= o-King� s�player_� sgtsrt� You can see it starts off player_ followed by 2 bytes. But towards the end (this is take from a longer name list) you see player_ again. But what I have noticed is that when part of the name is cut you can see the full name after player. But here's my little problem. After I remove player_ and the extra bytes and convery chr(0) to a comma I'm still stuck with that partial name. I can ususally come up with an expression to solve this.. but since I'm working with non-standard characters (those maily being chr(0)), how can I do a preg_replace and replace the data between chr(0) and player_? Going back to the provided string, how can I remove the S between o-King chr(0) AND char(0)player_ o-King chr(0) <-- REMOVE ME BETWEEN --> char(0)player_ I hope this makes since.
  21. This should be very simple. All you need to do is use the mail function built into php after the user updates. Like after the values are changed in the database. Take a look here: http://www.php.net/mail
  22. As a follow up, I did manage to fix this problem. What I saw was that there were 2 bytes padding the left and right of the player_ score_ and so on, so I what I did was explode my array based on that because if I did get a stray score_ the left padding was missing 1 byte. So to fix that what I was create an array and used str_replace to trim out what I don't what. Now that I have this fixed, I'm noticing something every now and then. Some times a letter of a name will turn out to be some random byte but if that page is refreshed it goes away. Is there a way to take the byte strings and convert them from raw upd data to something like ascii or utf8? Here is an example: http://fvxsf.com/archive/fetcher.php?ip=208.122.52.162
  23. This is a little confusing I know. I'll show you what I'm working with: <?php $sock = fsockopen("udp://". $_GET[ip], 29900); socket_set_timeout($sock, 0, 750000); $end = false; @fwrite($sock, "\xFE\xFD\x09\x01\x01\x01\00"); while( !$end ) { $bytes = @fread($sock, 1); $sock_status = @socket_get_status($sock); $length = $sock_status[unread_bytes]; if( $length ) { $reply = $bytes . fread($sock, $length); $challenge = explode("\x00", $reply); $challenge_reply = str_split(dechex($challenge[1]), 2); $sock_challenge = chr(hexdec($challenge_reply[0])). chr(hexdec($challenge_reply[1])). chr(hexdec($challenge_reply[2])). chr(hexdec($challenge_reply[3])); } if( $length == 0 ) { $end = true; } } @fwrite($sock, "\xFE\xFD\x00\x01\x01\x01\00". $sock_challenge ."\xFF\xFF\xFF\x01"); $end = false; $data = ""; while( !$end ) { $bytes = @fread($sock, 1); $sock_status = @socket_get_status($sock); $length = $sock_status[unread_bytes]; if( $length ) { $data .= $bytes . fread($sock,$length); } else { $end = true; } } fclose($sock); if( !$data ) { echo "Couldn't get info from server"; exit; } $data=str_replace("\\","",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(0).chr(0),"",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(128).chr(0),"",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(129).chr(1),"",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(129).chr(2),"",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(130).chr(1),"",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(130).chr(2),"",$data); $data=str_replace(chr(0).chr(1).chr(1).chr(1).chr(0)."splitnum".chr(0).chr(1).chr(1),"",$data); $data=str_replace(chr(0).chr(0).chr(0),chr(0),$data); $PInf = substr($data, strpos($data, "player_"), strpos($data, "team_t") - strpos($data, "player_")); $RplArray = array( // Replacement Array \\ "player_". chr(0).chr(0) => "", "score_" => "::", "ping_" => "::", "team_" => "::", "deaths_" => "::", "pid_" => "::", "skill_" => "::" ); $PInfT = str_replace(array_keys($RplArray), array_values($RplArray), $PInf); $PlayerInArr = explode(chr(0).chr(0) ."::". chr(0).chr(0), $PInfT); echo $PInf; echo "\n\n<br><br><hr><br><br>\n\n"; echo "<pre>"; echo var_dump($PlayerInArr) ; echo "</pre>"; ?> First, I don't know much about fsock but I know about bytes and so forth. After receiving the information I'm after I get the player info like this: player_� Vladiemier�=FCW= LordVaderOfFCW�=fcw= ViperTheSniper�score_��0�0�0��ping_��106�50�54��team_��2�2�1��deaths_��0�0�0��pid_��120276091�65616121�84831881��skill_��0�0�0� Now above there are byte values of 0 "chr(0)" as the serperator, there are 2 bytes after ping_ and player_ and so on, both have a value of 0, chr(0) if you will. Now this is some example of what I need to fix: pid_ chr(0) chr(0) 13294453 "chr(0)" 1�146236060 "chr(0)" �154316543� chr(0) 93162469�10 chr(0) 2633384� chr(0) 157920896 chr(0) pid_136585560� chr(0) 91831085�� I added chr(0) as the seperator, but this will happen from time to time. You can try this link -> http://fvxsf.com/archive/fetcher.php?ip=69.12.25.110 you many need to refresh until you see data. Also I changed player_ score_ and so on to :: so if you see :: that mean something like pid_ came up 2 times.
  24. Not like, "how do you make one" (well kinda), or "how do you get last item".. Here's my problem, I working on a nice little script to read server stats from a battlefield 2142 server. So far what I have is working really really good, but then I get a little quirk. For and example What I'm doing is creating an array by exploding. All the information about the server players is in one long string so what I have done is convert the identifiers to a unique group then explode based on the group say _::_ for an example. This works great because now I have all the player, pings, kills and so on in one array but every once in a while I'll get the identifier 2 time. Like below say: ping_ 54 75 25 75 kills_ 5 4 7 8 7 kills_ 6 7 5 1 Now I'm using the str_replace to replace the identifiers (in this case ping_ and kills_) but when I go to explode the players string the data get screwed up because kills_ is there 2 times. So my question is, how can I combine the 2 kills_ in to the same array?
  25. I was looking at ffmpeg, but the only down side is that I cannot restart Apache on my web server. But it's worth looking at, at home.
×
×
  • 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.