Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. echo out $query_update as part of the or die statement and post up the contents
  2. still need more info on the file structure....
  3. could you show some sample output? maybe a relevent section of the rendered pages source code as well?
  4. Seriously? The line "XMLReader::open(): Unable to open source data" is there to to tell that the file is either not where you are teilling the script it is, does not exist at all, or does not have sufficient permissions set for the script to open it for reading. If the script can't open the file it's never going to manage to read it - hence the second warning message. Without information on your file structure that's all I got.
  5. I'm not seeing any code that would fire on the Like buttons submit action. Also, to make this work, you need to have the unique identifier of the post that you are applying the like to in orfer to use it to set which post is being liked. The system you are using has some serious flwas - not least of which is no persistance regarding whether the user has liked that post already or not - you could end up with 20 users and a post that has a few million likes.... Having looked at your code, I'm a bit nervous about your db design - could you post up your table structure as well?
  6. yeah, that white page meens that PHP has hit a parse error and error reporting / display errors is not set to show this on the screen. For development always set error_reporting to E_ALL and display_errors to on. I have it set in the ini file on my development server, so I'm not sure on the runtime config, but I think sticking this at the top of the page, just under the first <?php should do it. error_reporting('E_ALL'); display_errors = 1;
  7. not seeing where tht script is loading any content, or indeed where any PHP is...
  8. are you atempting to load files across different domains using javascript?
  9. so your new code is? And your regex is doing?
  10. AJAX can do it without a page change, but you would still need to add some form of output on the contact.php page for the AJAX to work with. It also meens you will need to learn the javascript (and prefferably JQuery) for processing AJJAX requests and responces on top of the PHP. Just to check, contact.php is showing as a blank page? Neither the success or the failure message are being displayed?
  11. What is your regex doing? and you do know that $0 is NOT a valid variable name?
  12. in your code $numcolumns should contain your ID value
  13. Choices - in ascending order of work and complexity: have your contact.php echo out the success message on success with link and stuff have contact.php redirect to whatever page you like on success copy the contents of one page into the other page and have the PHP parser check if the form has been submitted and perform action depending on result of check
  14. *cough* *cough* Triggers *cough* *cough*
  15. ...Did you just call me a girl?
  16. sqlsrv_fetch_array returns two records per result line (as does mysql_fetch_array) - one with a numerical key and the other with an assoicative one, thus your wto reults being displayed. apply the fetch type operator to the function to fix this: while( $row = sqlsrv_fetch_array( $result, SQLSRV_FETCH_ASSOC))
  17. what's the game plan here? you want to populate the select box with....what? coming from where? in what format?
  18. hmm, yeah I'm not sure your doing this right at all. I havn't used mysqli - I skipped from mysql to PDO - so I'll probably get some of the mysqli stuff wrong, but the class you have made could be completly rebuilt. Something more like the following I think would work: <?php class dbhandle{ public $res; private $host = "<hostname>"; private $user = "<username>"; private $pass = "<password>"; public $db; public function __construct($database){ $this->db = $database; establishConn(); } private function establishConn(){ //you'll want some error capture in here at some point $con = mysqli_connect($this->host, $this->user, $this->pass, $this->db); $this->res = $con; } } //you would then use it in the following manner: $conn = new dbhandle('myDatabaseName'); mysqli_real_escape_string($conn->res, "some string or other"); ?>
  19. you will need to leave that in in order to have accurate hyperlinks - www. is a subdomain - it is not nesceseraly the same site as http:// which is very different from https:// you can't normalise a dataset when each entry actualy represents a different value
  20. post your full class and I'll have a look
  21. Line 53 - you missed the $ at the start of the item_color variable name
  22. if your programming OOP, why are you not just using the PDO abstraction?
  23. you are runbning a query within a loop - don't do that. Learn how to join tables and your problems (this one at least) will go away.
  24. Just out of curiosity - what is the str_replace for? Here is a heavily commented basic example of itterating through a multi-dim' array, maybe it will healp you get the idea of what to do: <?php //$myArray is a pretend array containing keys of userID's and each of these keys relates to a sub array containing keys of firstname, lastname, age, dob and homepage //I will apply only the most basic of html table formating as well as a simple hyperlink for the homepage // //lets get started echo "<table>"; //start the table element foreach($myArray as $topKey=>$subArray){ //This is the ittertation through the top level array, breaking it into key=>value pairs identified by the variables used after the "as" echo "<tr><th>user ID : $topKey </th>"; //create a new table row and echo out the userID [which is the key in the top level of $myArray, and as such is assigned to $topKey by the foreach] into a table header foreach($subArray as $arrayElems){ // This starts itterating through the sub array associated with the key we just echo'd. //notice that as we don't care about accessing the litteral key, only it's associated value, we have assigned only a single variable after the "as" this time. echo "<td>First Name : {$arrayElems['fistname']}</td>"; //echo out the firstname value into the table echo "<td>Last Name : {$arrayElems['lastname']}</td>"; //echo out the lastname value into the table echo "<td>Age : {$arrayElems['age']}</td>"; //echo out the age value into the table echo "<td>Date Of Birth : {$arrayElems['dob']}</td>"; //echo out the dob value into the table echo "<td>Homepage : <a href=\"{$arrayElems['homepage']}\">{$arrayElems['homepage']}</a></td>"; //echo out the homepage value into the table and crate a hyperlink with it too } //close sub level itteraton action block echo "</tr>" //now we are back out to the top level itteration we want to close the table row ready for the next item } //close top level itteration action block echo "</table>"; // at this point all the information has been echoe'd, so it's time to close the table ?>
  25. if you are willing to pay for it, post in the freelance section and one of the more than capable people here will do it for you in a snap. If you want to learn then you will need to ask some more specific questions.
×
×
  • 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.