Jump to content

bradkenyon

Members
  • Posts

    179
  • Joined

  • Last visited

    Never

Everything posted by bradkenyon

  1. i am making a quick content management system and i want to allow the user to press enter within the text field (textarea) and it will create a line break, like you would in any typical word processor. So it will display the content they typed into the field as w/ the line break from when they pressed enter. i hope i didn't make it too confusing.
  2. got a question, say you have a textarea, and you put content in there and throw it into a db table, then display it on webpage, if the user hits enter to put a line break in the textarea box of the form, how do i tell it to put it into the db as a line break, and display it on the webpage as a line break.
  3. has anyone ever heard of luminis? http://www.sct.com/Education/products/p_l_platform.html if so, what are your thoughts on it? i was thinking of using drupal, but my job may implement luminis. let me know, thanks.
  4. I appreciate all the information. A quick question about "validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;" I have never seen code like this before and was wondering if you can explain to me what is going on. I am assuming that it is checking to see if the email string contains valid characters followed by an '@' some more valid characters (a-z) then a period and finally a valid extension. Adain this my assumption and would appreciate a detailed breakdown of it for my knowledge. Thanks again! can't really offer you a detailed breakdown of it, all i know is, it works, and its javascript. i won't lie, i copy and paste a lot of things that i use, which is something i use. but all you really need to know is this works, just name your input field like: <input type="text" name="email">, then you're good to go for validation the email field. all that /^[^@]+ is regular expression, its better you get to the html form first, then begin worrying about the validation. i would say you would validate last.
  5. start off w/ this, its a pretty simple explanation of using a form and capturing the results w/ php. http://www.tizag.com/phpT/forms.php
  6. to setup a quick php server, use: http://sourceforge.net/projects/xampp/ to create a form, and to process the results: http://www.tizag.com/phpT/forms.php for sending the info in an email: http://us.php.net/mail here is an example: http://php.about.com/od/phpapplications/ss/form_mail.htm you will first create the html form... <form> <input type="text" name="first_name">...... </form> then you will use php to capture the results and then plug them into the mail function (php.net/mail) to send to wherever. for validation, for email (<input type="text" name="email">): if (document.forms[0].elements["email"].value == "") { window.alert("Please enter your email"); return false; } validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; strEmail = document.forms[0].email.value; // search email text for regular exp matches if (strEmail.search(validRegExp) == -1) { alert('A valid email address is required.\nPlease amend and retry'); return false; } for phone validation: http://www.developerfusion.co.uk/show/5630/ work on first creating the html form, then getting the results.
  7. mail($subemail,$subject,$body, "From: AdWorld <adworld@adworld.com>"); it will display AdWorld as the from name, within the email client, and the reply will be adworld@adworld.com
  8. not 100% sure on how this can be done, but i did a quick google and found this site: http://www.sitepoint.com/article/image-resizing-php hope it helps. gl!
  9. <? sleep(10); header("Location: http://www.example.com/"); ?>
  10. $filename = 'test.txt'; header("Content-Length: " . filesize($filename)); header('Content-Type: application/text'); readfile($filename);
  11. try looking up pagination http://php.about.com/od/phpwithmysql/ss/php_pagination.htm
  12. using this now: $query = "SELECT m.`fname` FROM `d_media` m INNER JOIN `library_docs` d ON d.`file_id`=m.`id` WHERE d.`id`={$docid}"; runs much quicker. thank you.
  13. i think it does the trick. not sure what you mean to modify my join syntax, kind of new at this. i was thinking you could find fname without having to loop thru the table.
  14. thanks, that works. another question. it seems to take 5-10 seconds to run this script, is there a way to make it run through the loop quicker, or just do it without a loop and go right to that row in the table and grab the fname without having to loop thru?? $docid = $_GET['id']; $query = "SELECT *,library_docs.id as lid FROM library_docs,d_media WHERE d_media.id = library_docs.file_id AND library_docs.id=".$docid.""; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $attachment = dirname(__FILE__)."/../../uploads/documents/".$row['fname']; } thanks!
  15. stuck at this: "SELECT *,library_docs.id as lid FROM library_docs,d_media WHERE d_media.id = library_docs.file_id AND library_docs.id = $docid";
  16. never joined two tables before. i am looking to get 'fname' from table 'd_media', to add to $attachment tables 'd_media' and 'library_docs' are related by column 'file_id' within table 'library_docs', which matches the 'id' in table 'd_media' $docid = $_GET['id']; $query = "SELECT id, id FROM d_media, library_docs WHERE id = $docid"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $attachment = dirname(__FILE__)."/../../uploads/documents/"$row['fname']; //print $attachment; } to sum it up, it takes the id passed in, looks the id up in the library_docs table, then grabs the file_id from that table, then goes to d_media table w/ that file_id and grabs fname from that file_id, which is called id in d_media table. thanks in advance!
  17. try javascript, it's easy to implement, if you're worried w/ users not enabling js, then keep trying.
  18. are you using any javascript validation on this page? if not, you should, it will alert the user to complete the form before being able to successfully submit it.
  19. http://www.php.net/substr substr($text, 0, 32); $text is the string you want to cut, then 0 is the starting point, 0 being the beginning, then 32 being the 32nd character in the string.
  20. i want to take an excel file (.xls) that is pre formatted, and will be stored on the server, and will be updated often. is there a way that file can be read by php and outputted as an html form onto a webpage. the file is an excel file which was built as a form to be filled out. i need to then take the results from the html form and plug them into the appropriate cells on the .xls file, and force the user to either open the file as a .xls or save it. i looked into http://sourceforge.net/projects/phpexcelreader/, but doesn't seem to be the thing that will do everything i ask for. i need to keep the formatting intact. thanks in advance for any guidance.
  21. Hey I’m running into a problem with a piece of php code and I can’t think of the term used. But I’m trying to save a file to: \\vpvault\Backup\Miller\ The code doesn’t like the 2 ‘\’ next to each other, how would I get around that?
  22. $imgurl = '<img src="/images/icons/img.jpg">'; doctypes = array(array("label"=>"(select type)","value"=>""), array("label"=>"A4","value"=>"$imgurl")); i am trying to output the drop down w/ select type, and A4, but A4 has the value of <img src="/images/icons/img.jpg">, but it stores that value in the db as <img src= also, in the drop down, it lists A4, and adds a bit of the html into the drop down field, as you'll see in the image. this is the html of it in the source code: <select name='D_doctype' size='1' /><option value="">(select type)</option> <option value="<img src="/images/icons/img.jpg">">A4</option> </select> does anyone know why it only stores <img src= in the db table, i put addslashes around it when its inserted into the database, as well as why the html source code is being displayed funny in the drop down, but looks fine in the source code.
  23. print date('F j, Y', strtotime($sql->('edate'))); doesn't work. gives me the following error: Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in archives.php on line 67
×
×
  • 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.