Jump to content

jose07

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by jose07

  1. Ok, users can easily access my index and my index is also easily found on google. i have articles in different categories, some articles are free to see and others the user has to log in to see. I understand your point but note that If i use javascript to redirect the user my metadata works, even if the user has javascript disabled they won't see the article and will still have to log in. I guess this works because i'm not sending headers? I didn't want to use javascript but i guess if using headers will stop the metadata then i'll use java for now until i figure a work around headers or php is improved. What do you think, suggest?
  2. hmmn i don't know if you understand what i'm writing? I'm not redirecting people to a different site, only to log in page if they're not logged in. Example: If i look for 'php forums' on google 'phpfreaks' will come up because the metadata and tags 'php,forum' are associated with phpfreaks but it doesn't mean i can post without registering and because i haven't registered doesn't mean google won't find you when i do a search? and when i get to phpfreaks i'm redirected to a log in or subscribe page. Now the content that users can see(on my site) once logged in have tags associated with them that google should index but its not doing at the moment because it can't find it. ob_ is stopping that info flow Does it make sense now?
  3. what you mean theres no point? I want google to be able to find my site, if i post link of one of the contents(restricted or not) it should be able to find the metada, tags related to it.
  4. yes at the moment it only displays if the user's logged in, but i'd like it displayed regardless. Is there a way to do that with ob_?
  5. i have a page that allows users to see the contents of it only if they are logged in, so it checks for that and re-directs them accordingly (two header locations, welcome page or sign in page) if i don't use ob_start i get error 'headers already sent' because i believe it starts from other scripts(i have one for a header where all metadata is stored/retrieved from db). When i used ob_start i don' t get the errors and the re-direction works fine, however, my metadata is not sent google doesn't find my tags and is this extra info thats not being sent. I've tried to add ob_end_flash but it doesn't seem to help. Hope that makes sense
  6. Hey guys, I have a problem, i'm using ob_start to send multiples headers and it works but the problem is that my metada is not being sent, when i remove the ob_start it gets sent. Is there a way i can allow more info to be sent with ob_start? or should i use other methods to redirect to pages? i dont want to use javascript or meta http because they are not very reliable is there any other way? Thanks for help.
  7. Thanks for your reply, but i'd like some more explanation because unfortunately i couldn't get it to work. On the $_session['redirect_url']= here should i have a variable i.e the name of the function that gets the site address?(because the address is generated dynamically from db) also it seems to just take me straight to the index page? should i declare the session on every page? Headers is there an alternative as i get the error 'headers already sent' and if i use ob_start() it block the metadata from being published is there a way around this? Thanks a lot for your help so far
  8. Hello, I'm having trouble trying to redirect users after they've logged in. My site shows different types of adverts but some adv are restricted to registered users, on the home page they can see the the title of the adv but if they click on the title and are not logged in then they are taken to the log in page, Now my problem is how do i then re-direct them back to the adv they were trying to see? if i just redirect them to index.php that won't help because index shows few adv. I hope that makes sense. Any help much appreciated.
  9. have another question I can't user headers because the script already uses other set headers which then conflict if i add another one on the if statement. my question is how can i direct the user to a particular page 'login' from the if statement without using javascript or headers? and if i have to use header how do i set it up so it doesn't conflict with the others already set? else { //echo '<script type="text/javascript">window.location.href=\'' . $SiteURL . '/my-account/login.php\';</script>'; header("location: {$SiteURL}/my-account/login.php"); exit(); }
  10. Hi, Thanks very much for the reply, unfortunately i still can't get it to work as it seems it doesn't recognise the accesslevel and if it displays it displays all adverts and if it doens't display it doesn't display any advert which is obv showing that the accesslevelID param is not being recognised. I have attached the whole page so you can have a look and maybe spot the error. [attachment deleted by admin]
  11. Hey guys here is where i'm stuck: i have adverts on the site but i have set permission on the adverts to be either 'public' or 'restricted' so based on that i want to create a statement with three possible outcomes, it should check the values of the columns and if the is an advert it will check the permission if the permission 0 (public) it shows the ad if permission 1 (restricted) it will direct the user to a log-in page however if the user is logged on then it will just show all the adverts. These is the code i'm using but it is only executing the else line (so when the user clicks on the ad it takes them straight to the login page even if the ad is set to '0')....i checked the error log and i get the msg :PHP Notice: Undefined variable: SiteDir in code: <?php $qry_getAdverts = mysql_query("SELECT advertID,accesslevelID FROM adverts_adverts"); $row_getAdvert = mysql_fetch_assoc($qry_getAdverts); if($qry_getAdverts["AdvertID"] > 0 && ($qry_getAdverts["accesslevelID"] == 0 )) { echo($row_getAdvert["Content"]); } else { echo '<script type="text/javascript ">window.location.href=\'' . $SiteURL . '/my-account/login.php\';</script>' ; } ?> I tried put it as an array and use a while loop but still it didn't work Any tips much appreciated! Thanks
×
×
  • 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.