Jump to content

ChaosKnight

Members
  • Posts

    183
  • Joined

  • Last visited

    Never

Everything posted by ChaosKnight

  1. Well, they paid a large sum of money to be the only website that may use the live friend activity update idea... They describe it as: “A method for displaying a news feed in a social network environment is described. The method includes generating news items regarding activities associated with a user of a social network environment and attaching an informational link associated with at least one of the activities, to at least one of the news items, as well as limiting access to the news items to a predetermined set of viewers and assigning an order to the news items. The method further may further include displaying the news items in the assigned order to at least one viewing user of the predetermined set of viewers and dynamically limiting the number of news items displayed.” Here is an article about it: http://mashable.com/2010/02/25/facebook-news-feed-patent/
  2. Is there a simple tutorial on using PHPMailer? Or a simpler way for sending e-mail? As I said, it's only a very temporary use, I don't want to spend much time on this, seeing that I have to remove it in a couple of months...
  3. I don't have an answer actually, but be careful mate... Facebook patented the whole "Has just become friends with billy", concept... As well as any form of real-time activity updates...
  4. Sorry, I meant to say DISTINCT, don't know why I said UNIQUE... lol ... But if it's working now, then it's super
  5. Okay, so I have a script for a "contact us" form that inserts an entry in the database (which works), but because this a brand new system for the company, they requested that for the first few months they also want to receive a similar e-mail message... I never actually used PHP Mail before, seeing that I like the functionality of the database more... Here is a code snippet of the action for the form that I wrote: <?php if (isset($_POST['name']) && isset($_POST['email'])){ $email_to = $mail_address; $email_msg = $_POST['message']; $email_subj = $_POST['subject']; if(mail($email_to,$email_subj,$email_msg)) { echo("<h3>Message successfully sent...</h3>"); }else{ echo("<h3>Message could not be delivered...</h3>"); } } ?> But when I try to send it, it fails... I contacted the client's shared hosting company, but they said that they didn't have any PHP mailing support but I can write a custom script that includes the SMTP address and password, etc. My question is: How can I set this up and send an email message that works? Any help would be greatly appreciated
  6. Hi, the site that I'm busy with has a lot of seperate images that is used for the header banner, etc. Inside every other browser, it displays as expected, except for Internet Explorer... Here is the CSS: #header img { margin: 0px; padding: 0px; float: left; display: inline; _margin: 0px; _padding: 0px; } #nav img { margin: 0px; padding: 0px; float: left; display: inline; _margin: 0px; _padding: 0px; } I tried everything that I heard of, even the underscore prefix that is also said to be what IE is looking for... Although the code states padding: 0px, it seems that IE is inserting the default padding... Any help will be deeply appreciated! This layout problem occurred in IE 7
  7. Do you know how much I love you right now?? Thanks to TeddyKiller and Pikachu2000 for all your help! And to Pikachu's eagle eyes LOL Problem solved!!
  8. Mmm... It still doesn't work, it sends back a completely blank page, no code, no nothing... Any suggestions?
  9. Hi, can somebody see why this code does absolutely nothing? <?php session_start(); include("dbstuff.inc"); $link = mysql_connect($host,$username,$password) if (!$link) die("Couldn't connect to server"); echo "Connected successfully"; $select = mysql_select_db($db); if (!$select) die("couldn't connect to database"); echo "Connected to database"; $date = date("Y-m-d H:i:s"); foreach ($_POST as $field => $value) { $$field = strip_tags(trim($value)); } $sql = "INSERT INTO contact (name,email,heading,message,unread,date_created) VALUES ('$name','$email','$heading','$message','yes','$date')"; mysql_query($sql,$link); mysql_close($link); header("Location: index.php?page=contact"); ?> It gets sent via a normal HTML post form. When I tried it on localhost without the database lines and echoed the variables it worked perfectly.. So I guess something is wrong with the database lines? The database host, username, password and database name also gets returned as expected, so nothing is wrong with that. The problem is that absolutely nothing else gets returned... The page is completely blank, it doesn't even execute the header("location: ...") command. Oh, and the shared host that I'm on doesn't support mysqli, just for in case you wondered...
  10. So it's safe to just throw in a normal link to execute sql code to delete an entry?
  11. Hi, I have read that PHP doesn't by default have the Put and Delete requests, is this so? The reason why I want to use this is because I used Rails for a while now, and I learned that it's better to use delete rather than a post request. Is this necessary in PHP? I don't want search engine bots to execute the code to delete a database entry... Thanks I appreciate your help!
  12. Haha I finally fixed it!! I looked at the address bar and saw that it was passing the wrong values, and the error message was right - I didn't expect it haha I only change the @country = Country.find(params[:id]) I forgot that I made use of RESTful routes, which by default pass the :id parameter... Topic Solved !!
  13. Sorry, I know this is maybe too late, was just very busy with a Ruby on Rails site for the last few days... Can you please post some code, so that we can have a look at it?
  14. Hi all, I hope there are some RoR users on this forums, I have a script that is supposed to update some country info on the site that I'm busy with, here is my controller code: def edit @country = Country.find_by_country_id(params[:name]) end def update @country = Country.find_by_country_id(params[:name]) puts @country if @country.update_attributes(params[:country]) flash[:notice] = 'The country was saved successfully.' redirect_to :action=>'index' else flash[:notice] = 'The country could not be saved.' redirect_to :action=>'edit' end end And here is my view code: <% form_for([:admin, @country]) do |f| %> <%= f.error_messages %> <div> <%= f.label :country_id %><br /> <%= f.text_field :country_id, :class=>"form_text_field" %> </div> <div> <%= f.label :country %><br /> <%= f.text_field :country, :class=>"form_text_field" %> </div> <div> <%= f.label :description %><br /> <%= f.text_area :description, :rows=>6, :cols=>45, :class=>"form_text_area" %> </div> <div> <%= f.label :area %><br /> <%= f.text_field :area, :class=>"form_text_field" %> </div> <div> <%= f.label :provinces %><br /> <%= f.text_field :provinces, :class=>"form_text_field" %> </div> <div> <%= f.label :cities %><br /> <%= f.text_area :cities, :rows=>6, :cols=>45, :class=>"form_text_area" %> </div> <div> <%= f.label :towns %><br /> <%= f.text_area :towns, :rows=>6, :cols=>45, :class=>"form_text_area" %> </div> <div> <%= f.label :capital %><br /> <%= f.text_field :capital, :class=>"form_text_field" %> </div> <div> <%= f.label :currency %><br /> <%= f.text_field :currency, :class=>"form_text_field" %> </div> <div> <%= f.label :cultural %><br /> <%= f.text_area :cultural, :rows=>6, :cols=>45, :class=>"form_text_area" %> </div> <div> <%= f.label :languages %><br /> <%= f.text_field :languages, :class=>"form_text_field" %> </div> <div> <%= f.label :time %><br /> <%= f.text_field :time, :class=>"form_text_field" %> </div> <div> <%= f.label :dial %><br /> <%= f.text_field :dial, :class=>"form_text_field" %> </div> <div> <%= f.label :voltage %><br /> <%= f.text_field :voltage, :class=>"form_text_field" %> </div> <div> <%= f.label :car %><br /> <%= f.text_field :car, :class=>"form_text_field" %> </div> <div> <%= f.label :parks%><br /> <%= f.text_area :parks, :rows=>6, :cols=>45, :class=>"form_text_area" %> </div> <div> <%= f.label :active %><br /> <%= f.text_field :active, :class=>"form_text_field" %> </div> <div> <%= f.submit 'Update', :class=>"form_button" %> </div> <% end %> I got banned from a Google Group (Ruby on Rails: Talk), just for asking a question, it's ridiculous, but I hope someone here will be able to help. The error is a NoMethodError, and it says "You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.update_attributes"... I worked an entire day just to try and fix this error, but I still couldn't find a solution. Thank you in advance, I really appreciate it Sorry, only after I have posted I saw the "Other programming language" Section, if one the moderators can please transfer it, I would be very grateful
  15. I don't understand... Correct me if I'm wrong, underneath that slideshow, you have 60 link that stack on top of each other, not horizontally but vertically?
  16. That seems like a lot of unnecessary complications... Rather use more div's inside a single frame, frames are no longer part of the W3C specifications, and it also doesn't look very nice in many cases...
  17. I wouldn't use HTML 5 yet, but it's only my personal opinion. If you are okay with implementing something in your site that isn't very stable yet, then I'd say go for it, but it's scheduled to become a candidate for a recommendation only in 2012, so it can still take several years before it receives that recommendation... But it's still nice to know that the web is still evolving after the previous HTML releases HTML 5 is going to be a great addition to the current technologies
  18. I have never seen such UgLy code in my entire life... Try to clean it up a bit then the answer will seem simple... But I don't know if it's only my eyes that make an illusion or something, I'd like someone to please confirm. In that file you gave, I see something like this <img<a>Text</a>> in some cases... It has to be <a><img /></a>, the image has to replace the text that would normally be inside the anchor. Also, try to make the tags lower case, and some of the image tags end with a open tag... I hope this helps Oh, and before I forget, please remember to only use images if it is really necessary, a lot of images can really slow pages down
  19. I think I'll do it like you suggested, thanks cags, the previous web developer did it like I mentioned, he threw everything into the same table and that is where the mess started, but thanks
  20. I'm a complete noob when it comes to databases, in the project that I'm busy with there is a column which is filled with a lot of game parks and they are separated with commas, how can I tell the query to return each entry? At the moment I do this like so: SELECT * FROM $table WHERE `country` = '".$country."' AND `active` = 'yes' Please assist Thanks!
  21. MVC is the models views and controllers, that is the way most of the frameworks get organized.
  22. Hi, I'm an Ajax noob and I don't know how it works yet, in the webpage that I'm busy with there are 4 select dropdowns, the first is for countries, second for provinces, third for towns and the last is for the hotels that match all previous criteria... The province should only display if the country global var is 'southafrica', and the dropdowns should auto-generate relative content from the database, I tried jQuery solutions but none that I found does this very specific task, the database will soon have thousands of entries so it should be as dynamic as possible Please help I tried this function but it did absolutely nothing: function getProvince(country) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="getprovince.php"; url=url+"?country="+country; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } And this was how I called it: <select id='countrySelect' name='country' onchange='getProvince(this.value);'> Can you please also guide me in the right direction for all the other select dropdowns? Thanks a lot!
  23. I found a prettier looking multi file upload for you at: http://www.uploadify.com/ but this uses a type of flash though, but luckily there is a jQuery plugin that covers that part: http://jquery.thewikies.com/swfobject/ The SWFObject is an addon for jQuery that offers unique functionality to embed Flash content using the internal jQuery API Don't worry, the uploadify download comes with a flash object to implement in the zip file, after that you include the jquery-1.3.2.min.js, uploadify.js, uploadify.css and swfobject.js into your page... You then implement it like so: <input id="fileInput" name="fileInput" type="file" /> <script type="text/javascript">// <![CDATA[ $(document).ready(function() { $('#fileInput').uploadify({ 'uploader' : 'uploadify.swf', 'script' : 'uploadify.php', 'cancelImg' : 'cancel.png', 'auto' : true, 'folder' : '/uploads' }); }); // ]]></script> This should work... To see the original implementation details of this plugin, go to: http://www.uploadify.com/implementation/ Hope this is what you wanted
  24. You can do that with jQuery... Correct me if I'm wrong, you want do display all the files underneath each other? Take a look at: http://www.fyneworks.com/jquery/multiple-file-upload/ When you click the choose file button some text with an "X" next to it appears... If you don't have jQuery, I highly recommend you to start using it, it prevents a lot of headaches... You can get a tutorial on it here: http://www.w3schools.com/jquery/default.asp And here is the official documentation, if you go through it thoroughly you should be able to know almost everything about it: http://docs.jquery.com/Tutorials That jQuery Multiple File Upload thing is a great plugin, you can even write plugins and then share it with the jQuery community.. I hope this helps a bit...
×
×
  • 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.