Jump to content

elflacodepr

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Everything posted by elflacodepr

  1. All depends, as the file may be too big...it will take up 4 seconds for sure. As for information you provided I can see you are doing a SELECT command which retrieves 16k rows? If so I recommend to use the LIMIT function so you don't have that heavy load of rows coming up at once.
  2. You can simply make a query like this in phpMyAdmin: INSERT INTO disclaimer VALUES ('PUT YOUR DISCLAIMER MESSAGE HERE'); You will write your Disclaimer message inside the ' Change "disclaimer" to the desired table name. BUT...as you say the disclaimer may change you better use a PHP application to update them
  3. Hello, Make sure your Database has the correct Default Charset When you have time have a look in here: http://dev.mysql.com/doc/refman/5.0/en/charset.html
  4. Well well, speaking about PHP and MySQL is not the only thing to do here so here I go. I'm 21/single from Puerto Rico, I'm a hobbie/week-end coder. I love Databases! They are so easy to learn and work but yeah the process is long, but still like it. I firstly started coding HTML, then I knew about CSS and Javascript(which I didn't liked), after a couple time I retired from coding, then I heard about PHP and Databases (MySQL) I was fascinated how things work and what I can do with them, so I bought few books, read tutorials, downloaded scripts and so on...and here I am for 1 year now, trying to do my best to know more and help others with what I know My interests are to learn ASP and Python, which I'd like learn after I get good skills in PHP and MySQL.
  5. You mean you want to make your PHP script to read the values in MySQL then do something? I don't get much what you want to say... I speak Spanish too, so feel free to PM me if you need help.
  6. Hello all! I want to do a PHP proxy server for my website, but I have a little idea of what is needed, I know that cURL may be needed and other things which I don't remember now. I'd like to know everything about how to code them and make them safe, can anyone help me out? Also how do I make the Proxy work with this options, if I'm not asking too much I know there's more than sufficient proxies over the internet, but I prefer to trust one which I know how it's made Thanks!
  7. alright...so how I can do it? I mean...the scripting
  8. I want to read an HTML containing the news and yes, the file will be in same server
  9. Hello all, I'm doing a website using only client-side languages, I thought might be a good idea to use Javascript to read a file which contains News about the website...Is there any way I can do this? if so, can you give an example, I'm not good with JS
  10. I believe Google has few websites which have good tutorials, as far as I know, we don't have CMS tuts in PHPFreaks http://www.google.com.pr/search?hl=en&q=php+simple+cms&btnG=Google+Search
  11. Apart from filtering words, set a limit time for each post
  12. to retrieve your email you will need a query like this: <?php $sql = "SELECT * FROM emails ORDER BY subject ASC"; $query = mysql_query($sql); if (!$query) { // Handle error echo 'Query failed. SQL: ', $sql, '<br />Error # ', mysql_errno(), ' Error msg: ', mysql_error(); exit; } ?> Remember to change "emails" to your table name and "subject" to the column you want the query to be ordered.
  13. You need a working email system which will receive the info from PHP and send it to your 'Yahoo' email, because as plain as you are doing it will not work
  14. I believe you are not telling MySQL what column to select from 'products_description' The query must be like: (you can use an asterisk or other column name) SELECT * FROM products_description WHERE products_id =279 AND language_id =1 AND products_description LIKE '%Product Information is not available for this product yet. Sorry for any inconvenience, this should be updated shortly.'
  15. I got lost with this part...I just include the file and this script will make the rest? echo "<select name='colors'>"; foreach ( $colors AS $k => $v ) { echo "<option value='" . $v . "'>" . $k . "</option>\n"; } echo '</select>'; Also, in this part I will "write" stuff like TRUE or FALSE? or theres a better way?
  16. The phase of the project is code the Admin Panel: My first question is: I've made different levels of administratives rights, what will be the best way to show the correct panel depending on user level? (Administrators, Moderators..etc) Second: I want to populate a drop down box with a color array/list, how would I do such thing? Will be possible to populate it with color example?.....I'm using this color list:http://www.phpfreaks.com/forums/index.php/topic,115201.0.html and Third: Which encryption method is recommended? MD5 or Sha1? If it's possible can you post an example? Thanks!
  17. I recommend to learn both...You can use any of them (PHP or SQL) depending on what you want to do, but thats up to you. A PHP script would look like this: <?php if($user == $user1) { //Page where "user1" will be redirected } else { //If the person is not "user1" he/she will be redirected here } ?>
  18. Well first of you will need a text area in your HTML code not "<question>" as you have written because theres not way you can write the text area if you havent assigned it a 'name' to pass it to PHP then to DB, heres how your code should look: <table> <tr> <td>Proposer's Name:</td> <td width="20px"> </td> <td><input type="text" width="30" name="name" /></td> </tr> <tr> <td>Today's Date MM/DD/YY</td> <td width="20px"> </td> <td><input type="text" width="30" name="userdate" /></td> </tr> </table> <br /> <br /> 1. What is the proposed change? (please avoid complex acronyms and use common terminology)<br /> <textarea rows="5" cols="30" name="comments"></textarea> I'm not sure what you mean with '<answer>' tag so I deleted it Ok, add this to your PHP file so you can write the "text" area to your DB: $q1 = $_POST['comments']; //this is textarea Also make sure you clean everything before being passed to DB! use mysql_real_escape_string
  19. You may use the LIMIT() command which you will tell to DB how many results you want to show: LIMIT(0, 10) and to order from highest rating to lowest use: ORDER BY 'Points' DESC
  20. the files are all in place, thanks for help anyways I just found and error in the files that open and manage DB
  21. Hello all, I'm writing a very basic CMS script, but when it executes I get the following errors: I've tried all kind of ways, such as direct link to file and nothing can be fixed! I also noted that this happens with all applications I write. ??? This is the script: <?php if(isset($_POST['save'])) { include '/website/library/config.php'; include '/website/library/open.php'; //Blog title and content $title = $_POST['title']; $content = $_POST['content']; $read_more = $_POST['read_more']; //Writing content and title to DB $sql = "INSERT INTO content (title, read_more, content, date_time) VALUES ('.$title', '.$read_more', '.$content', now())" or die(mysql_error()); $query = mysql_query($sql) or die(mysql_error()); include '/website/library/closedb.php'; } ?> <html> <body> <form method="post"> <table width="700" border="0" cellpadding="2" cellspacing="1" align="center"> <tr> <td width="100">Title</td> <td><input name="word" type="text"></td> </tr> <tr> <td width="100">Read More</td> <td><input name="read_more" type="text"></td> <tr> </tr> <tr> <td width="100">Content</td> <td><input name="content" type="text"></td> </tr> <tr> <td colspan="2" align="center"><input name="save" type="submit" value="Add!"></td> </tr> </table> </form> </body> </html> Thanks in advance!
  22. Basically you will use this one: if (!isset($_GET["e"]) AND !isset($_GET["cc"])) { send to an error page } else { proceed... } as you want "BOTH" variables to contain a value. If you use this: if (!isset($_GET["e"]) OR !isset($_GET["cc"])) { send to an error page } else { procced... } You will tell PHP that at least one variable can be left without value, which is not what you want. Same if you tell someone to pick between "red OR blue"...you have to select only one.
  23. Hello all, my problem are in order so we can solve on at the time 1. My problem is after i fill a contact form, it says the file cannot be included, I've tried using the long format (C:\... so on) but nothing gets solved. 2. I don't use mysql-real-escape-string is this script as it is for personal use, but when I use mysql-real-escape-string, an error shows saying mysql-real-escape-string cannot be defined or so, I can't remember right now. 3. I have declared an else statement in case the form isn't filled up right, but it appears everytime i reload the page with the forms to fill. I hope I haven't blew your head with the explanation Here's the script: <?php //Get info for DB $name = $_POST['name']; $last_name = $_POST['last_name']; $phone = $_POST['phone']; $email = $_POST['email']; $contact_group = $_POST['contact_group']; $interests = $_POST['interests']; $extra_info = $_POST['extra_info']; if(isset($_POST['save'])) { //Now write it to DB include 'library/config.php'; include 'library/open.php'; //Query $sql = "INSERT INTO address_book (name, last_name, phone, email, contact_group, interests, extra_info, date_added) VALUES ('$name', '$last_name', '$phone', '$email', '$contact_group','$interests', '$extra_info', NOW())" or die(mysql_error()); $result = mysql_query($sql) or die(mysql_error()); include 'library/closedb.php'; //Everything has gone right... echo "Contact has been added!<a href=\"contact_add.php\"> Add more contacts</a> "; } else { //If an error has occured... echo "You didn't provide the correct information <a href=\"contact_add.php\"> Go back!</a>"; } ?> <html> <body> <form method="post"> <table width="700" border="0" cellpadding="2" cellspacing="1" align="center"> <tr> <td width="100">Name</td> <td><input name="name" type="text"></td> </tr> <tr> <td width="100">Last Name</td> <td><input name="last_name" type="text"></td> </tr> <tr> <td width="100">Phone Number</td> <td><input name="phone" type="text"></td> </tr> <tr> <td width="100">Email</td> <td><input name="email" type="text"></td> </tr> <tr> <td width="100">Group</td> <select name="contact_group"> <option value="friends">Friends</option> <option value="family">Family</option> <option value="brothers">Brothers</option> </select> </tr> <tr> <td width="100">Interests</td> <td><input name="interests" type="text"></td> </tr> <tr> <tr> <td width="100">Extra Info</td> <td><input name="extra_info" type="text"></td> </tr> <tr> <td colspan="2" align="center"><input name="save" type="submit" value="Add!"></td> </tr> </table> </form> </body> </html>
  24. Hello I hope this help: http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
×
×
  • 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.