Jump to content

waffle72

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.canadiancafes.com

Profile Information

  • Gender
    Not Telling

waffle72's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks (again :-) ) MJ I love that cool way of coding the if
  2. I guess that could be taken care of with mod-rewrite ??? mod-rewrite ? Isn't that in the htaccess file ?
  3. Whouaou ! Millions thanks MJ Yes it works perfectly. I am always forgetting that you can mixte Jscript with php (or the other way around :-) ). I tend to avoid jscript cause it's not portable enough. Anyway for those who are interesting in an answer, here is the call from the caller file. As you can see I had to call my file xxx.php or it doesn't work <script src="http://www.populationmondiale.com/population/clockjs.php?aff=1&lang=fr&cpop=FFFFFF&size=20&cclock=404040" type="text/javascript"></script> and here is a snipset of the clockjs.php file // valeur par defaut des variables var lang = 'fr'; // language 'fr' or 'en' var aff = '1'; // affichage '1' - horizontal or '2' - vertical var size = '10'; // size of the font for the number in pixel var cpop = 'C0C0C0'; // color of PopulationMondiale.com var cclock = 'CC0000'; // color of the clock // .... <?php if (isset($_GET['aff']) && !empty($_GET['aff'])) echo "aff = '{$_GET['aff']}'\n"; if (isset($_GET['lang']) && !empty($_GET['lang'])) echo "lang = '{$_GET['lang']}'\n"; if (isset($_GET['cpop']) && !empty($_GET['cpop'])) echo "cpop = '{$_GET['cpop']}'\n"; if (isset($_GET['size']) && !empty($_GET['size'])) echo "size = '{$_GET['size']}'\n"; if (isset($_GET['cclock']) && !empty($_GET['cclock'])) echo "cclock = '{$_GET['cclock']}'\n"; // ... ?>
  4. Thanks MJ, But I already have the PHP file and I'm triing to do it in Javascript. See, I have a little php routine that is a population counter. I want people to be able to put this counter on there own page. But we have discover recently that some server don't allow allow_url_open. So those poeple can't have an include("http://www....") in there file. The php routine will still be available but I want to make a jscript routine for those who can't use it. I am sure there is a mean to do that. When you call the Google Map jscript you give parameter so I am sure that there is a way to read them. I just don't know it. <script src="http://maps.google.com/maps?file=api&v=2&key=kjdfhksduj" type="text/javascript">
  5. IHi, I wanted to know how to access the variable that you put in call for a javascript file. In a HTML file I call a Javascript file as follow : <html><head><TITLE>Test clock</TITLE></head><body> <script src="http://localhost/populationmondiale/test2.js?aff=1&lang=fr&cpop=000000&size=14" type="text/javascript"></script> <script type="text/javascript">clock();</script></body></html> The think is I don't know how to acces the variable aff=1&lang=fr&cpop=000000&size=14 . If I do a location.search it doesn't work cause it gives me the URL of the caller file. Any idea anybody ? Thanks Waffle
  6. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] 1) check SESSION variables (to prevent against CSR, session hijacking, and session fixation) 2) initialize my variables which will store the info passed from the form 3) check/screen info passed through POST and set my variables equal to these values 4) validate information 5) connect to db 6) create and format results of SQL search string based on form information and by using SQL ORDER command 7) query db 8) if results found, display them, if not, then display generic message 9) free resultset 10) clean up SESSION, close tables, end script[/quote] Here are classes to install for pagination. It is pretty simple. [a href=\"http://www.ecreate.co.uk/diy/pagination.php\" target=\"_blank\"]http://www.ecreate.co.uk/diy/pagination.php[/a] To use this classes you will have to do somme change : 5 bis) Do a query tha count the number of result you have with your parameter 6) change your query to get just the number of results you want per pages ie : LIMIT $startRow, 20 9 bis) put link or a form that send to the next or previous pages. The actuel code use links to change pages so you have the parameters appearing in your URL but I suppose it is pretty easy to change it for buttons with a form and post method. So then you can send back all your session variables.
  7. I did it and it works pretty fine for me. [a href=\"http://mywebsite/?langue=francais&option=commentaireListe&cid=63&cafe=La%20Moulerie#com16\" target=\"_blank\"]http://mywebsite/?langue=francais&option=c...0Moulerie#com16[/a] I even built it dynamicly. Rab is right, post your code.
  8. I am not an expert but I think that a way to do it would be has follow : in a loop for each html file : [blockquote]You do a fopen of your html file You do a read in one variable You search your string in that variable If your string exits, you put the name of the file in a array [/blockquote]You display your array as result The problem is that you have nothing to follow the link in a page so you if you have only html pages it should work. No dynamic call of include for exemple. God luck
  9. Here is my problem. I am developping a web site, the structure is as follow index.php [blockquote]include of [b]language[/b] file include of [b]head[/b] file include of [b]middle[/b] file [blockquote] include of [b]right[/b] file include of [b]center[/b] file [blockquote]depending of a case [blockquote]include of [b]home[/b] file include of [b]apropos[/b] file[/blockquote][/blockquote] include of [b]left[/b] file [/blockquote] include of [b]footer[/b] file[/blockquote] In my langguage file, I have all my text in variables. What's happening is that those variable are not "visible" in the home and apropos files. But they are visible in any other files. If I do my include language file directly in my home or apropos files, everthink works fine so it is not the way a code. If I put the home and apropos file in the same directory as my right file, for exemple, nothing change, so it is not the place where they are. What I don't really get is that it works fine on my localhost but not when I transfert on my hosting server. I have tried other hosting server, same problem. Since from my point of view when you do an include of a file, it is the same as copiing this file into your code I don't see why the variables are not recognised ! You can have a look here : [a href=\"http://www.labaroude.com/sara/index.php?option=apropos\" target=\"_blank\"]http://www.labaroude.com/sara/index.php?option=apropos[/a] I am a bit lost here. Any idea would be very welcome.
×
×
  • 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.