Jump to content

defeated

Members
  • Posts

    246
  • Joined

  • Last visited

Everything posted by defeated

  1. Hi, I have a bit of code in my site that randomly displays 15 out of 100 entries in a db. That works fine. I then have the following echo "<a href='$PHP_SELF'>More.....</a>"; The trouble is that I have split my page into header, main and footer sections. header and footer are includes. The code works and displays in the header section (note not <head>). If I am on the index page of the site it works properly. (the list of 15 entries changes to a new random selection) But If I am on any other page, the page refreshes to the index page. :-\ Anybody got any ideas?
  2. Thanks Andy. That was weird! or should I say ?w?e?i?r?d?. Had to type it out all over again in my text editor. No idea why it happened. Happily I also noticed that I had not included the footer on that page either.
  3. I just added an advice center that shows how to write a cv, lay it out, what to do in an interview and some other stuff. It will be added to and the design is a bit non existent as yet but it was a tool we needed in a hurry. http://www.jackiebrownmedical.ie/advice/resources.php?url=advice
  4. A lot of my pages are dynamic.... each job. I didn't use mod_rewrite for them. just plain old jobdetails.php?url=jobdetails&id=whatever the job reference no. is. I have had problems with google thinking I have duplicate meta tags (title and description) because any page that does not have url=whatever after the ? reverts to the default title and description. Adding in Url= was my way of changing the title for each page within an inluded header. Maybe there is a better way but I don't know it. SEO forum.... point taken. I have just left the address in the sitemap as http://www.jackiebrownmedical.ie/jobs.php?url=jobs and I'll see what happens.
  5. Hi, I've just added pagination to one of my pages. Should I create a dynamic list of every paginated page in my sitemap or will google find them all by the original url? If I create urls dynamically then how do I get around the first page problem.... ie. www.mysite.ie/jobs.php is the root page but will return exactly the same output as www.mysite.ie/jobs.php?page=1 thus creating duplicate content as far as google is concerned. Google already hate me..... I think because of all the changes I've made so I could do with some pointers. Cheers in advance. Ian
  6. Nice! I like it a lot. Some day I'll be able to do something like that. Found a few things..... 1. 68 validation errors on the home page. No doctype specified is the root of a lot of them. 2. Payment method link shows a 404 not found. 3. "Who need webhosting?" section on homepage should read "Who needs webhosting?" (see I'm getting really picky now!) Trust me I'm not being snotty..... you should see all the errors on my site and It's miles behind in design.... just trying to help and calm my jealousy! Well done.
  7. ok, so I've finally sorted out the problem with the headers. They no longer occur twice on each page as before. Not sure how to handle the javascript for the clock to put it into a div but at least I now know what a div is. Now that I've found out I'm looking into how to design the whole site using divs rather than tables. I've no idea how long that will take but I'll get there. This is the start of month 7 of me trying to develop the site. It's a shame that the bit I'm proudest of can't be seen....... the CMS. It's way cooler than the site it'self imho. Point taken about the green grad background but that's been approved by the boss and if she likes it it stays..... otherwise what's the point of being the boss?? . Still if I totally redesign the site I'll have a way of toning it down a bit. The trouble is that I still have loads to do on the back end. While it all works fine for this site, I want to be able to post jobs to multiple job sites which means adapting how I handle stuff like arrays into sql and also learning about how to send xml.... havn't a breeze right now. It's one steep learning curve!
  8. Cheers Jibster.... that's all I need to know!..... for now anyway
  9. can I put multiple items after the '?' ??? eg. www.jackiebrownmedical.ie/jobdetails.php?url=jobdetails, id='123456' ???
  10. Hi, Is it possible to use the $_Get function with the base of the url of a page? I want to have a dynamic <head> based on the url of the page.... something like $page=$_GET['url']; if($page='http://www.jackiebrownmedical.ie'){ echo "<title>the homepage</title>"; //there will also be other tags here eg description, robots etc. } elseif($page='http://www.jackiebrownmedical.ie/jobdetails.php'){ $id=$_GET['id']; echo "<title>more php that created a title for each page based on the job id</title>"; //there will also be other tags here eg description, robots etc. } else {echo "<title>a default title</title>";} The site structure is like this: http://www.jackiebrownmedical.ie //homepage http://www.jackiebrownmedical.ie/about.php //Static page http://www.jackiebrownmedical.ie/jobs.php //Static Page with dynamic content http://www.jackiebrownmedical.ie/jobdetails.php?id='123456' //dynamic pages based on job id no. every <title> is different (dynamic based on details from db) http://www.jackiebrownmedical.ie/applyform.php?id='123456' //dynamic form based on job id no. I cant just have www.jackiebrownmedical.ie?url='home' www.jackiebrownmedical.ie/about.php?url='about' www.jackiebrownmedical.ie/jobs.php?url='jobs' www.jackiebrownmedical.ie/jobdetails.php?url='jobdetails', id='123456' Or can I????? I need a genius to help me out here....... or failing that you'll do!
  11. That's neat. Nice and short. Going to bang away at the sql solution but can't get the ddamn thing to work. It's not really very important since it's only for an email to tell our consultants when a job has expired on the site.... but it's anoying me now so I WILL get it going.!!
  12. I knew it was an injection attempt because they tried to change some of the details in one of my forms. My form automatically e-mails several people in my company depending on which job is applied for and also sends a copy to the sender so I was able to see the code they tried to use in those emails. It was all escaped, but basically they tried to interupt some sql queries to gain access to the db.
  13. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'pretty2 FROM mytable WHERE TO_DAYS(NOW()) - TO_DAYS(mytimedatefield3) = 0' at line 1
  14. Clearly Paul wasn't too embarrassed! That's what I tried. Didn't work. My line at present is $result=mysql_query("SELECT *, DATE_FORMAT(mytimedatefield1,'%d-%m-%Y') AS pretty1 FROM mytable WHERE TO_DAYS(NOW()) - TO_DAYS(mytimedatefield3) = 0") or die(mysql_error()); note the extra ' after %Y. It also didn't seem to like spaces. Still need to get mytimedatefield2 and mytimedatefield3 formatted in the same line though. P.S. Thanks for the help so far.
  15. I used Pauls solution. But now I have found myself in a situation where Fenways would work better. Only problem is that I have 3 date fields to be extracted and formatted per row. So Fenway, how do you write your statement with mytimedatefield1, mytimedatefield2, mytimedatefield3? I'm too embarrassed to show you what I tried!!!! lol
  16. Hi, Just to make you aware, Somebody tried to hack my site after posting here. It is possible that they found my site randomly but it seems unlikely. Here is their ip address in case any of you want to add them to your banned list for your site or do anything else you like to them: 89.241.231.178 He/she tried to access my db by injecting a form on my site. Thanks to the bit of security I did have they were unsuccessful. We did however have about 3,500 emails this morning. I have sorted that by adding a CAPTCHA to the form. BEWARE!!!! Ian.
  17. <?php $link = mysql_connect( $myServer, $myUser, $myPass ); mysql_select_db( $myDB, $link ); $init=mysql_init("STOREDPROCEDURE", $link); $result = mysql_exec($init); ?> <select name="SELECT" id="SELECT"> <option selected value='anything you like'></option> <?php while ($row = mysql_fetch_object($result)) { echo "<option value='" . $row->name . "'>" . $row->name . "</option>"; } ?> </select> How about that?
  18. It Does Cal, Thank you very much.
  19. Worked out where I was going wrong. dont need the <?php echo $daystoexpiry ; ?> because it is already in a php line. so now it's mysql_query("INSERT INTO database (post_date, expiry_date, etc.) VALUES(CURDATE(),ADDATE(NOW(),$daystoexpiry),etc)") or die(mysql_error()); A little shorter and seems to work.
  20. You can certainly store html so I don't see why not. Give it a go!
  21. In your html put: <option selected value=""></option> Then add in the rest of your php.
  22. How about this?? <?php $result=mysql_query("SELECT * FROM sf_users ORDER BY logins") or die(mysql_error()); while($row=mysql_fetch_array($results)){ echo $row[logins] ; } ?>
  23. Hi, How do I insert a date eg now() and add on a number of days x to make an expiry date column for a my mysql database? The number of days (x) is selected as part of a large unwieldy form when data is first submitted to the db and can be user selected to be anywhere between 1 and 60. I called the day number (x) $expiredays. ie. $expiredays=$_REQUEST['expiredays'];
  24. I like that idea. It means I could write a different case for each page. The dynamic pages are based on only two templates currently so I would only need 6 different cases for the site. each case for the dynamic pages could include your suggestion and variations of. Still a bit of a hassle compared to writing the title on each page like I was. But anything for valid code on the site. :-\
  25. Surely there is a simple way of doing this? Otherwise why would anybody bother separating the header and footer. The thing is I will have to do the same for the description and keywords..... it's looking like a lot of hassle for the luxury of having my header and footer separate... I'm beginning to wonder what the advantage is of having them separate.
×
×
  • 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.