Search Results

Search found 5637 results on 226 pages for 'triple slash comments'.

Page 33/226 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • mySQL not saving data?

    - by tony noriega
    i have a PHP contact form that submits data, and an email...: <?php $dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("guest"); if (isset($_POST['submit'])) { if (!$_POST['name'] | !$_POST['email']) { echo"<div class='error'>Error<br />Please provide your Name and Email Address so we may properly contact you.</div>"; } else { $age = $_POST['age']; $name = $_POST['name']; $gender = $_POST['gender']; $email = $_POST['email']; $phone = $_POST['phone']; $comments = $_POST['comments']; $query = "INSERT INTO contact_us (age,name,gender,email,phone,comments) VALUES ('$age','$name','$gender','$email','$phone','$comments')"; mysql_query($query); mysql_close(); $yoursite = "Mysite "; $youremail = $email; $subject = "Website Guest Contact Us Form"; $message = "$name would like you to contact them Contact PH: $phone Email: $email Age: $age Gender: $gender Comments: $comments"; $email2 = "[email protected]"; mail($email2, $subject, $message, "From: $email"); echo"<div class='thankyou'>Thank you for contacting us,<br /> we will respond as soon as we can.</div>"; } } ?> The email is coming through fine, but the data is not storing the dbase... am i missing something? Its the same script as i use on another contact us page, only difference is instead of parsing the data on teh same page, i now send this data to a "thankyou.php" page... i tried changing $_POST to $_GET but that killed the page... what am i doing wrong?

    Read the article

  • What are some methods to prevent double posting in a form? (PHP)

    - by jpjp
    I want to prevent users from accidentally posting a comment twice. I use the PRG (post redirect get) method, so that I insert the data on another page then redirect the user back to the page which shows the comment. This allows users to refresh as many times as they want. However this doesn't work when the user goes back and clicks submit again or when they click submit 100 times really fast. I don't want 100 of the same comments. I looked at related questions on SO and found that a token is best. But I am having trouble using it. //makerandomtoken(20) returns a random 20 length char. <form method="post" ... > <input type="text" id="comments" name="comments" class="commentbox" /><br/> <input type="hidden" name="_token" value="<?php echo $token=makerandomtoken(20); ?>" /> <input type="submit" value="submit" name="submit" /> </form> if (isset($_POST['submit']) && !empty($comments)) { $comments= mysqli_real_escape_string($dbc,trim($_POST['comments'])); //how do I make the if-statment to check if the token has been already set once? if ( ____________){ //don't insert comment because already clicked submit } else{ //insert the comment into the database } } So I have the token as a hidden value, but how do I use that to prevent multiple clicking of submit. METHODS: someone suggested using sessions. I would set the random token to $_SESSION['_token'] and check if that session token is equal to the $_POST['_token'], but how do I do that? When I tried, it still doesn't check

    Read the article

  • Ruby-on-Rails: Multiple has_many :through possible?

    - by williamjones
    Is it possible to have multiple has_many :through relationships that pass through each other in Rails? I received the suggestion to do so as a solution for another question I posted, but have been unable to get it to work. Friends are a cyclic association through a join table. The goal is to create a has_many :through for friends_comments, so I can take a User and do something like user.friends_comments to get all comments made by his friends in a single query. class User has_many :friendships has_many :friends, :through => :friendships, :conditions => "status = #{Friendship::FULL}" has_many :comments has_many :friends_comments, :through => :friends, :source => :comments end class Friendship < ActiveRecord::Base belongs_to :user belongs_to :friend, :class_name => "User", :foreign_key => "friend_id" end This looks great, and makes sense, but isn't working for me. This is the error I'm getting in relevant part when I try to access a user's friends_comments: ERROR: column users.user_id does not exist : SELECT "comments".* FROM "comments" INNER JOIN "users" ON "comments".user_id = "users".id WHERE (("users".user_id = 1) AND ((status = 2))) When I just enter user.friends, which works, this is the query it executes: : SELECT "users".* FROM "users" INNER JOIN "friendships" ON "users".id = "friendships".friend_id WHERE (("friendships".user_id = 1) AND ((status = 2))) So it seems like it's entirely forgetting about the original has_many through friendship relationship, and then is inappropriately trying to use the User class as a join table. Am I doing something wrong, or is this simply not possible?

    Read the article

  • Is this the correct way to set up has many with multiple associations?

    - by user323763
    I'm trying to set up a new project for a music site. I'm learning ROR and am a bit confused about how to make join models/tables. Does this look right? I have users, playlists, songs, and comments. Users can have multiple playlists. Users can have multiple comments on their profile. Playlists can have multiple songs. Playlists can have comments. Songs can have comments. class CreateTables < ActiveRecord::Migration def self.up create_table :users do |t| t.string :login t.string :email t.string :firstname t.string :lastname t.timestamps end create_table :playlists do |t| t.string :title t.text :description t.timestamps end create_table :songs do |t| t.string :title t.string :artist t.string :album t.integer :duration t.string :image t.string :source t.timestamps end create_table :comments do |t| t.string :title t.text :body t.timestamps end create_table :users_playlists do |t| t.integer :user_id t.integer :playlist_id t.timestamps end create_table :playlists_songs do |t| t.integer :playlist_id t.integer :song_id t.integer :position t.timestamps end create_table :users_comments do |t| t.integer :user_id t.integer :comment_id t.timestamps end create_table :playlists_comments do |t| t.integer :playlist_id t.integer :comment_id t.timestamps end create_table :songs_comments do |t| t.integer :song_id t.integer :comment_id t.timestamps end end def self.down drop_table :playlists drop_table :comments drop_table :songs_comments drop_table :users_comments drop_table :users_playlists drop_table :users drop_table :playlists drop_table :songs drop_table :playlists end end

    Read the article

  • On Linux, why does directory tab completion add a \ to a path starting with ~

    - by crobar
    On my work scientific linux 6.2 machine, I often start typing in a directory like below and use tab completion to finish it: ~/mydir But when I hit tab, it becomes e.g. \~/mydirectory/ With an extra forward slash at the start. Why is this, and can I prevent it? It's a pain because using cd etc. doesn't work with the extra slash, I have to start from the actual home directory which is something like /home/username/ On these PCs.

    Read the article

  • Errors after Google Chrome downgrade

    - by user1933153
    I'm downloaded version 37.0 of Google Chrome but, few plugins and extensions didn't worked. I'm uninstalled that version and install 35.0 again, but now i have some errors. After every Chrome start i get these windows: http://i.imgur.com/rjB1SWJ.png , http://i.imgur.com/gfBa5Ju.png , http:(slash,slash)i(dot)imgur(dot)com/5opKTPE.png And every time i start chrome, i get these errors, it's really annoying, do you have idea how to fix that, or at least hide?

    Read the article

  • Regex replace help

    - by Jeremy
    Using the .NET framework, I'm trying to replace double slash characters in a string with a single slash, but it seems to be removing an extra character and I don't know why. I have a string: http://localhost:4170/RCRSelfRegistration//Default.aspx My regex is: [^(://|:\\\\)](\\\\|//|\\/|/\\) And the return value is: http://localhost:4170/RCRSelfRegistratio/Default.aspx You can see that the n in RCRSelfRegistration has been removed. I am not sure why. /// <summary> /// Match on double slashes (//, \\, /\, \/) but do not match :// or :\\ /// </summary> private const string strMATCH = @"[^(://|:\\\\)](\\\\|//|\\/|/\\)"; /// <summary> /// Replace double slashes with single slash /// </summary> /// <param name="strUrl"></param> /// <returns></returns> public static string GetUrl(string strUrl) { string strNewUrl System.Text.RegularExpressions.Regex rxReplace = new System.Text.RegularExpressions.Regex(strMATCH); strNewUrl = rxReplace.Replace(strUrl, "/"); return strNewUrl; }

    Read the article

  • Accessing py2exe program over network in Windows 98 throws ImportErrors

    - by darvids0n
    I'm running a py2exe-compiled python program from one server machine on a number of client machines (mapped to a network drive on every machine, say W:). For Windows XP and later machines, have so far had zero problems with Python picking up W:\python23.dll (yes, I'm using Python 2.3.5 for W98 compatibility and all that). It will then use W:\zlib.pyd to decompress W:\library.zip containing all the .pyc files like os and such, which are then imported and the program runs no problems. The issue I'm getting is on some Windows 98 SE machines (note: SOME Windows 98 SE machines, others seem to work with no apparent issues). What happens is, the program runs from W:, the W:\python23.dll is, I assume, found (since I'm getting Python ImportErrors, we'd need to be able to execute a Python import statement), but a couple of things don't work: 1) If W:\library.zip contains the only copy of the .pyc files, I get ZipImportError: can't decompress data; zlib not available (nonsense, considering W:\zlib.pyd IS available and works fine with the XP and higher machines on the same network). 2) If the .pyc files are actually bundled INSIDE the python exe by py2exe, OR put in the same directory as the .exe, OR put into a named subdirectory which is then set as part of the PYTHONPATH variable (e.g W:\pylib), I get ImportError: no module named os (os is the first module imported, before sys and anything else). Come to think of it, sys.path wouldn't be available to search if os was imported before it maybe? I'll try switching the order of those imports but my question still stands: Why is this a sporadic issue, working on some networks but not on others? And how would I force Python to find the files that are bundled inside the very executable I run? I have immediate access to the working Windows 98 SE machine, but I only get access to the non-working one (a customer of mine) every morning before their store opens. Thanks in advance! EDIT: Okay, big step forward. After debugging with PY2EXE_VERBOSE, the problem occurring on the specific W98SE machine is that it's not using the right path syntax when looking for imports. Firstly, it doesn't seem to read the PYTHONPATH environment variable (there may be a py2exe-specific one I'm not aware of, like PY2EXE_VERBOSE). Secondly, it only looks in one place before giving up (if the files are bundled inside the EXE, it looks there. If not, it looks in library.zip). EDIT 2: In fact, according to this, there is a difference between the sys.path in the Python interpreter and that of Py2exe executables. Specifically, sys.path contains only a single entry: the full pathname of the shared code archive. Blah. No fallbacks? Not even the current working directory? I'd try adding W:\ to PATH, but py2exe doesn't conform to any sort of standards for locating system libraries, so it won't work. Now for the interesting bit. The path it tries to load atexit, os, etc. from is: W:\\library.zip\<module>.<ext> Note the single slash after library.zip, but the double slash after the drive letter (someone correct me if this is intended and should work). It looks like if this is a string literal, then since the slash isn't doubled, it's read as an (invalid) escape sequence and the raw character is printed (giving W:\library.zipos.pyd, W:\library.zipos.dll, ... instead of with a slash); if it is NOT a string literal, the double slash might not be normpath'd automatically (as it should be) and so the double slash confuses the module loader. Like I said, I can't just set PYTHONPATH=W:\\library.zip\\ because it ignores that variable. It may be worth using sys.path.append at the start of my program but hard-coding module paths is an absolute LAST resort, especially since the problem occurs in ONE configuration of an outdated OS. Any ideas? I have one, which is to normpath the sys.path.. pity I need os for that. Another is to just append os.getenv('PATH') or os.getenv('PYTHONPATH') to sys.path... again, needing the os module. The site module also fails to initialise, so I can't use a .pth file. I also recently tried the following code at the start of the program: for pth in sys.path: fErr.write(pth) fErr.write(' to ') pth.replace('\\\\','\\') # Fix Windows 98 pathing issues fErr.write(pth) fErr.write('\n') But it can't load linecache.pyc, or anything else for that matter; it can't actually execute those commands from the looks of things. Is there any way to use built-in functionality which doesn't need linecache to modify the sys.path dynamically? Or am I reduced to hard-coding the correct sys.path?

    Read the article

  • appending multiple groups with values from xml

    - by zurna
    In my xml file comments are listed as <Comments> <CommentID id="1"> <CommentBy>efet</CommentBy> <CommentDesc> Who cares!!! My boyfriend thinks the same with me. tell your friends. </CommentDesc> </CommentID> <CommentID id="2"> <CommentBy>tetto</CommentBy> <CommentDesc> xyz.... </CommentDesc> </CommentID> </Comments> I need to append them inside the ul of the div id="nw-comments". <div id="nw-comments" class="article-page"> <h3>Member Comments</h3> <ul> <li class="top-level"> <ul class="comment-options right"> <li> <a id="reply_1272195" class="reply" href="javascript:void(0);" name="anchor_1272195">Reply</a> </li> <li class="last"> <a id="report_1272195" class="report" href="javascript:void(0);">Report Abuse</a> </li> </ul> <h6>Posted By: [CommentBy] @ [CommentDateEntered]</h6> <div class="post-content"> <p>[CommentDesc]</p> </div> </li> </ul> </div> I tried to do it with the following code but I keep getting errors. $(document).ready(function(){ $.ajax({ dataType: "xml", url: "/FLPM/content/news/news.cs.asp?Process=ViewNews&NEWSID=<%=Request.QueryString("NEWSID")%>", success: function(xml) { $(xml).find('row').each(function(){ var id = $(this).attr('id'); var FullName = $(this).find('FullName').text(); var CommentBy = $(this).find('CommentBy').text(); var CommentDateEntered = $(this).find('CommentDateEntered').text(); var CommentDesc = $(this).find('CommentDesc').text(); $("#nw-comments ul").append("<h6>Posted By: " + CommentBy + " @ " + CommentDateEntered + "</h6><div class=""post-content""><p>" + CommentDesc + "</p></div>"); }); } });

    Read the article

  • What is the best way to remove duplicate files on web hosting's FTP server?

    - by Eric Harrison
    For some reason(Happened before I started working on this project)- my client's website has 2 duplicates of every single file. Effectively tripling the size of the site. The files look much like this: wp-comments-post.php | 3,982 bytes wp-comments-post (john smith's conflicted copy 2012-01-12).php | 3,982 bytes wp-comments-post (JohnSmith's conflicted copy 2012-01-14).php | 3,982 bytes The hosting that the website is on has no access to bash or SSH. In your opinion, what would be the easiest way to delete these duplicate files that would take the least time?

    Read the article

  • Using AJAX to display error message Ruby on Rails

    - by bgadoci
    I have built a blog using Ruby on Rails. New to both. I am implementing AJAX pretty effectively until I get to the error handling portion. I allow for comments on posts and do this by rendering a comment partial and remote form in the /views/posts/show.html.erb page. Upon successful save of a comment the show page is updated using views/comments/create.js.rjs and displays a flash notice. I am simply trying to flash a notice when it doesn't save. Searched around and worked this a bit on my own. Can't get it to fly. Here is my code: /views/posts/show.html.erb <div id="comments"> <%= render :partial => @post.comments %> <div id="notice"><%= flash[:notice] %></div> </div> <% remote_form_for [@post, Comment.new] do |f| %> <p> <%= f.label :body, "New Comment" %><br/> <%= f.text_area (:body, :class => "textarea") %> </p> <p> <%= f.label :name, "Name" %><br/> <%= f.text_field (:name, :class => "textfield") %> </p> <p> <%= f.label :email, "Email" %><br/> <%= f.text_field (:email, :class => "textfield") %> </p> <p><%= f.submit "Add Comment" %></p> <% end %> /views/comments/_comment.html.erb <% div_for comment do %> <div id="comment-wrapper"> <% if admin? %> <div id="comment-destroy"><%=link_to_remote "X", :url => [@post, comment], :method => :delete %></div> <% end %> <%= h(comment.body) %><br/><br/> <div class="small">Posted <%= time_ago_in_words(comment.created_at) %> ago by <%= h(comment.name) %> <% if admin? %> | <%= h(comment.email) %> <% end %></div> </div> <% end %> /views/comments/create.js.rjs page.insert_html :bottom, :comments, :partial => @comment page[@comment].visual_effect :highlight page[:new_comment].reset page.replace_html :notice, flash[:notice] flash.discard CommentsController#create def create @post = Post.find(params[:post_id]) @comment = @post.comments.create!(params[:comment]) respond_to do |format| if @comment.save flash[:notice] = "Thanks for adding this comment" format.html { redirect_to @post } format.js else flash[:notice] = "Make sure you include your name and a valid email address" format.html { redirect_to @post } format.js end end end

    Read the article

  • how to user ajax with json in ruby on rails

    - by fenec
    I am implemeting a facebook application in rails using facebooker plugin, therefore it is very important to use this architecture if i want to update multiple DOM in my page. if my code works in a regular rails application it would work in my facebook application. i am trying to use ajax to let the user know that the comment was sent, and update the comments bloc. migration: class CreateComments < ActiveRecord::Migration def self.up create_table :comments do |t| t.string :body t.timestamps end end def self.down drop_table :comments end end controller: class CommentsController < ApplicationController def index @comments=Comment.all end def create @comment=Comment.create(params[:comment]) if request.xhr? @comments=Comment.all render :json=>{:ids_to_update=>[:all_comments,:form_message], :all_comments=>render_to_string(:partial=>"comments" ), :form_message=>"Your comment has been added." } else redirect_to comments_url end end end view: <script> function update_count(str,message_id) { len=str.length; if (len < 200) { $(message_id).innerHTML="<span style='color: green'>"+ (200-len)+" remaining</span>"; } else { $(message_id).innerHTML="<span style='color: red'>"+ "Comment too long. Only 200 characters allowed.</span>"; } } function update_multiple(json) { for( var i=0; i<json["ids_to_update"].length; i++ ) { id=json["ids_to_update"][i]; $(id).innerHTML=json[id]; } } </script> <div id="all_comments" > <%= render :partial=>"comments/comments" %> </div> Talk some trash: <br /> <% remote_form_for Comment.new, :url=>comments_url, :success=>"update_multiple(request)" do |f|%> <%= f.text_area :body, :onchange=>"update_count(this.getValue(),'remaining');" , :onkeyup=>"update_count(this.getValue(),'remaining');" %> <br /> <%= f.submit 'Post'%> <% end %> <p id="remaining" >&nbsp;</p> <p id="form_message" >&nbsp;</p> <br><br> <br> if i try to do alert(json) in the first line of the update_multiple function , i got an [object Object]. if i try to do alert(json["ids_to_update"][0]) in the first line of the update_multiple function , there is no dialog box displayed. however the comment got saved but nothing is updated. questions: 1.how can javascript and rails know that i am dealing with json objects? 2.how can i debug this problem? 3.how can i get it to work?

    Read the article

  • Formatting php, what works more efficiently?

    - by JamesM-SiteGen
    Hello fellow programmers, I was just wondering what makes php work faster, I have a few methods that I always go and do, but that only improves the way I can read it, but how about the interpreter? Should I include the curly braces when there is only one statement to run? if(...){ echo "test"; } # Or.. if(...) echo "test"; === Which should be used? I have also found http://beta.phpformatter.com/ and I find the following settings to be good, but are they? Indentation: Indentation style: {K&R (One true brace style)} Indent with: {Tabs} Starting indentation: [1] Indentation: [1] Common: [x] Remove all comments [x] Remove empty lines [x] Align assignments statements nicely [ ] Put a comment with the condition after if, while, for, foreach, declare and catch statements Improvement: [x] Remove lines with just a semicolon (;) [x] Make normal comments (//) from perl comments (#) [x] Make long opening tag (<?php) from short one (<?) Brackets: [x] Space inside brackets- ( ) [x] Space inside empty brackets- ( ) [x] Space inside block brackets- [ ] [x] Space inside empty block brackets- [ ] Tiny var names: often I go through my code and change $var1 to $a, $var2 to $b and so on. I do include comments at the start of the file to show to me what each letter(s) mean.. Final note: So am I doing the right thing with the curly braces and the settings? Are there any great tips that help it run faster?

    Read the article

  • Canonical url for a home page and trailing slashes

    - by serg
    My home page could be potentially linked as: http://example.com http://example.com/ http://example.com/?ref=1 http://example.com/index.html http://example.com/index.html?ref=2 (the same page is served for all those urls) I am thinking about defining a canonical url to make sure google doesn't consider those urls to be different pages: <link rel="canonical" href="/" /> (relative) <link rel="canonical" href="http://example.com/" /> (trailing slash) <link rel="canonical" href="http://example.com" /> (no trailing slash) Which one should be used? I would just slap / but messing with canonical seems like a scary business so I wanted double check first. Is it a good idea at all for defining a canonical url for a home page?

    Read the article

  • Dual monitor setup with Intel graphics and Nvidia Geforce GT 425M on 12.04

    - by fo_x86
    I have a Dell XPS L401x and just installed 12.04. I have a mini-display and an HDMI output, and I could hook up two Dell UltraSharp monitors to each port on Windows 7, and get a triple monitor setup. Doing a bit of research, it seems like the mini-display is wired to the integrated graphics card whereas HDMI is hooked up to Nvidia graphics card. I've also installed Bumblebee as it seemed like that was the proper way of installing Nvidia drivers on Ubuntu. At the moment none of my monitors is being recognized by Ubuntu. Is it even possible to have a triple monitor (laptop display + 2 external) setup? Has anyone successfully done this?

    Read the article

  • Getting Selected Dropdown content to show in a form-generated email

    - by fmz
    I have a small contact form: <form method="post" action="contact.php" name="contactform" id="contactform"> <fieldset> <legend>Please fill in the following form to contact us</legend> <label for="name"><span class="required">*</span> Your Name</label> <input name="name" type="text" id="name" size="30" value="" /> <br /> <label for="company"><span class="required">*</span> Company</label> <input name="company" type="text" id="name" size="30" value="" /> <br /> <label for="email"><span class="required">*</span> Email</label> <input name="email" type="text" id="email" size="30" value="" /> <br /> <label for="phone"><span class="required">*</span> Phone</label> <input name="phone" type="text" id="phone" size="30" value="" /> <br /> <label for="purpose"><span class="required">*</span> Purpose</label> <select id="purpose" style="width: 300px; height:35px;"> <option value="I am interested in your services">I am interested in your services!</option> <option value="I am interested in a partnership">I am interested in a partnership!</option> <option value="I am interested in a job">I am interested in a job!</option> </select> <br /> <label for=comments><span class="required">*</span> Comments</label> <textarea name="comments" cols="40" rows="3" id="comments" style="width: 350px;"></textarea> <p><span class="required">*</span> Please help us control spam.</p> <label for=verify accesskey=V>&nbsp;&nbsp;&nbsp;3 + 1 =</label> <input name="verify" type="text" id="verify" size="4" value="" style="width: 30px;" /><br /><br /> <input type="submit" class="submit" id="submit" value="Submit" /> </fieldset> </form> I want to send the results of the form in a php generated email. Everything is coming through except the selected contents of the "purpose" drop down. Here is the PHP: <?php if(!$_POST) exit; $name = $_POST['name']; $company = $_POST['company']; $email = $_POST['email']; $phone = $_POST['phone']; $purpose = $_POST['purpose']; $comments = $_POST['comments']; $verify = $_POST['verify']; if(trim($name) == '') { echo '<div class="error_message">Attention! You must enter your name.</div>'; exit(); } else if(trim($company) == '') { echo '<div class="error_message">Attention! Please enter your company name.</div>'; exit(); } else if(trim($email) == '') { echo '<div class="error_message">Attention! Please enter a valid email address.</div>'; exit(); } else if(trim($phone) == '') { echo '<div class="error_message">Attention! Please enter a valid phone number.</div>'; exit(); } else if(!isEmail($email)) { echo '<div class="error_message">Attention! You have enter an invalid e-mail address, try again.</div>'; exit(); } if(trim($comments) == '') { echo '<div class="error_message">Attention! Please enter your message.</div>'; exit(); } else if(trim($verify) == '') { echo '<div class="error_message">Attention! Please enter the verification number.</div>'; exit(); } else if(trim($verify) != '4') { echo '<div class="error_message">Attention! The verification number you entered is incorrect.</div>'; exit(); } if($error == '') { if(get_magic_quotes_gpc()) { $comments = stripslashes($comments); } // Configuration option. // Enter the email address that you want to emails to be sent to. // Example $address = "[email protected]"; $address = "[email protected]"; // Configuration option. // i.e. The standard subject will appear as, "You've been contacted by John Doe." // Example, $e_subject = '$name . ' has contacted you via Your Website.'; $e_subject = 'You\'ve been contacted by ' . $name . '.'; // Configuration option. // You can change this if you feel that you need to. // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here. $e_body = "You have been contacted by $name.\r\n\n"; $e_content = "Comments: \"$comments\"\r\n\n"; $e_company = "Company: $company\r\n\n"; $e_purpose = "Reason for contact: $purpose\r\n"; $e_reply = "You can contact $name via email, $email or via phone $phone"; $msg = $e_body . $e_content . $e_company . $e_purpose . $e_reply; if(mail($address, $e_subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n")) { // Email has sent successfully, echo a success page. echo "<fieldset>"; echo "<div id='success_page'>"; echo "<h1>Email Sent Successfully.</h1>"; echo "<p>Thank you <strong>$name</strong>, your message has been submitted to us.</p>"; echo "</div>"; echo "</fieldset>"; } else { echo 'ERROR!'; } } function isEmail($email) { // Email address verification, do not edit. return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); } ?> What am I missing? Thanks.

    Read the article

  • Why "Tailoring" Your Resume Is Bad

    - by Mike C
    I was just writing a response to a comment on my "Sell Yourself!" presentation ( http://sqlblog.com/blogs/michael_coles/archive/2010/12/05/sell-yourself-presentation.aspx#comments ), and it started getting a little lengthy so I decided to turn it into a blog post. The "Sell Yourself!" post got a couple of very good comments on the blog, and quite a few more comments offline. I think I'll start this one with a great exchange from the movie "The Princess Bride": Vizzini: HE DIDN'T FALL? INCONCEIVABLE....(read more)

    Read the article

  • Text editor with coloring to highlight "non-parameters" in conf files?

    - by Zabba
    Some .conf files have a lot of comments and parameters in them like so: # WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z # This will prevent nmbd to search for NetBIOS names through DNS. dns proxy = no ..... It gets difficult to look for only the parameters among the plethora of comments, so, is there some text editor that can highlight the comments in dark grey so that the real parameters stand out?

    Read the article

  • Spam prevention through IP tracking

    - by whamsicore
    I am building a website with user generated comments. In order to implement user moderation/spam-protection, users have the ability to mark comments as spam. When one comment is marked as spam, I want all comments from the same IP address to be deleted. I am not familiar with spam prevention in general, other than Captcha. Question: is this a feasible/good system for spam prevention? are there better ways, or improvements I can make? Thanks.

    Read the article

  • mod_rewrite "Request exceeded the limit of 10 internal redirects due to probable configuration error."

    - by Shoaibi
    What i want: Force www [works] Restrict access to .inc.php [works] Force redirection of abc.php to /abc/ Removal of extension from url Add a trailing slash if needed old .htaccess : Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ### Force www RewriteCond %{HTTP_HOST} ^example\.net$ RewriteRule ^(.*)$ http://www\.example\.net/$1 [L,R=301] ### Restrict access RewriteCond %{REQUEST_URI} ^/(.*)\.inc\.php$ [NC] RewriteRule .* - [F,L] #### Remove extension: RewriteRule ^(.*)/$ /$1.php [L,R=301] ######### Trailing slash: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://www.example.net/$1/ [R=301,L] </IfModule> New .htaccess: Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ### Force www RewriteCond %{HTTP_HOST} ^example\.net$ RewriteRule ^(.*)$ http://www\.example\.net/$1 [L,R=301] ### Restrict access RewriteCond %{REQUEST_URI} ^/(.*)\.inc\.php$ [NC] RewriteRule .* - [F,L] #### Remove extension: RewriteCond %{REQUEST_FILENAME} \.php$ RewriteCond %{REQUEST_FILENAME} -f RewriteRule (.*)\.php$ /$1/ [L,R=301] #### Map pseudo-directory to PHP file RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule (.*) /$1.php [L] ######### Trailing slash: RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME} !/$ RewriteRule (.*) $1/ [L,R=301] </IfModule> errorlog: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.example.net/ Rewrite.log: http://pastebin.com/x5PKeJHB

    Read the article

  • Need Info on the Hidden Switch in SET - "/S" How to implement

    - by ttyl
    I am having some problems doing a proper search of "SET/S" or "SET /S" on google and other search providers. The difficulty arises with the SLASH "/", it is commonly used in search engines to add a "nearness" to the search parameter. I have found no way to escape the SLASH when searching for a SLASH. For those on this community, try searching this domain with the two search terms listed above. It just doesn't work, it ends up looking for SET S instead. But I digress. So Im asking the uber-guru's on this board to help me find out about the documentation of /S and how to implement SET /S in a batch file. SET is an internal DOS/cmd commandand allows many things incuding prompting the user, integer math and writing environment strings. in looking at this link: http://www.robvanderwoude.com/os2set.php it appears that the /S is only for OS2 but im thinking that this might not be the case, due to this: http://www.dostips.com/forum/viewtopic.php?t=2704, apparently used with substings and macros. any help is much appreciated

    Read the article

  • Handbrake-powered VidCoder gets a native 64-bit version

    A while back, VidCoder -- the Windows video disc ripping program -- added support for Blu-ray discs. With Handbrake's engine under the hood, VidCoder offers an easy-to-use interface and simple batch processing of your video files. With the release of version 0.8, there's also now a native 64-bit version for those of you running Windows x64. A number of stability tweaks have also been introduced. As Baz pointed out in our comments last time, VidCoder is particular useful on netbooks. If you've got a 1024x600 screen, Handbrake may not even launch for you -- but VidCoder will fire up just fine. Take the new 64-bit version for a spin, and share your thoughts in the comments. Download VidCoderHandbrake-powered VidCoder gets a native 64-bit version originally appeared on Download Squad on Fri, 07 Jan 2011 17:00:00 EST. Please see our terms for use of feeds.Permalink | Email this | Comments

    Read the article

  • Best wiki engine to use?

    - by Ross
    Hi, I'm looking to set up a wiki as a simple CMS for a resource page. Mostly just pdfs and word documents will be hosted, but the two main features I'm looking for is the ability to restrict pages based upon user privileges and for blog-style comments between the users. From what I've researched, mediawiki can easily do the first part with restricting users, but I haven't had much luck finding any plugins for comments. I'm trying to avoid the discussion style pages from wikipedia, and have more of a comments just under the article. So far I'm leaning towards trying Tiki out, any other recommendations?

    Read the article

  • How to organize continuous code reviews?

    - by yegor256
    We develop in branches. Before a branch gets merged into the main stream (master branch) we review the changes made, by creating a new "code review" in Crucible. Reviewers add their comments to the code review and the ticket/branch gets bounced back to the author, if it needs to be improved. After the improvements are made we get this branch/ticket again back to the code review. We again create a new code review in Crucible, loosing all previously made comments. We simply start from scratch. It's a big waste of time. Do you know any tools that support a continuous mode for reviews, where we don't need to start from scratch every time, but can pick up the comments already made (re-start the review, so to speak).

    Read the article

  • How does PHP5 fare with earlier versions of the language

    - by Pankaj Upadhyay
    I would like to learn PHP for web development but have been drawn back because of comments like the following*: PHP is good but generates spaghetti code PHP is nice but Python is marriage material PHP lacks stuff that you get in other languages like C# or Java But for PHP5 I have seen some promising comments. So, my question is: How does PHP5 fare with earlier versions of the language and is it good enough now to learn for web development. * Comments are just for reference not to incite a flame war. No comparison of PHP with other languages is asked for here. Please comment just on PHP5 and how it compares with earlier versions.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >