Jump to content
Larry Ullman's Book Forums

rob

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by rob

  1. rob

    New Forum Look

    From a user point of view, would be nice if the recent topics list in the side-bar was at the top so you can check at a glance on page load without having to scroll down.
  2. Read the error message, the Fatal error you're getting is not a database error. Show the code for the require_once( ) statement in password.php Where is the mysql_script.php script relative to password.php?
  3. Edward, your comments don't make a lot of sense to me in the context of this: Can you expand on how you think ORMs, active records, wrapper classes, database helpers prevent quick and efficient development? Or how this is only relevant to high traffic websites? I'm also not following your point: ... in the context of Antonio's statement above.
  4. I've seen this error in applications that weren't wordpress. I'd double check your client's server settings.
  5. There's no information in this post that would enable anyone to help you; post the relevant code so we can see what's happening. Probably a good idea for you to read the forum guidelines too.
  6. $current_page is used as a flag for the if($i != $current_page) conditional, it's not content sent to the browser. If you want to put a span with class around the current page you need to put it around the content echoed if it is the current page. } else { echo $i . ''; }
  7. You should show the code in which you're actually trying to add the class; you should also state what the problem is.
  8. Have a look at the following post on stackoverflow: http://stackoverflow.com/questions/6476896/php-redirect-fails-and-does-not-do-anything It's always a good idea to google issues if you get stuck.
  9. Firstly, have you set display_errors and error_reporting? I suspect you haven't and when you do you'll get a Headers already sent message. Secondly, check for and remove whitespace in your script before the header call.
  10. You haven't actually stated what the issue/error is. That's not standard debugging if you think your issue is with the SQL: firstly you should print the query out in the browser to establish it is what you're expecting, then run the query directly against MySQL (using the CLI or other tool). If there are no issues with steps one and two, then inspect the construction of the html for the drop list.
  11. For future posts make sure you put code between [ code ] tags (highlight code and press the < > button above the text box). Get yourself a text editor/IDE with syntax highlighting, it helps with spotting syntax errors. You're missing a closing " (double quotation mark) at the end of the string after your print statement.
  12. You mean hidden form fields, right? You could put it in a session or send it via the $_POST array. How is the multidimensional array being created?
  13. $emails = $wpdb->get_results( "SELECT email FROM emails WHERE zip_prefix = '$zip_prefix'" ); foreach ($rows as $obj) { $email_array2[] = $obj->email; print_r($emails); print_r($email_array2); return $email_array2; I'm struggling to understand the code, does $emails turn into $rows at some point and that code is missing? Where's the closing curly bracket for the foreach loop? If it's after the return $email_array2, that could be affecting your loop. Is it possible to provide more of the script? You can return each row as an array (associative or numeric) by passing in a second parameter (output_type) to get_results: ARRAY_A ARRAY_N $wpdb->get_results('query', output_type); http://codex.wordpre...Generic_Results Which may be more helpful to you.
  14. You're sure you have more than one object in your $emails array? Otherwise, will have to see some code.
  15. In your form tag change the action to the name of the file it's posting to. Near the bottom of your php script is a header call, change this to reflect what I previously suggested to pass a $_GET variable via a redirect. On the success page retrieve the $_GET variable and make sure it's sanitised before sending it to the browser.
  16. These are the code files and you're not just copying and pasting source code from the pages viewed via the browser, right? There's nothing in the code you've provided that shows any of the basic php that you would need to process form data. Paul have you read Larry's book? Do you know how to write a form, send data to a php script, how to access and process that data via php? If you do, please provide this code.
  17. You've used the PHP solution which I provided inside of javascript. I assumed wrongly you were redirecting after server-side processing from the contact.php script. Build the functionality in PHP first, then build javascript on top of that. <form action="contact.php" method="post"> <input type="text" name="first_name"> $first_name = $_POST['first_name']; header('Location: success.php?first_name=' . $first_name); $first_name = $_GET['first_name']; echo 'Thank you ' . htmlentities( $first_name ) . ', your email was sent to us.'; Also, as marguax has pointed out, you've provided few details of the whole process which has made it difficult to help.
  18. rob

    Accounts Hacked

    No one ever becomes a good developer by just reading books. Build things. What makes a good developer is experience.
  19. You just need to append the value to the redirect URL as you would if passing a $_GET variable via a link. $name = 'Billy'; header('Location: success.php?name=' . $name);
  20. Prepared statements are run every time a script is run. There are two benefits to using prepared statements: Security, prevents SQL injection attacks Speed, for a query that needs to be run multiple times (for the same script execution), the query is sent once to MySQL, then values are sent separately. http://php.net/manua...-statements.php
  21. If you've made the videos you should already know your storage requirements. If not, you either have to make a test video and extrapolate based on it's file size; or make a guess based on average intended video length and MB/min. Bandwidth usage will be down to how popular/successful your service is. Stay clear of cheap hosting with unlimited bandwidth, it's never unlimited and the servers are usually loaded with as many sites as possible. Alternatively use a cloud service for video delivery; a sensible solution would be Amazon S3 http://aws.amazon.com/s3/ on top of regular hosting. Use S3 for video delivery and host your site with a regular hosting provider. Amazon charge on a usage basis and the charges are small. My best advice, know your requirements and do plenty of research.
×
×
  • Create New...