-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Reading Image Code And Storing In Database
PFMaBiSmAd replied to N-Bomb(Nerd)'s topic in PHP Coding Help
It would help if you posted the whole actual code that reproduces the problem (perhaps there is a bug in the mysqli prepared functions and someone could help you by actually reproducing or not reproducing the problem on a different system.) You are apparently using functions and could have a variable scope problem, the variable name you are using is changing at some point in your code, and I know of at least one case where using an array variable in a bind_param() statement that did not work. The out of context snippets of code don't actually help when you have a 'page of code' that does not do what you expect. And for the code you will post, are you still getting all but the image data being inserted into your database table and you know for a fact that you are not looking at an old row of data from some previous testing? Also, please post the database table definition. Edit: and also, what operating system/version, what php version, is php running as a server module or as a CGI application, and what mysql server version? -
Thank you. For output started on line one of your main file, please read the last reply in this sticky post - http://www.phpfreaks.com/forums/index.php?topic=37442.0 You need to save the file without the BOM characters. Your programming editor will either have a choice in the 'file save as' menu or it will have a choice in a character encoding menu.
-
The error message, which you didn't post, states where the OUTPUT is occurring at that is causing the problem. The solution is to find and eliminate that output so that the header() statement will work. If you want us to directly help, you will need to post the error message.
-
MOVED: Unable to transfer variables between two files !
PFMaBiSmAd posted a topic in PHP Coding Help
This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=343041.0 -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
Are you using a word processor to edit the files? There is something YOU are doing that is causing basic and commonly used php operations to fail. The code you posted is a purchased script. Is there some reason you have not contacted the Author for help? Perhaps he has seen this problem before and could directly help with what is causing the problem. Given that the script is a 3rd party purchased script, moving this thread to that forum section... -
LOL, virtually identical to what mjdamato posted ^^^ <?php $checkboxes = array('fact-sent','fact-payed','domain','content','design-sent','design-approved', 'design-sliced','temp-website','temp-website-sent','temp-website-approved','cms','seo','analytics', 'webmaster-tools','website','website-online'); // list of fields that are checkboxes and the order to present them in the form while ($row = mysql_fetch_array($result)){ echo "<form name='checkbox_form'><tr><td class='customer'>{$row['project']}</td><td class='customer'>{$row['customer']}</td>"; foreach($checkboxes as $key){ echo "<td class='data'><input type='checkbox'" . ($row[$key] == true ? " checked='checked'" : NULL) . " /></td>"; } echo "</tr>"; } ?>
-
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
The code is including core.php and core.php is including common.php (based on the last error message you posted.) The next most likely problem is that in your common.php file, the name BASEPATH has been corrupted. I would delete and then re-type BASEPATH to see if that corrects the problem. Delete and re-type the white-space before and after BASEPATH as well. -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
The code you posted works for me. Again, the most likely problem is that your actual $_SERVER['DOCUMENT_ROOT'] value is a URL (http://something) so that the files are being included/required through a URL instead of through the file system. Echo $_SERVER['DOCUMENT_ROOT'] in the index.php file to see what it is. -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
Without actual code to test with that reproduces the problem, sorry, but you cannot be helped. Why are you not cooperating when someone is trying to help you? You are doing something in your code on your server that does not work and you want someone who is not standing right next to you to help you troubleshoot what your code is doing, but without actually having enough of the code that reproduces the problem. This is like you have a dead battery in your car and someone stopped to give you a jump start and you refuse to open the hood of your car. I'm going to make a wild guess. You originally had the paths hard-coded into your logic and have just recently added the defined constant, but the core.php file never got edited/saved to the correct actual folder so it does not have the define() statements in it but the files that are being required did get edited/saved to the correct actual folder, so they are attempting to reference the defined constant, but the file where the defined constant should be at is the old code without the defined constant. -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
Finally, at least that eliminates the $_SERVER['DOCUMENT_ROOT'] variable as the cause of the problem. At this point, you would need to post enough of your code that duplicates the problem (if the exact code you post does not duplicate the error, don't waste time posting it) if you want someone to help further and is there any chance you have multiple include/core.php folders/files at different starting paths, some with and some without the define() statements and you might be including the wrong one? Also, why are you using require_once instead of require (php has had a number of bugs in the _once versions)? -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
That doesn't show us what the $_SERVER['DOCUMENT_ROOT'] value is so that someone could actually determine if it is the cause of the problem. -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
You have yet to provide us with any information that identifies where the problem is occurring at. 'most likely' means something is at the top of the list. It does not mean that is the cause of the problem. -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
What exactly would that value be, because it's the most likely reason for the problem you are having (i.e. including a file using a URL/URI instead of a file system path)? -
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
You can echo $_SERVER['DOCUMENT_ROOT'] to see what it is. -
Interestingly, I just discovered that using mysqli prepared statements would (supposedly, if it works) let you send blob data in packets by specifying the 'b' type in the bind_param statement - Retrieving that data in packets/chunks would apparently be up to you.
-
Unable to transfer variables between two files !
PFMaBiSmAd replied to etdsbastar's topic in Third Party Scripts
There's nothing technically wrong what what you are doing (just tested.) Are you sure $_SERVER['DOCUMENT_ROOT'] is actually what you think it is (a file system path)? Perhaps someone either mis-configured your virtual host or intentionally set it so that it actually contains the URL to your domain root? -
Your code is apparently (it's actually difficult to follow what your code is doing) trying to pass the record number through the links, not a page number. That would be called record-ination not pagination. I recommend that you read this tutorial - http://www.phpfreaks.com/tutorial/basic-pagination
-
How are you calling and testing the return value from the validate_email function (I only ask because we see every possible kind of good and bad code here)? Perhaps it is inside some conditional logic that is possible to bypass based on external values or something like register_globals being on or the return value isn't actually being tested or some of your code is in an include file that is possible to request directly, thereby bypassing some of the logic. These are just a few of the things I came up with off of the top of my head. A hacker with more time on his hands can come up with a lot more things to try. Perhaps the multiple registrations are just a hacker trying various things to see if he can bypass your logic, but perhaps he was successful on the 8th attempt and all the registrations after that was him sending out spam emails. To be sure what your mail() function is doing, log the actual parameters being put into it. Note: Even one version of the hardened php Suhosin patch introduced an email header injection hole by blindly adding a specifically named php variable into the header. All it would take is having that specific version of the patch installed and a way for a hacker to set that php variable and he could send his emails to whomever he wanted through your mail server. In programming, it is possible to bypass just about anything if you are willing to spend the time to try.
-
Some possibilities - 1) It's an automated registration script that found your site and is just registering because it can and the human behind it has not gotten around to try and use the accounts that have been created. Do you have a captcha of any kind as part of your registration process? Do you use a link sent through the registration email to activate the account? 2) Perhaps your registration email code allows email header injection and someone is using that to send out their emails to whomever they want through your mail server. I would log (to a file, see this link - error_log ) the to, subject, message, and header fields being put into the mail() function call so that you can see exactly what is being sent.
-
There's nothing technically wrong with the query you posted, provided the variables have expected values, the columns you are referencing exist, the user_no exists, and there are not any other problems in your code such as no database connection... A) echo $query_update_user; so that you know exactly what it contains. B) Are you actually executing the query using a mysql_query() statement? (you would not believe how many times people ask why their query is not doing anything but they don't actually have any code to execute the query.) C) Do you have any error checking and error reporting logic to test if the mysql_query executed without any errors and to tell you if/why the query failed? (if you look at any of the similar threads in the forum, i.e. my query is not working..., you will find suggested code using mysql_error() that test if the query worked or not and displays the mysql_error() output when it does not.) D) Is the code with the query statement and the mysql_query() statement actually being executed? Perhaps it is in a conditional statement that is false or the whole page is not running due to a fatal parse error or a fatal runtime error.
-
Yes, but what is it doing, so that we would know what sort of problem you are having and could help find the cause. P.S. UPDATE queries don't return rows, if you literally meant you expected that query to 'return rows'
-
This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=342450.0
-
This problem is actually a php/html problem, so moving thread to the php help forum section... You need to start by getting your <tr><td></td></tr> tags correct so that the table is valid and the correct information is within those tags. Assuming that you want each line (headings and data under those headings) to be a separate html table row, see the following minimal code - <?php $cat = ''; // initialize to a value that will never exist as data $content = "<table>\n"; while($row = $this->db->fetch_assoc($query1)){ if($row['cat_name'] != $cat) { // the category changed $cat = $row['cat_name']; // save the new cat // output a new heading here... $content .= "<tr><td><p><a href='index.php?cg=cgs&page=forum&do=forums:{$row['cat_id']}'>{$row['cat_name']}</a></p></td></tr>\n"; } // output each piece of data under a heading here... $content .= "<tr><td> - {$row['forum_name']}</td></tr>\n"; } $content .= "</table>"; echo $content; I did not include the $i and class="odd" logic in that for a couple of reasons - 1) You need to get the html tags correct before you worry about styling it, and 2) I don't know if you want to strictly alternate the class="odd" regardless of if the row is a heading or data or if you want to start over and just alternate for the data under each heading. Once you see where the <tr> tags are at in the correct output, adding the logic to insert the class="odd" at the correct point for either of those methods should be simple.
-
One possible way - <?php //connect to database $textw = "My friend is in here house"; // determine which words to retrieve (save some processing and query time) $parts = explode(' ',$textw); // $parts is also used later in the replace operation $find = implode("','",$parts); //load just the replacements $query = "SELECT * FROM data WHERE words IN ('$find')"; $result = mysql_query($query); //get replacement words $replacewords =array(); while ($row = mysql_fetch_assoc($result)) { $replacewords[strtolower($row['words'])] = $row['wordsys']; // key is the original word, value is the replacement } foreach($parts as $key=>$part){ if(isset($replacewords[strtolower($part)])){ $parts[$key] = $replacewords[strtolower($part)]; } } $text = implode(' ',$parts); echo $text; ?>
-
I know what you want, but what is the correct resulting $text that your example should produce?