Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. Reading that website a bit more it uses a virtual display, so essentially it maybe possible on a dedicated server, however I would not want to put this on my live webserver. I would still prefer to use a machine at home or in the office.
  2. Because hosted servers are not installed with X Windows. Usually you SSH into a hosted server. They do not have a desktop environment, only a command line. The requirements on the link you posted are: Linux Server with Centos/RHEL Khtml2Png (http://khtml2png.sourceforge.net) ImageMagick (http://imagemagick.org) KDE Desktop Environment Cmake - http://www.cmake.org The 4th in the list is KDE. This is a desktop just like Microsoft Windows. The reason that a desktop is needed is so that the web browser can print the screen of the websites it visits. Here is the line to install the browser yum install firefox . You can look into hosted servers with X Windows but I have never come across them. I maybe wrong but I don't know. Essentially a server should not have a desktop, i.e a web server. It is far better to get a cheap pc and install Linux on it than paying for a server anyway. If you do this on your own Linux machine, the screenshots that are created can be FTP'd to the web server as an automated routine. Yes. I have done this with a MS Windows machine. The urls to visit come from an XML feed on the web server to a program that runs macros to control firefox, then using a screen grab plugin it can save the desktop image. The images are then transferred to the web server overnight where image magic runs to crop them to size. This was something I did a long time ago.
  3. Your script isn't causing the 404 is it? You must test the none rewritten url first: http://example.com/us.php?title=awesome-suff The www will not cause an issue but as a rule of thumb you should always redirect the non www version to the www version or vica-versa. Search engines used to see this sort of thing as duplicate content when both www and non www urls serve up the same page when people link to your website using both versions.
  4. Yes, this collection of programs can perform the task, and the instructions are clear. This will not be possible on any shared host that I know of, in fact I can also rule out hosted dedicated servers. You need linux running the X Windows environment such as Gnome or KDE (basically the desktop). You are better setting up your own in-house Linux machine.
  5. Ok, post a new topic. Don't forget to mark as solved when your done. I'll do this one.
  6. I had already said that you had probably got this far by adding the wildcard * in cPanel! Now you need code in your website to display the correct data based on the subdomain or you can use a simple mod-rewrite rule http://oneapachetipaday.blogspot.com/2007/03/redirect-subdomain-to-subfolder.html Or you can map subdomains to subfolders using the following: http://blog.merhar.si/post/757871034/mapping-subdomains-to-subdirectories-with-apache
  7. Ah, my god can't beleive I missed this! Variable names cannot contain hyphens! <?php /* BAD, causes error*/ $Job-Title = $_SESSION['Job-Title']; /* GOOD */ $Job_Title = $_SESSION['Job-Title']; ?>
  8. Can anyone tell me where I might find the httpd.conf file? Linux? /etc/httpd/
  9. OK, we won't get very far on this as you are expecting a simple one line answer when really there isn't one. It would take a developer to write some code that will understand what data to display for each subdomain that is part of your website. You are not going to get anyone to write this for you or get a cut-and-paste solution! This topic is discussed in detail here http://stackoverflow.com/questions/586129/create-subdomains-on-the-fly-with-htaccess-php If you are still struggling after reading then I would use a simple solution such as a rewrite rule. http://oneapachetipaday.blogspot.com/2007/03/redirect-subdomain-to-subfolder.html And if you are still struggling, seriously get someone else to do it!
  10. I want to SEE line 60! The error is on line 60. You must read the errors! Parse error: syntax error, unexpected '=' in /home/content/h/i/l/hilo101/html/Hilo-Jobs/Post-Jobs-to-Database/Post-Jobs-to-Database.php on line 60 Post DB-Connect.php also. However make sure you remove the username & password details for your database connection before posting.
  11. Please do not post this kind of stuff. Members of this forum have various levels of knowledge.
  12. I don't understand this. I don't understand this. I don't understand why you gave me the code to echo a domain name. What do you suggest I do with it? Seriously, if you are not a developer and do not understand why you would need to use the super-variable I gave you to do exactly what you ask for in your original post I would personally give up now. Get a developer to do this for you if it is out of your scope. I am not trying to be mean but if you do not know how DNS works & what a subdomain actually is then you don't have much hope. To me this is an easy project for a developer.
  13. Please add code tags around your code when you submit a post (the code button is in the editor window). I cannot read it clearly as plain text. What exactly is on line 60? The code I posted is correct. Are you sure that it has been uploaded if you are getting the same error? I can see that your original code would have given that error so that's why I am suspect.
  14. You would use Mod-Rewrite. There is a whole board on this topic within this forum. So to get to http://www.example.com/us/neat-awesome-video you must start with your original URL. This may look like: http://www.example.com/us.php?title=neat-awesome-video Now you can enable mod-rewrite in a .htaccess file that you upload to the website document root and add the url rewrite rule. # .htaccess file contents # enable mod-rewrite RewriteEngine On RewriteBase / # add rule for us.php RewriteRule ^us/([a-z0-9-]+)$ us.php?title=$1 [L] Now your url will work when it is seo friendly. This part ([a-z0-9-]+) is called a regular expression. In this example it will only accept lowercase letters a-z and numbers, and hypens. Any other characters will fail and throw a 404 error so you must make sure that your parameters contain the correct characters defined in your rewrite rule. If you want to add extra parameters lets say an id that is a numeric value. So, your non-rewritten url will look like http://www.example.com/us.php?title=neat-awesome-video&id=123 We can amment the rewrite rule to: # add rule for us.php RewriteRule ^us/([a-z0-9-]+)/([0-9]+)$ us.php?title=$1&id=$2 [L] The second parameter (id) is captured and can only be a number so now your URL will look like http://www.example.com/us/neat-awesome-video/123
  15. This is your solution. Create a wildcard subdomain. http://steinsoft.net/index.php?site=programming/articles/apachewildcarddomain What you have done using cPanel is probably enough. Make sure you add to your DNS records. All subdomain aliases will now resolve to your domain. You must write some code that maps the subdomain to the user. This is kinda like what wordpress does on its multisite installation, maybe download the code and fathom it out. For a kick of you will want to be using the following to determine what data to display: <?php echo $_SERVER['HTTP_HOST']; ?>
  16. Your syntax is incorrect. <?php $res = mysql_query("INSERT INTO table (JobTitle, Company, Salary,Description,CompanyURL,PhoneNumber,Requirements,JobCategory,JobType,Address) VALUES ( '".mysql_real_escape_string($Job-Title)."', '".mysql_real_escape_string($Company)."', '".mysql_real_escape_string($Salary)."', '".mysql_real_escape_string($Description)."', '".mysql_real_escape_string($Company-URL)."', '".mysql_real_escape_string($Phone-Number)."', '".mysql_real_escape_string($Requirements)."', '".mysql_real_escape_string($Job-Category)."', '".mysql_real_escape_string($Job-Type)."', '".mysql_real_escape_string($Address)."')"); ?>
  17. MVC. I use my own framework. Any bits of code I write that may be useful I add into it such as caching, WURFL, mod-rewrite, Sphinx, the list goes on....
  18. This is in fact exactly (and officially) why they are doing it. It is nothing but a marketing campaign, because unfortunately, lots of people do just look at the version number and think FF is way behind. So expect rapid updates until they at least catch up to the other browser versions. They should use a year like movies do when they want to sound all sci-fi and cool, such as 'Death Race 2000' & '2001 A Space Odyssey' Firefox 3000 sounds cool, right?
  19. No different from anywhere else, a cert is a cert. Guess it depends on the system you are using to install it. I have always setup certs manually on dedicated servers using OPENSSL and made mods to the Apache conf. There maybe issues if you are using some kind of managed or shared server running cPanel, WHM or whatever.
  20. This grabs an image from a remote website, not an image of the webpage. You have read it wrong. To take a screenshot of a webpage to generate a thumbnail is not possible with PHP alone. You could use PHP to collate the urls of which you need screen grabs, however the actual job of doing the screen grab will need to be that of a desktop application, basically a web browser. There maybe some plugin for Firefox that can do this and you can feed data into it, I don't know, however I do know that what you are after cannot be done without a linux or windows desktop. Alexa used to offer it's thumbnail service however I don't know if they do that any more, you will have to check.
  21. No, there is still the iFrame link button in the top right of Google Maps
  22. you can do, or just run the title through the function and compare it against the url parameter
  23. http://www.phpfreaks.com/forums/index.php?topic=37442.0
  24. Strip any special characters out of the string before using in the url: Try it out: <?php function prepare($string) { $blacklistchars = '#[^-a-zA-Z0-9_ /]#'; $string = preg_replace($blacklistchars, '', $string); $string = trim($string); $string = preg_replace('#[-_ ]+#', '-', $string); $string = strtolower($string); return $string; } $title = "This string 'contains' && stuff to remove in the url £ *** $"; $title_for_url = prepare($title); echo $title_for_url; exit(); ?>
×
×
  • 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.