Jump to content

psyickphuk

Members
  • Posts

    17
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

psyickphuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Why don't you just do it in photoshop or whatever and save it as an image? It looks cr@p anyway IMHO.
  2. Thanks, yes you're right. I got round it by doing an ob_start() before the article is called and then doing $article = ob_get_clean() at the end but it's a bit messy. I will fix this properly soonish. I always wondered why tutorials said that functions should return variables rather than echo stuff and now I know why
  3. Hi thanks that's great I have started experimenting with this format and it works well except for when I get to: $file = str_replace("[CONTENT]", article(), $file); What happens is that article() just outputs its content and as this is before you print the template then it comes out at the very top of the page and then the template below it?
  4. At the moment my index page is basically the template along the lines of: <? //script to determine what page to include include ("$page.php"); ?> <html> <head> <body> <header> <menu> <? function article(); ?> <footer> </body> </html> And the included file "$page.php" has its contents/script inside a function - article() Anyway this all works fine but now I want to start including dynamic content in the page title and meta tags etc so I need to change how I work it. I would rather have the pages loading a template rather than the template loading the pages I think. Except then I end up with loads of separate files e.g a header file. menu file, sidepanel file, footer etc. Anyone got any suggestions for a neat way of doing this? Oh and I don't want to use 3rd party templating engine, i want to do it so I understand what's going on
  5. So everything was working fine, I'm pulling some data from an SQL database to do dynamic titles and text etc. Now I've been into phpmyadmin and edited some for the text but the changes aren't seen on the site? I've refreshed, changed the query so it'll select a different row from the db (which displays fine). It's like it's working on an out of date version of the database or a cached version or something. Any ideas on how to fix this?
  6. I want to get rid of some hard coded pages and put the content html into a database. However embedded throughout each page are variables which I use to place targeted content on each page. If I query the db and echo the result between double quotes will the variables be interpolated? If not how would I do so?
  7. Or try the following: In the db-connect (or any included) file start it with: <?php defined('_VALID_INCLUDE') or die('Direct access not allowed.'); and in the index (or any 'container' file) put the following (before the included file of course): define('_VALID_INCLUDE', TRUE);
  8. Thanks redarrow I will try that later. Yes seems pointless to me too but if I don't null my variables then I get a variable undefined message when they're used. You could argue not to do this and to their existence before usage but this seems to work and I only have to do it once.
  9. Basically I have an array and I want go through it as follows: $field_list array("text1", "text2", "etc"); for each ($field_list as $field) { if (!isset($_SESSION[$field])) { $_SESSION[$field] = null; } } I tried with/without quotes but no joy. A bit of searching and I think I need to use variable variables but I'm not sure how to implement this? Any suggestions welcome
  10. At the moment I use this on my form_write.php page to see whether to just write the page or go to a new page - form_submit.php - to then do validation etc: extract($_REQUEST); // GET posted fields // If the form has been submitted then goto form submit page if(isset($submit)){ header( "Location: /index.php?article=form_submit&xMonthlyIncome=$xMonthlyIncome&xNatureOfIncome=$xNatureOfIncome&etc etc etc"); exit; } I want to POST values instead of GET them though - is there code for the 're-POST' of values from a form to the next page? Or am I going to have to change how the pages are structured to get this to work
  11. PS: I just managed to save everything by reuploading everything PSPad holds in its temp files. But a proper solution for DW would be great!
  12. 1) On my desktop I used Dreamweaver to work directly on files on my FTP server, all OK... 2) Then on my laptop I used PSPad to work directly on files on my FTP server, all OK... 3) Earlier I load up Dreamweaver, open up some pages from my FTP sever to edit them and then save them to FTP. 4) Now I look at my site and all the changes I made to my CSS files on my laptop have been overwritten with the old values! I'm concerned there may be other stuff I haven't noticed yet too. I think what happens is that DW is uploading the dependant files that it has in its local copy of my site. Which is cr@p imho! I have previously turned off load dependant files to speed things up - is this the problem, in that DW isn't first getting the latest versions from the server when I open a page? Preferably can I just make DW only save the file I'm working on to FTP and forget about trying to be clever uploading any dependants? I'm not using a local server etc so don't see why this is needed at all?
  13. Well I know why, if I don't then I get a variable is undefined message. It just seems such a pain to me, for example I have a big long list for each submitted form field like: if (!isset($E_Email)){$E_Email= null;} Is there a way of just enabling this for every variable by default?
×
×
  • 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.