Jump to content
Larry Ullman's Book Forums

Jonathon

Members
  • Posts

    1064
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Jonathon

  1. "The header fields are transmitted after the request or response line, the first line of a message. Header fields are colon-separated name-value pairs in clear-text string format, terminated by a carriage return (CR) and line feed (LF) character sequence. The end of the header fields is indicated by an empty field, resulting in the transmission of two consecutive CR-LF pairs" Wikipedia
  2. Hello tryingtolearn, I am sadly not particulary brilliant with complex mod_rewrite rules. You may see I have my own .htaccess question in the forum. But for people to understand and help you with your problem, you'dneed to show the rules being used in conjunction with the urls they are meant to be working on. **Please put any code between [code]// examples of code inside code tags, close the tag using '/' just like any other html element tags as its easier to read, theres also an option in "other styles" to add code**
  3. If your unsure about whether there is an error check the books errata Have you looked into the php manual regarding headers? It may not give you your definitive answer in black and white, but you might be able to come to the answer by reading between the lines. Also try mail() you may find the answer your looking for under additional headers
  4. I wouldn't say that a static website is an application really. I suppose in a way it comes down to a persons own interpretation of what a "web application" is. I would say that an application is something that is fairly interactive with the user that takes various inputs and can adapt its responses. In short PHP can cover an absolute multitude of things. So it depends what your making I guess. I wouldn't say that a "dynamic site" is the same as a "web application". Dynamic basically isn't static, you could have a page written soley in PHP that outputs HTML but it has 1 dynamic feature in that it echoes the day of the week out. So its dynamic (albeit, minutely) but it's not an application (in my eyes).
  5. Store the image locations in a seperate table in your database and use relational keys to relate them to a product from another table.
  6. Hi DeeDee, I would use preg_match instead or eregi as its deprecated and use a patter similar to [Az-aZ]. I will take a look at the second part when I'm home too.
  7. Hi Zaberwan, Can I just check what your link is, on my browser, which is blackberry it was passing all kinds of font sizes and fonts.
  8. Take this post after yours from Растаможка В Одессе Google tells me that their post means: Import Export Ukraine Kiev and the sub title means: customs clearance services in Odessa Not very relative, possibly spam! For Larry to decide I guess
  9. I would suspect that rather it being an individual targeting you, it is more likely to be a spam robot. Especially if that comment is to a comment board or something. - However I'm not an expert on these things, so if you discover more, please let me know
  10. It really does depend on how your host sets this all up. Ask them for what your details should be if your unsure. If they're a good host they will help you out. My guess would be this: <?php # Script 16.4 - mysqli_connect.php // This file contains the database access information. // This file also establishes a connection to MySQL // and selects the database. // Set the database access information as constants: DEFINE ('DB_USER', 'rafter1_hardrocks'); DEFINE ('DB_PASSWORD', 'fastpaddle'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'rafter1_whitewater'); Hope that helps
  11. JavaScript is a great way to do as Stuart said make your website intervative and alluring. But it doesn't give you any protection if you use it soley to 'validate' your forms. I'd suggest you get your PHP signup process all sorted and working securely, get your colleagues to test it, incase they're experiences throw up any problems. Once your happy with it, then look into how to spice your site up visually or interactively.
  12. Hi Shivani, Basically you need to assign them into a styled div or class as currently it looks like there in your wrapper tag, that doesn't seem to have a closing tag btw. Then style the div however you wish in your CSS. As i can see you run a series of if statements and report back on the success of these. What you could do instead is rather than post these errors after each if. Assign the error to a variable and then use a for loop to iterate over the $error array and enclose this for loop inside a div or class. To do this you would: // initiliase the error array $error = array(); // run your if statments if (preg_match ('/^[A-Z \'.-]{2,20}$/i', $trimmed['first_name'])) { $fn = mysqli_real_escape_string($dbc, $trimmed['first_name']); } else { $error[] = '<p>Please enter your first name.</p>'; } // run more if statements and then check to see if the $errors array was empty. if it isnt, echo out a div and iterate your for loop in here stating the errors. echo '<div id="error">'; // Open CSS tag // complete for loop in here echo '</div>'; // close css tag This way you could style the div, in color, text font and position it where you want on the page.
  13. Hi Larry, Thanks for getting back to me. I think i'm going to use an absolute path to reference my css/images folders as initially it is easier. Mainly because i'm going to be creating similar url structures to the ones wordpress use. www.example.com/blog/this-is-a-blog/ The number of forward slashes may change and its just easier using absolute paths. The .htaccess rule I have been using is Options +FollowSymLinks RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^about/?$ about.php RewriteRule ^about/([A-Za-z\+\-]+)/?$ ./about.php?get=$1 RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^contact/?$ contact.php RewriteRule ^contact/([A-Za-z\+\-]+)/?$ ./contact.php?get=$1 RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^blog/?$ blog.php RewriteRule ^blog/([A-Za-z\+\-]+)/?$ ./blog.php?get=$1 And so on for my other pages. I know that this method probably isnt the most efficent when referencing each page individually, but I was just pleased that it worked initially. I then commented out all my rules and basically used this set of rules on its own: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://localhost/www.project_1.co.uk/$1/ [L,R=301] This does work in that I get a trailing slash automatically if ones isn't given and it isn't duplicated if its already specifying the trailing slash. It also handles pages '/' wise correctly if there dynamic too like about/jonathon becomes about/jonathon/ which is the desired look. (Except the page fails ) I guess that I am not passing the get information behind the scenes and hence the 404 error. I have tried to combine these rules in order to get it to work as between these 2 rules they cover my objective. I just can't get them to work together and achieve the overall goal of automatically appending a trailing slash to ^about or ^sbout/jonathon and the imformation behind the scenes all being correct. And the page displaying
  14. The database provides the times things happens and php can use that info in its results. But date_default_timezone_set() sets the timezone for php to use. There also might be an option in your php.ini file to set it.
  15. As I understand it backticks ` are used to quote names such as the name of a db field and ' single quotes are for entering strings.
  16. Yes I am a slave to Firefox, but I really can't stand how much memory it uses or even why it needs to. Out of interest what browser do you use? and which do you think is the best. I have all of them downloaded. Bar Opera (Although someone once said to me they regarded Opera as the best browser available). Maybe I should experiment with it? I quite like Google and imagine that there market share will only increase as Googles advertising is EVERYWHERE. I think it's a bit too plug-in happy though. I had to install an xml feed the other day because it doesnt ordinarily support one (As far as I know, admittedly I did very little searching of this issue).
  17. Hello Shivani, Try this: <?php // index.php require_once('includes/config.inc.php'); include('includes/header.html'); ?>
  18. You might also enjoy the webdeveloper toolbar from Firefox if you don't know about it. Web Developer Tool bar
  19. Hello, i've been making this project in my spare time, haven't looked at it for a while. But i have some spare time so i'm going to dip my toe again. I have been using the following .htaccess rules RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^about/?$ about.php RewriteRule ^about/([A-Za-z\+\-]+)/?$ ./about.php?get=$1 Which achieves what I wanted (initially). In that I wanted to be able to make these URLs: www.example.com/about.php www.example.com/about.php?get=jonathon Become these URLs respectively: www.example.com/about www.example.com/about/jonathon Which once i'd fiddled around and achieved it, I was pretty happy with. Obviosuly this meant some changes to my relative CSS paths, which was a bit fiddly, but I couldn't see a better way around it. Though if you know any good ideas, please let me know. My scenario now is much as I enjoy that these URLs look prettier, there are 2 problems with them. 1 - if someone types www.example.com/about/ for example, the css relative paths fail. So the paages aren't styled. 2 - Also in terms of seo it looks like duplicate content Sooo, my next thought was to automatically append the trailing slash, so that ^about becomes ^about/ and ^about/jonathon becomes ^about/jonathon/ auomatically. Therefore stopping a duplicate content problem and also meaning that my css will render properly. So far reading around the many many articles and examples i've seen before i've come up with this: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://localhost/www.project_1.co.uk/$1/ [L,R=301] Which works in that 'about' does indeed become 'about/' and 'about/jonathon' does becomes 'about/jonathon/' Regrettably, I always get a object not found 404 error! Which is not the desired effect, I am not particulary good, (in fact i'm not even remotely good at .htaccess) so can anyone help me out with this conundrum. I have been clearing my browser cache regulary as I tinker with it to make sure that it always using the most up to date .htaccess file. Thanks in advance Jonathon
  20. I would probably guess that they aren't in the right place or are referenced wrongly. It's hard without knowing your folder/file set up obviously. My advice is to view the source code of the page, where there is a broken image (if its referenced through the html and not the CSS), find the tags its contained within such as <img src="../somefolder/domeimage.jpg" /> and click the link, it will probably through an object not found error, but the full path of the referenced file will be in the browser's title. There you might see that you've referenced it wrongly. Alternatively use the abolute URL if your not already. At least it should then work, something like: http://localhost/my_folder/images/image_10.jpg Let me know how you get on Jonathon
×
×
  • Create New...