Jump to content
xisto Community

sonesay

Members
  • Content Count

    958
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by sonesay

  1. Does your while loop work? That's the first time I've seen variables being assigned that way in your loop. There is also a problem with your 'localhost'. it should be a string not just localhost which is a constant undefined. no $ symbol means it will look for the constant localhost. This is how I would of done it <?php$username="mrdee";$password="**********";$database="mrdee_reloader";mysql_connect('localhost',$username,$password);@mysql_select_db($database) or die( "Unable to select database");$query="SELECT * FROM rouw";$result=mysql_query($query);// loop through array and output till its finishedwhile($row = mysql_fetch_assoc($result)) { echo $row["Name"] . "<br />"; echo $row["Town"] . "<br />"; echo $row["Email"] . "<br />";}?>You will need to place the while loop where you desire the output to occur. This would be in your html page etc.
  2. What version of php are you using? The warnings happen because your php version is much newer than what the script was designed for. Your script uses old methods so its not fully compatable or not supported with the current version of php. I'm still not 100% sure on what depreciation actually means but it could just mean it does still work but will probably not continue to work in further releases of php so the warning is displayed. I think you can try removing theses types of warning in your php settings. I did a quick search and one some examples you can try .. http://forums.cacti.net/about36427.html For all of you using PHP 5.3:Edit your php.ini and set error_reporting to:Code:error_reporting = E_ALL & ~E_DEPRECATEDAfter that edit /cacti/include/global.php and change line 196 fromCode:error_reporting(E_ALL);toCode:error_reporting(E_ALL ^ E_DEPRECATED);Do exactly the same in line 312 of file adodb-time.inc.php located in /cacti/lib/adodbNow restart your web server and you will see that all "deprecated" messages will be successfully suppressed.Best regards-Andreas- Try setting the error warnings to ignore deprecated errors. You can probably ignore the other lines where it tells you to find the error_reporting() to set as it only applies to their specific scripts so with your own you need to locate where ever your error reporting scripts are set specific to your scripts. So it should be in two places your php.ini and where ever it is set in your php script as it will overwrite the php.ini setting.
  3. I had a look at the example link where you are using as a guide. Your main problem is it has no styles correct? I think this is probably due to a setting you've set in the first snipplet of code <?php // turn off WordPress themes and include the WordPress core: define('WP_USE_THEMES', false); require($_SERVER['DOCUMENT_ROOT'] . '/wordpress/wp-blog-header.php');?> I'm guessing the WP_USE_THEMES = false will cause wp to output your content in just plain text. I have no personal experince of word press my self so I am only guessing that is what is happen. If that is the case then maybe you can try turn it on just to see the effect. If that still does not do what you need then it may look like you need to somehow create your own CSS to format it. You can probbaly do this by getting at your table container and selecting what ever child elements underneath it to style it as you please. Could you possible paste the entire html code generated by your page I would be interested to see what it actually outputs.
  4. This sounds like a very bad and common problem. I can give you some insight as I was once addicted to MMORPG myself. The more you let him get away with being a slob the worse it will get. Eventually it may get to the point where its so bad he will start giving up on everything all together or it might actually make him realize how much of a time hes wastes either way it will take too long and waste more valuable time. You say hes 24 that's the age you should be changing from a kid to and adult already. I know people are all different but generally by that age you should be old enough to take care of your self. I know a lot of people who grow up and are responsible when they are 20 and it amazes me. I wonder what makes them different from me and why at that age I was lost and messed up. It has to do with parenting I think. If you had raised your kid well and taught them good qualities like hard work and responsibilities then they would not end up like this. I have to say my parents were not the best being not very educated they still have no idea on how to be a parent or what parenting is. To this day it causes problems in the family when there is an argument and no one is willing to concede thinking they are the only ones right. You cannot go through live having kids and not teaching them good values and then expect them to turn out right when they are adults it does not work that way. I think a lot of parents fail this way because they don't know what parenting really is. My little brother has the same problem he is 11 and all he thinks about is games. I know its up to me to teach him because my parents wont do it. They are too concerned about their own life to really be parents. My only suggestion for you is to take it upon yourself to help your brother out. You have to find a way to make him see the light its not going to be easy but if you don't do it who will? Your his brother and true you may have your own life but it will take sacrifice if you love him enough you will do what ever it takes to help him. Your brother is probably also feeling a lot of helplessness and wondering why things arn't working out so he gives up trying. Nothing comes out good without putting in hard work and he should expect to fail many times before he success but if he does not change then the outcome surely will not be any different. Another problem is if your mum is letting him stay for free then its easy for him to be lazy. Kicking him out might sound bad but its probably the best thing and the only thing that will get him to do something about his situation. It may seem harsh to do such a thing to family but its not. I wish you the best of luck with your brother.
  5. What did you do to fix it? If it was just a power cable issue where it was not connected properly then it should be a simple fix. By the looks of it, it seems like a power issue when you say it has no power. Either that or the cd unit has shorted and no longer functions but I've never heard of any cases where that's happen before.
  6. I like the idea but I think it should be up to them whether they are subject to testing or not. Even though they are prisoners they are still human and their rights should not be taken away. We should not be forcing anything on anyone and the day we start doing that is the day we begin losing our freedom (if we even had it to begin with). This world is already messed up as it is (probably has always been) and the only way to make things better is to educate more people so they aren't just sheep being manipulated and used by the elites but be able to think and speak out on their own.
  7. sonesay

    Header Error

    The reason for that error is because you have already began outputting HTML code so redirecting after that point is not possible. You can move your whole PHP code block to the top before you begin your HTML output and it should work. <?php// Set Global Vars$HOST = "";$USERNAME = "";$PASSWORD = "";$DATABASE = "";$TABLE = "";// Establish a connectionmysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());mysql_select_db($DATABASE) or die(mysql_error());//==================================================================// Check if anything is posted//==================================================================if (isset($_POST['delete'])) { $sql = ("delete from $TABLE where "); for ($i = 0; $i < count($_POST['checkbox']); $i++) { if ($i != 0) { $sql.= "OR "; } $sql .= " id='" . $_POST['checkbox'][$i] . "'"; //================================================================== // Select file to unlink based on id posted //================================================================== $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}"; $result_file_unlink = mysql_query($sql_file_unlink); $row_file_link = mysql_fetch_assoc($result_file_unlink); if($row_file_link) { unlink('../testimonial_files/' . $row_file_link['Download']); } //================================================================== } $result = mysql_query($sql); header('Location: index.php'); exit;} else { // select sql here $sql = "select * from `$TABLE` order by `id`;"; $result = mysql_query($sql);}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ xmlns="http://forums.xisto.com/no_longer_exists/ http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Testimonials</title><link href="../style.css" rel="stylesheet" type="text/css" /><link href="uploadify/uploadify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="uploadify/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="uploadify/swfobject.js"></script> <script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#file_upload').uploadify({ 'uploader' : 'uploadify/uploadify.swf', 'script' : 'uploadify/uploadify.php', 'cancelImg' : 'uploadify/cancel.png', 'folder' : '../testimonial_files', 'auto' : true }); }); </script> </head><body><div class="container"> <div class="header"><br /><br /><br /> </div> <div class="sidebar1"> <ul class="nav"><b> <li><a href="../">Home</a></li> <li><a href="/admin/">Testimonials upload</a></li> <li><a href="audio/">Audio Testimonials upload</a></li> <li><a href="dvds/">Dvd's upload</a></li> <li><a href="newsletter/">Newsletter upload</a></li> <li><a href="news/">News box update</a></li> </b></ul></div> <div class="content"> <center><h2>Admin</h2></center> <br /><center><p><input id="file_upload" name="file_upload" type="file" /></p><p><table width="200" border="0"><form action="insert_test.php" method="post"> <tr> <td align="right">Name:</td> <td><input type="text" name="Name" /></td> </tr> <tr> <td align="right">Description:</td> <td><input type="text" name="Message" /></td> </tr> <tr> <td align="right">Download:</td> <td><input name="Download" type="text" /></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit" /></td> </tr></form></table></p><br /><br /><p><table align="center" width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td colspan="6" align="center"><strong>Testimonials</strong> </td> </tr> <tr> <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <table width="400" border="1" cellpadding="3" cellspacing="1"> <tr> <td align="center"><strong>Select</strong></td> <td align="center"><strong>ID</strong></td> <td align="center"><strong>Name</strong></td> <td align="center"><strong>Description</strong></td> <td align="center"><strong>Download</strong></td> <td align="center"><strong>Last Modified</strong></td> </tr><?php $row = mysql_fetch_assoc($result); ?><?php do { ?> <tr> <td align="center"> <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>"> </td> <td align="center"><?php echo $row['id']; ?></td> <td align="center"><?php echo $row['Name']; ?></td> <td align="center"><?php echo $row['Message']; ?></td> <td align="center"><a href="../testimonial_files/<?php echo $row['Download']; ?>">Download</a></td> <td align="center"><?php echo date("j/n/y", strtotime($row["Modified"])) ?></td> </tr> <?php } while ($row = mysql_fetch_assoc($result)); ?> <tr> <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> </table> </form> </td> </tr> </table></p></center></div> <div class="sidebar2"> <h4>Text here</h4> <p> </p> </div> <div class="footer"> <center><p>Š Copyright 2010</p></center> </div> </div></body></html>
  8. Hey thanks for uploading the files. Unfortunately there has always been this problem with me not being able to download files from there. Any ideas why it happens?
  9. Yeah your right. I didn't look at the entire code and just pasted the whole block in. the unlink('../admin/testimonial_files/' . $row['Download']); line you can delete I think because its not needed? if you look at http://php.net/manual/en/function.unlink.php this method deletes a file and I don't remember you mentioning there was any files you also needed deleting. If you do need to delete a file as well then you can paste that line back into the loop block. Edit: I just looked at your code again and by the looks of it you only want to be deleting (unlinking) the file if the user submits a delete post right? If that is the case then you would need to do: <?php// Set Global Vars$HOST = "database";$USERNAME = "sonint99";$PASSWORD = "C2sHF9Zxq3ULXCTV";$DATABASE = "Random";$TABLE = "Testimonials";// Establish a connectionmysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());mysql_select_db($DATABASE) or die(mysql_error());//==================================================================// Check if anything is posted//==================================================================if (isset($_POST['delete'])) { $sql = ("delete from $TABLE where "); for ($i = 0; $i < count($_POST['checkbox']); $i++) { if ($i != 0) { $sql.= "OR "; } $sql .= " id='" . $_POST['checkbox'][$i] . "'"; //================================================================== // Select file to unlink based on id posted //================================================================== $sql_file_unlink = "select Download from $TABLE where id = {$_POST['checkbox'][$i]}"; $result_file_unlink = mysql_query($sql_file_unlink); $row_file_link = mysql_fetch_assoc($result_file_unlink); if($row_file_link) { unlink('../admin/testimonial_files/' . $row_file_link['Download']); } //================================================================== } $result = mysql_query($sql); header('Location: index.php'); exit;} else { // select sql here $sql = "select * from `$TABLE` order by `id`;"; $result = mysql_query($sql);}?><table align="center" width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td colspan="6" align="center"><strong>Testimonials</strong> </td> </tr> <tr> <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <table width="400" border="1" cellpadding="3" cellspacing="1"> <tr> <td align="center"><strong>Select</strong></td> <td align="center"><strong>ID</strong></td> <td align="center"><strong>Name</strong></td> <td align="center"><strong>Description</strong></td> <td align="center"><strong>Download</strong></td> <td align="center"><strong>Last Modified</strong></td> </tr> <?php $row = mysql_fetch_assoc($result); ?><?php do { ?> <tr> <td align="center"> <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>"> </td> <td align="center"><?php echo $row['id']; ?></td> <td align="center"><?php echo $row['Name']; ?></td> <td align="center"><?php echo $row['Message']; ?></td> <td align="center"><a href="/admin/testimonial_files/<?php echo $row['Download']; ?>">Download</a></td> <td align="center"><?php echo $row['Modified']; ?></td> </tr> <?php } while ($row = mysql_fetch_assoc($result)); ?> <tr> <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> </table> </form> </td> </tr> </table><?php I hope that's what you wanted. I removed some variables as it seems like they arnt being used like the delete id from the submit button.
  10. Can you give a full description of all tables involved? i.e the tables used by the Flash survey script and its records. Any other tables you intend to use. This will make writing example code more accurate and also provide us a better understanding of the database.
  11. Do you have an example link to show some examples of how it is done? I am asking because I dont have time to search for it maybe if I can see a direct example I can help you out but at this stage I have no idea how the Flash survey works with php.
  12. Yeah I thought that's what you wanted but I wasn't too sure so I had to ask. all the code for the part where you delete needs to go in the correct if block in your statement. The part where you query for your result and use it in the mysql_fetch_assoc() needs to go in the else block. Try this: <?php// Set Global Vars$HOST = "XXXXXXX";$USERNAME = "XXXX";$PASSWORD = "XXXXX";$DATABASE = "XXXXX";$TABLE = "Testimonials";// Establish a connectionmysql_connect($HOST, $USERNAME, $PASSWORD) or die(mysql_error());mysql_select_db($DATABASE) or die(mysql_error());if (isset($_POST['delete'])) { // delete sql here $DELETE_ID = mysql_real_escape_string($_POST['delete']); unlink('../admin/testimonial_files/' . $row['Download']); $sql = ("delete from $TABLE where "); for ($i = 0; $i < count($_POST['checkbox']); $i++) { if ($i != 0) { $sql.= "AND "; } $sql .= " id='" . $_POST['checkbox'][$i] . "'"; } $result = mysql_query($sql); header('Location: index.php'); exit;} else { // select sql here $sql = "select * from `$TABLE` order by `id`;"; $result = mysql_query($sql);}?><table align="center" width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><form name="delete" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <table width="400" border="1" cellpadding="3" cellspacing="1"> <tr> <td colspan="6" align="center"><strong>Testimonials</strong> </td> </tr> <tr> <td align="center"><strong>Select</strong></td> <td align="center"><strong>ID</strong></td> <td align="center"><strong>Name</strong></td> <td align="center"><strong>Description</strong></td> <td align="center"><strong>Download</strong></td> <td align="center"><strong>Last Modified</strong></td> </tr><?php $row = mysql_fetch_assoc($result); ?><?php do { ?> <tr> <td align="center"> <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $row['id']; ?>"> </td> <td align="center"><?php echo $row['id']; ?></td> <td align="center"><?php echo $row['Name']; ?></td> <td align="center"><?php echo $row['Message']; ?></td> <td align="center"><a href="/admin/testimonial_files/<?php echo $row['Download']; ?>">Download</a></td> <td align="center"><?php echo $row['Modified']; ?></td> </tr> <tr> <td colspan="6" align="center"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> </table> </form> </td> </tr> </table><?php } while ($row = mysql_fetch_assoc($result)); ?>
  13. What is your page suppose to be doing exactly? From the looks of it you are checking if there are any submissions for delete. If there are none which is mostly the case when you frist visit the page then that block is always going to execute. Which explains why the rest of the code fails because the block of code that assigns the $result1 variable never gets executed. You might want to change your if statements around appropriately. if(!isset($_POST['delete'])) {$sql = "select * from `$TABLE` order by `id`;";} else {$DELETE_ID = mysql_real_escape_string($_POST['delete']);echo("select * from `$TABLE` where `id` = '$DELETE_ID';");die();// Delete the file on the diskunlink('../admin/testimonial_files/'.$row['Download']);// Build your query, kind of weird but alright.$sql = ("delete from $TABLE where ");for($i=0;$i<count($_POST['checkbox']);$i++){if($i != 0) { $sql.= "AND "; }$sql .= " id='" . $_POST['checkbox'][$i] . "'";} if you do if(!isset($_POST['delete'])) {$sql = "select * from `$TABLE` order by `id`;";die("post delete not set");} else {$DELETE_ID = mysql_real_escape_string($_POST['delete']);echo("select * from `$TABLE` where `id` = '$DELETE_ID';");die("result should be set here");// Delete the file on the diskunlink('../admin/testimonial_files/'.$row['Download']);// Build your query, kind of weird but alright.$sql = ("delete from $TABLE where ");for($i=0;$i<count($_POST['checkbox']);$i++){if($i != 0) { $sql.= "AND "; }$sql .= " id='" . $_POST['checkbox'][$i] . "'";} that should tell you where its executing.
  14. That's very strange. Can you post your entire script again if its changed a lot? There should be some kind of output or error if something is wrong. Is anything being reported? The only other way to figure it out is to keep going back up a line and outing echo statements to make sure it the code actually reaches that point. You need to figure out exactly where it dying before you can resolve any issues.
  15. Try it here. $DELETE_ID = mysql_real_escape_string($_POST['delete']);$result1 = mysql_query("select * from `$TABLE` where `id` = '$DELETE_ID';");$row = mysql_fetch_assoc($result1);mysql_close($result1);// change to $DELETE_ID = mysql_real_escape_string($_POST['delete']);echo("select * from `$TABLE` where `id` = '$DELETE_ID';");die();
  16. Hello, I am not similar with the flash survey tool you are using so I cant help as much. You say you created a separate table of your own to store the count for surveys taken and score. Does this mean that the flash survey tool it self does not store or keep track of this information already? To solve your problem you will need to locate the point where the flash survey does the save or insert to its database table if any. i.e. the end of a survey submission. If I can recall correctly flash can recall or redirect to php files I believe so locating such php files should be a start and you would obviously need to modify it here to do all your logic.
  17. Can you try a echo("select * from `$TABLE` where `id` = '$DELETE_ID';"); The first thing you should do here is to try and verify you are building the sql correctly. There may be times where the value $DELETE_ID might not be as you expected so take the generated sql string and run it against your mysql database manually to verify it is valid. Any syntax errors you get you will need to fix.
  18. It looks like the return from mysql_query() is not valid. You should first check its valid before performing anything on it such as mysql_fetch_assoc() Try this first: $result = mysql_query("select * from `$TABLE` where `id` = '$DELETE_ID';");if (!$result) { die('Invalid query: ' . mysql_error());} else {// do what ever you need to do here.} Good luck.
  19. It's probably because your $row['Download'] is not a table field name (column) or the records just contain an empty string. Verify the field name and records for it in the database. Good luck
  20. <td><? echo <a href='/docs"$row['Download']"'>Download</a>; ?></td> Try not to mix standard HTML tags with your echo PHP statement. It makes it more organized and less prone to errors as what ever editor you may be using can highlight the HTML code. This is how I would write it but its really up to personal preference. <td><a href="/docs/<?php echo $row['Download']; ?>">Download</a></td>
  21. Hi, First of all what does the $row['Download'] output? If it is just the file name then you will need to build the anchor tag your self. You should know where the file is being uploaded to so build the anchor tag accordingly. while($row = mysql_fetch_array($result)){echo "<tr>";echo "<td width='150'>" . $row['Name'] . "</td>";echo "<td width='250'>" . $row['Message'] . "</td>";echo "<td width='100'>" . $row['Download'] . "</td>";echo "</tr>";}echo "</table>"; Something like ? while($row = mysql_fetch_array($result)){echo "<tr>";echo "<td width='150'>" . $row['Name'] . "</td>";echo "<td width='250'>" . $row['Message'] . "</td>";echo "<td width='100'><a href='PATH_TO_FILE".$row['Download']."'>" . $row['Download'] . "</a></td>";echo "</tr>";}echo "</table>"; Assuming $row['Download'] contains your file name... Good luck
  22. I cant say I agree with everything that's been said here. I guess from my own point of view the owners can do what they like. Ever hear of the saying don't expect anything from anyone and you wont get disappointed? The forums still work, sure there is spam but there is always going to be span its the internet. Just because the moderates don't remove it intimidate you will not die. I'm not sure how this would affect its search rankings but I'm pretty sure it would have little or no effect. I have searched up topics in the past on Google and it points me here so there are some good posts. I don't think you should be blaming the admins for the types of members we have who don't post good topics. The admins have no control over what you post so doesn't that seem unreasonable to you? I do not know fully what has become of this place over the last year but I can still post and reply to topics and still earn mycents. That is enough for me and I don't really expect anymore. I am how ever disappointed on the number of topics relating to the areas I'm interested in but then I remember this place is a forum for all topics to be discussed. I don't expect much to happen from the admins as I don't think its really their job to control what users post here and the quality. Its out of their hands. We can only hope more quality topics are started and continued by its members. Not everyone has the time to come here and post a really good topic. I'm seen half *bottom* tutorials and think to my self man these guys are lame but have a I posted anything good no.. I want to post a tutorial on an image gallery I made up which is unique but I have not had the time. Plus I am only half way through building it myself so when I do get time I will since I've not seen anything out there that's similar on the web. You have to remember not everyone out there is an expert in their field so you cant expect everyone to be posting high quality content all the time.
  23. Object Oriented just means you treat every entity in your code as objects. They have properties and methods (actions) you can perform on them to do various tasks.The GWT I remember is a toolkit to allow you to write web applications that uses a lot of JavaScript in Java so you will need to know a fair bit about java. Its purpose to allow you to write complex applications without worrying about cross browser compatibility issues. I have tried this before but not to the level of producing anything. To me it seem like a lot of over head before you got anything working and in the end when I wanted to change something small like the layout or style of something it wasn't so obvious where.
  24. You will need to provide more information for us to be able to quickly help you. There are many different ways of doing this depending on whether you use a JavaScript library or write the code entirely on your own so please go to https://jsfiddle.net/ and post your HTML, JavaScript and CSS there for us to look at.
  25. The error description is most likely the case. My brothers blackberry hard trouble logging into his gmail account as well and the problem was he was entering the incorrect password. There is a modifier key when entering in numbers so make sure you correctly use it where numbers are required.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.