Jump to content

Christopher.Burkhouse

Members
  • Posts

    18
  • Joined

  • Last visited

Previous Fields

  • Languages
    PHP, MySQL, Javascript, HTML, CSS

Profile Information

  • Location
    Sacramento
  • Interests
    Primarily PHP/MySQL. And pizza.

Christopher.Burkhouse's Achievements

Newbie

Newbie (1/7)

2

Reputation

  1. This is one of those situations where if you take the time to Google the function, it's literally the first result. The PHP page has very extensive information on this function. http://lmgtfy.com/?q=mysqli_select_db The PHP page has both a summary and examples of the function, and how to use it. -Chris
  2. Perfect, this did exactly what I was looking for. Thanks! -Chris
  3. Hey guys. I'm relearning Joins (I'm trying to finally delve deeper into this section for obvious reasons), and wondering if I can join three tables together, and how. W3schools goes over Joins very well, but never covers anything of this matter. Here's a small sample of what my database would look like. Usernames id - username - pic 1 - User1234 - pic.jpg 2 - User4321 - pict.jpg 3 - Usernam1 - p1ct.jpg Websites id - name - url 1 - webna - webna.c 2 - webur - webur.c 3 - websi - websi.t Tickets id - user_id - website_id 1 - 1 - 2 2 - 3 - 2 3 - 3 - 2 Pretty much I'd want to pull from the tickets table. I want to include... tickets.id, usernames.username, usernames.pic, websites.name, websites.url But not really sure where to go from here. Currently when a ticket is created, I have it store the user id, website name, and website url, to only have to join one file. This leads to redundancy and possible inconsistencies Thanks, Chris
  4. That doesn't work in this case, though. I need to stop the page from pulling a specific JS file, and use mine instead, so I can customize the functions. Is something like this even possible? To explain, I can't modify the JS after the page has been loaded, I need my JS to load with the page. It's because of the way the functions operate.
  5. So here's my problem. I'm trying to test my website for exploits. What I'm testing for requires me to modify some JS at startup. I tried in the dev tools 'inspect element' section of Chrome, but refreshing, as I'm sure you all know, resets the JS. What I need is to replace a JS page (it links to an external JS page) with my own (or remove the one included and include my own between the header). Is there a tool which allows this? I imagine if a tool let's you replace /js/functions.js with a local functions.js, this would be the easiest route. My problem is I haven't found anything that works. I hope I'm making sense. If I don't, please let me know what I can clarify. I'm pretty new to JS injection in this form. It just needs to inject the JS at page load hence the need to be able to refresh and have it use my specific JS from the get-go.
  6. What kind of information are you pulling from the other pages? I'm not entirely sure how to help you out here, because depending on the data and how it's used, you may need very different codes. Are you including user content? Scripting code? Video/music embedding? The more detail the better, so I know how to direct you in the best way. -Chris
  7. Please do not create multiple threads for the same issue (unless a mod disagrees). You should have updated your previous posting with the new link and problem since it is still regarding the contact us form. And again, we need the code you're using to assist you with errors. PHP is a server side language, meaning we can't see it unless you provide us with the code (unlike HTML or CSS which is user-side). Did you read the documentation we linked you to in the other thread? It very clearly states you have three fields, and all of the email content should be mashed into ONE variable. If you did this, show us what you have. It could be a simple post/get error, or something along those lines. -Chris
  8. If the documentation is confusing, then also look at the samples provided. They are very clear. If it still doesn't make sense, let us know which part you're stuck on. A big part of learning PHP is using the documentation and resources available, which justsomeguy gave you a direct link to. Also, note that you can do the following: if(mail($e,$s,$m)) echo 'Email sent successfully';else echo 'Error sending email.'; As opposed to assuming it was sent successfully just because it didn't error out. As stated, mail returns true if successful, otherwise returns false.
  9. For some reason, doing it like that never crossed my mind, Ingolme. I keep forgetting that printf and sprintf exist, despite being very useful functions. I'm in that phase where I'm trying to break my newbie habits still lol. -Chris
  10. To answer your question about timeouts, I have the info below. The problem with the possibility of timing out is it provides a fatal error. So if the first server is out, you really can't check the other servers. The best method to correctly check all servers might be a mix of PHP and JS. Have JS load, for example, server.php?s=1 server.php?s=2 and server.php?s=3. If the file retrieval times out, the server is down. Or... I think that would work, right? http://php.net/manual/en/function.set-time-limit.php Please read all documentation before using this function. I say this since... 1. It doesn't work in safe mode 2. Does not affect the default in php.ini 3. Sets the timeout at the time of using the function. So if you use set_time_limit at the start of every fsockopen function, they will each have their own timeout Something else to note: -Chris
  11. Why is this on the PHP subforum instead of the SQL subforum? Looks like you need help with your SQL query.
  12. Personally, I'd use my latter example. Of everything that comes to mind, it seems to be the most efficient way (one page for each language). Plus, with the latter, if you wanted to add additional languages you could just add say a german.php or russian.php file and add it to the if/else structure once. There's just no real reason to store all of this on a MySQL database since you have access to PHP files and could easily modify the language files yourself, you know? Side note, if you have an English/Spanish button, you can save it as a cookie. If they're logged in, you can also store it with their login info. Anyways, I hope this helped out. Make sure to like the response if it did (: And if any part of it wasn't clear, please ask. We're here to help. -Chris
  13. To understand a framework/library, understanding PHP first is essential. Whether it's Implementing the code, handling the data, etc, you're not going to do much if you don't understand the core language. I'm not completely understanding the question though. Custom code is still needed to use frameworks and libraries. There are also pre-written scripts, such as entire register/login or forum scripts over writing your own register/login or forum from scratch (of which using one method over the other can depend on the project you're doing). Libraries and frameworks are essentially extensions to the core language. I do want to add that you should never say you're done learning PHP. There are constant updates coming out. I'm going to geek out and post a quote here for you. "A true master is an eternal student." -Master Yi Now if you meant you're done reading through W3Schools' tutorials, there are plenty of resources out there to expand upon your knowledge. Do you have any experience with other languages? Are you looking to expand your training? There are plenty of great resources out there.
  14. @justsomeguy Oh you're right lol. I was a bit tired and missed the obvious comments. @Chikwado I forgot to mention, regardless of whether it's a custom or premade script, you're providing us with nothing here. We'd need to be able to see form_handler.php in a case where there are no errors. You're not even telling us what the expected results are. Is it supposed to echo text? Is an email actually sent but no text displayed? We need details in order to help. The best way to do this would be by providing your the PHP code in form_handler.php so we can see what's going on, and help from there, unless I'm misunderstanding the situation. -Chris
  15. Well this depends. What exactly are you developing? Is it a project that is going to be distributed, or a personal project? Personally, I like to create language files in php. There are plenty of ways to do this. I'm not sure if it's the most efficient way, but... <?php// ONE file with arrays, probably not as good as my next idea// English$lan['en']['intro'] = 'Hello, and welcome blah blah';$lan['en']['content'] = 'Oh and here is some content.';// Spanish$lan['sp']['intro'] = 'No hablo espanol';$lan['sp']['content'] = 'Queso es delicioso';?> <?php$language = // pull language type, en or spif(!$language) $language = 'en'; // or sp is Spanish is default, of course// Now you can use the language variablesecho $lan[$language]['intro'];echo $lan[$language]['content'];?> Or create two pages. One for English which would contain <?php// english.php$lan['intro'] = 'Hello, and welcome blah blah';$lan['content'] = 'Oh and here is some content.';?> And one for Spanish <?php// spanish.php$lan['intro'] = 'No hablo espanol';$lan['content'] = 'Queso es delicioso';?> And of course the file which decides which one to grab <?php$language = // pull language type, en or sp if($language = 'sp') include 'spanish.php';else include 'english.php'; // Or reverse if spanish is default, of course// Now you can use the language variablesecho $lan['intro'];echo $lan['content'];?>
×
×
  • Create New...