Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. The solutions do work, but I have hit a new problem the 90+ pages i have ($page.php) either echo the contents within the function or have RAW HTML, therefor as soon as the function is executed, it spits out the contents of $page wherever it stands To get this working, I need to execute the function at the very top of my html, so I can use it inside the <TITLE> tag In doing this, I get my content before all my html, head,title,body tags etc
  2. Cant have that as I am echoing info inside the function, so it will return everything I don't see how that matters...my script declares it inside your function just like you asked. It's declared as a global variable so you can access it outside the function just like you asked. What does it matter what you do inside your function? Do whatever you want to do. Return whatever you want to return. Notice inside my script you aren't returning anything, and yet you can still echo $somevar outside the function. Same as above, I need to call that function before I set <title>$pageTitle</title> If i do that, I get my page content in the HTML HEAD
  3. Cant have that as I am echoing info inside the function, so it will return everything I don't see how that matters...my script declares it inside your function just like you asked. It's declared as a global variable so you can access it outside the function just like you asked. What does it matter what you do inside your function? Do whatever you want to do. Return whatever you want to return. Notice inside my script you aren't returning anything, and yet you can still echo $somevar outside the function. The problem was I had to execute that function before I call the variable, therefor it has not yet been parsed, thats why that was not working I cant move the function to the top of my script as it just echoes the contents of the function where ever is is placed, it needs to be in the center of the page wrapped in a div.. I have 90 odd pages too, $page, so cant really rejig them
  4. Cant have that as I am echoing info inside the function, so it will return everything
  5. Ok the GLOBALS is working, but 2 questions 1: Isnt this some kind of security hazard? I have always learned to turn off in php.ini 2: How can I assign multiple variables inside a function..
  6. That allows me to use the variable SET outside of a function, inside a function I need to set the variable inside the function, or atleast change it, and use it outside the function Like my example above
  7. I need to use a variable that I have set within a function, outside of that function e.g <? function beans () { $cheese = "nice"; echo "hello"; } echo $cheese; ?> Is this possible, something like setting the function globally so it can be used outside of the function container. It must use the above syntax, please dont suggest echoing $cheese within the function
  8. That did not work, because you cant use a variable outside of a function, when the variable was set within the function Unless there is a way to set the variable so it can be used GLOBALLY outside of the function?
  9. The title can only come from $page.php header must be echoed before $page is included, so it will never get the $title from $page.php
  10. My page is laid out like this <html><head> <title><? $title_should_go_here ?></title> </head> <body> SOME STATIC CONTENT HERE <div> <? include("$page.php"); ?></div> </body> </html> The problem is, I can only really get the correct title from $page.php, but <title></title> is called before the include Im just thinking of the best way to sort this out? By the way $page.php has php code within, that must be parsed, so the likes of $content = file_get_contents("$page.php"); is no good
  11. jaymc

    SEO Using Frames

    so your saying google will ignore frames and just look at the nofeames stuff If so, if I put a direct link on there to my main frame, google will find its way to it? What had the robots.txt got to do with it?
  12. Great, thanks I actually ended up using a cron job to generate the results and store them in a cache table, which I suppose is better for load However, the syntax above will come in handy for future queries!!
  13. My site uses frames, it has to be like this because I have an audio player and do not want the songs to be stopped upon page navigation So I have a small frame at the top with the music player, and the second frame for the content It actually works really well, however, I now have the problem of SEO When google hits my website it is just going to see the frame master page, thus, not desend into my 2 frames What can I do to combat this, using a popup for the music player is out the question, it must remain framed I read about cloaking, basically check if its google bot reading site, if it is, give it the second frame as the homepage, but thats not allowed.. so what other options do I have?
  14. Yes, it really does not seem to like it Perhaps its an illegal operation? I tried to do something pretty similar a while back and you guys said it was an illegal operation
  15. Cool, I like that, will come in useful for a lot of links
  16. Are you allowed to do that? Its not really true content.. If you can do that I could just have a sitemap with litterally 100,000 links on to all my pages with the nice fancy URL's Can I get away with that?
  17. Is it the best way to go about it, the method above Or should I be going down another road
  18. Im currently looking into SEo (Search Engine Optimization) A lot of my website uses ajax, so no hard ahref links, most of them are like this open_url('scripts/view_members.php?id=3', 'divframe'); However, I can also access them via modRewrite urls such as www.site.com/view_members/3 Problem is, I must use ajax for navigation, but because of that google is not really going to see my nice and neat URL's I am just wondering what I can do to let google see all my modRewrite URL's I have thought of this but not sure if google will like it <a href="http://www.site.com/view_members/3"><img src="transparent.gif" height="1" width="1"></a> Not I dont want members navigation via this hard link so its practically an invisible image I dont suppose google knows that its a 1px image, thus not really a valid one? If google reads my site will it see those dummy links ok and index them?
  19. I had that originally, that did not work either
  20. This works SELECT count(*) FROM arcade_games GROUP BY champion When I add a SUM in, for another table using a join, COUNT displays the wrong result (the correct result x amount of row matches in arcade_games) SELECT count(*), SUM(arcade_games.plays) FROM arcade_games LEFT JOIN arcade_plays ON arcade_games.champion = arcade_plays.player GROUP BY champion Any ideas?
  21. Yeh its really bugging me Even a way to atleast stamp out the majority of cheaters For example, create a unique key in the database that expires after 10 minutes or something. that key is only created when they load the game page So, if they try and cheat after 10 minutes, it wont work If they play the game, submit a VALID score, then try and post externally, there will be no key But of course, the way around this is to load the game page and post externally straight away Something like that, but not as easy to get around would be great The ones who can get around it, I can probably deal with manually
  22. try this window.onload = yourFunction(); or setTimeout("functionName()", 0); I had the same problem
  23. $filename = $_POST[filename]; $height = $_POST[height]; $width = $_POST[width]; <img src="$filename" height="$height" width="$width" alt="Product image"> use POST as an example
  24. Yes but the problem is the "cheater" knows these parameters and I cant change them as they are compiled in the swf of which i dont have the .fla
  25. I have flash games that I did not make, after playing you click a link withing the flash game which POSTS your score to a php URL This works fine, but obviously not very secure as idiots can POST externally to the php file and providing they know the parametres (which they will) can set any high score they want My question is, how can I stop this I remember a while back you can check the REFFERER, but thats not very accurate at all so probably not something I want to use What other ways are there, and remember, I do not have the flash source so I am pretty much stuck with the parameter names that are posts to the PHP
×
×
  • 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.