
de.monkeyz
Members-
Posts
105 -
Joined
-
Last visited
Never
Everything posted by de.monkeyz
-
It wasn't because the php was separated per-say. It was because their were line breaks in between the opening and closing php tags, which are output. So that output was contributing to the final final binary of the image, thus corrupting it.
-
Exiting and entering php like that for no reason could be the reason, change it to this: <?php ini_set("display_errors", "1");error_reporting(E_ALL); require_once('Connections/dbConnect.php'); $MyDetails_find = $OO_Secure->newFindCommand('Members'); $MyDetails_find->AddFindCriterion('MemberID',$_SESSION['memberid']); $MyDetails_result = $MyDetails_find->execute(); if(FileMaker::isError($MyDetails_result)) fmsTrapError($MyDetails_result,"error.php"); $MyDetails_row = current($MyDetails_result->getRecords()); // FMStudio v1.0 - do not remove comment, needed for DreamWeaver support $filePath = $MyDetails_row->getField('ImageURL'); //$filePath = 'ajktest.png'; header('Content-type: image/png'); header('Content-length:' . filesize($filePath)); echo file_get_contents($filePath); Notice I even removed the final ?> which is valid and prevents any accidental output after the php
-
Select onchange should refresh page and pass variable
de.monkeyz replied to tinmanjim's topic in Javascript Help
action="self" is not valid. It will try to point to the file called "self". If you want a form to submit to the page it is on. use action="". A blank action submits to itself. -
It may be a security issue if that is what is happening. Does the image HAVE to be outside of your server root?
-
With Flash embeds, there is usually 2 defines to the url of the swf file. On in the embed, and one inside a <param> tag I believe, or the object tag.
-
I CANT UNDERSTAND Y THIS IS NOT WORKING CAN ANY1 HELP? PLZ
de.monkeyz replied to mattm1712's topic in PHP Coding Help
Where's $t defined? -
HELP! going crazy trying to figure this out!
de.monkeyz replied to mattsutton1457's topic in PHP Coding Help
Using recursion would be the best way I think, so I'm just gonna show you a pseudo function, hopefully you can figure out the sql yourself: function showMap($parent_id = 0) { $query = "SELECT * FROM table WHERE parent_id = '$parent_id'"; $result = query($query); if(num_rows($result) == 0) return; while($row = fetch_assoc($result)) { echo $row['title']; //Do any sort of formatting here showMap($row['id']); //Find child elements } } That function using recursion will go as deep into the structure as neccessary -
Well you shouldn't be repeating <html> tags and so on. But the issue itself is because the url of the swf is wrong. When you view the file separately it works because the swf is in the same directory, but this is not the case when it is located in the other file, you have to change the url to the swf to /flash/main.swf
-
If view source is only showing that, the png image seems to be empty. That I THINK is just the binary code of the start of any png (I just tried the code with my own png and it showed that at the start). Since there should be A LOT more output than that This is the type of output you'd have
-
Well it seems to be grabbing the image data correctly then. So there's no other output occurring on this page except the image output? Including <html> and <head> tags, just to make sure. (Try viewing source in your browser)
-
If you comment out the headers temporarily. Does it echo out gibberish (i.e the binary for the image)? Or are there some errors in there too?
-
It'd be helpful to know what's in /flash/main.html. Also, you're echoes are unneccessary, and you are trying to append include, which isn't what you should be doing: <div id='content'> <div id='flash1'> <?php include('flash/main.html'); ?> </div> <p> a whole bunch of text here </p> </div> That works fine. If you don't need to echo it out dynamically, just enter it as normal html.
-
header('Content-length' . filesize($filePath)); You're missing the : after Content-length
-
You can use a shorthand for that and use file_get_contents: echo file_get_contents($filePath);
-
Select onchange should refresh page and pass variable
de.monkeyz replied to tinmanjim's topic in Javascript Help
How does the PHP script get the number normally? Does it use a $_GET or $_POST? A simple solution would to make the form that the select is contained in submit on change, for example if you have the forms id of "myForm" and the select was an id of "category_id" document.getElementById('category_id').onchange() { document.getElementById('myForm').submit(); } -
That code alone works perfectly fine for me. Can you post more of the code you're actually using? Since I'm sure there's a certain reason why it's not working, and not that it just doesn't work at anytime Edit: Oh right. Problem solved.
-
Using that code won't work GB_001. They are trying to change the favicon for the page, not an <img /> tag. I recommend you look at this: http://ajaxify.com/run/favicon/ Should be a quick solution for you It also seems that changing the favicon dynamically in JavaScript will only work for Firefox and Opera (maybe Chrome too). But I know IE and Safari do not support it.
-
A blank string and NULL are completely different. They both return true in empty() but they are different types. NULL has no data type. In MySQL you should either keep them all as NULL or all as a blank string. Using a blank string is easier to manage with PHP in my opinion
-
Single quotes with no data inside them in PHP is an EMPTY string. empty() will return true for ''
-
You don't want to do a "do" loop, a normal while is needed, otherwise $row_name will be null the first time. We can do it 2 ways, either use a while with a counter, or a for loop. I'll give the for loop example: for($i = 1; $row_name = mysql_fetch_assoc($name); $i++) { echo "Number $i Here" . $row_name['name'] . "<br />"; }
-
Good ol' whitespace. Gotta love it, the cause of 100% of invisible errors.
-
There MAY be whitespace in the string, causing the problem. What happens when you try to do this: if(trim($type) == "place")
-
If it's mySQL you should check your database table. Try to manually enter the data in something like phpMyAdmin, it should give you a more verbose output if anything is going wrong.
-
Could I see a snippet of the xml file?
-
What happens when you echo out your query in php? Is the trailing 0 still there? And is the datatype of the database a number, or VARCHAR?