Jump to content

minuteman

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://robertlefebvre.com

Profile Information

  • Gender
    Not Telling
  • Location
    Florida

minuteman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Look at the PHP function foreach() Logic something like this Select from YOURDB address foreach (<input type='text' name='<? echo $address; ?>') that's crude but might get you started
  2. Hi, I am really new at ajax myself but maybe I can help. I just got something similar going. On mine, the script checks for a change in the db. When there is, it loads a different page. Is that what you had in mind? I'm assuming you are accessing your own db? I used what I think is basic ajax off a website somewhere that check the page every every ten seconds (see this line setInterval('sndReq()', 100000) Then, what I believe it does, is it goes to ajax.php which is just a regular php page that queries the db and if the db has changed then it will reload. That is done by "requiring" different pages depending on the db value I posted above a problem I am having with it though. I experimented with iframes and if the displayed page has any animated fetures it causes the entire page to refresh here is the code I use <html> <head> <script type="text/javascript"> function createRequestObject() { var ro; var browser = navigator.appName; if(browser == 'Microsoft Internet Explorer') { ro = new ActiveXObject("Microsoft.XMLHTTP"); } else { ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq(action) { http.open('get', 'ajax.php'); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4) { var response = http.responseText; document.getElementById('foo').innerHTML = response; } } setInterval('sndReq()', 100000); </script> <title>Internet Video Radio (INVIDRA)</title> </head> <body bgcolor="#FFFFF0"> <div id="foo"> retrieving data...'; </div> </body> </html>
  3. I have my first ajax page working. I use a db to tell ajax which page to load. When I want to switch pages I use a form to change the db. Ajax then picks this up and changes page. So far so good, works sweet. I started experimenting a little with using an Iframe on one of these pages. It seems any page loaded into the ifram with an animated gif will cause ajax to refresh the whole page (not just the Iframe but the page the iframe is in ). A plain text file in the iframe behaves fine. All these pages were loaded from remote sites, and 3 different domain names and hosts. Any one have an idea where I should start looking? Or an idea how to suprress this action? I can't understand why it would be doing it anyway? I thought it would only refresh if there was a change in the db? Why would changes within the page cause that? Is it possible ajax within the loaded pages are causing it? I don't have access to those.
  4. I built a script for placings variables into the meta tags. It's working but the content doesn't have any quotes around it. Yet if I echo the same value in a browser the quotes are there. Here is the code $re_meta_description = str_replace('$continent', $continent, $meta_description); $re_meta_description = '"'.$re_meta_description .'"';  (this is putting two quotes around the var by putting the quote within two apostrophes) echo ' re_meta_description = ' , $re_meta_description;?><BR><? (this echo in a browser writes the description with quotes at beginning and end) <META NAME="revisit-after" CONTENT=<?echo $meta_revisit;?>> <meta name="description" content=<?$re_meta_description;?>> (these two produce the same results - no quotes) Something is also taking the quotes in the metatags and showing them as apostrophes in the page source. I doing all this believing spyders need the quotes to be able to read the tags but they do read the title without quotes. Is there anyway to see the page as a spyder would to see if it even matters? And I guess with most search engines not using metatags maybe I should just settle for the title working.
  5. hey hey hey! That got it! Thanks JaGeK javascript:void(0); Grin
  6. I couldn't see how either of those would do it but preg_replace looks like it would work. I used this code $string = $meta_title; $pattern = '$continent'; $replacement = $continent; echo preg_replace($pattern, $replacement, $string); but I get this error - Warning: preg_replace(): No ending delimiter '$' found in .. line 108 (which is the echo preg... statement If I echo each of the vars I get string = Pay Per Click (PPC) Realestate Internet Marketing (RIM) For $continent pattern = $continent replacement = south_america which seems right. If I can get "south_america" in the string in place of $continent I've got it. There's suppose to be slashes in the preg statement, one place said #, but either one always gives me syntax errors.
  7. I think this would work too <table width="100%" border="0" cellspacing="0" cellpadding="0">   <tr>     <td>Text <? include('INCLUDE_HERE text');?></td>   </tr> </table>
  8. I'm trying to make dynamic metatags and can't seem to get the variables working. For instance , The title tag is stored in the db something like this - "Pay Per Click (PPC)  For $continent "  without the quotes and under the name $meta_title. The $continent value is passing through fine through the url, the $continent var gets echoed fine by itself no problem. But when I try to post the value with "echo 'meta_title = ', $meta_title ;" which includes the $continent var inside $meta_title, I can't get the value to echo. it echoes "Pay Per Click (PPC) For $continent" without the quotes.  I know I can do something like "getThing".$continent for this example but that wouldn't work well for others. Can someone help me with this?
  9. Hey, that got it! Thanks liam. javascript:void(0); Grin
  10. Thanks Liam I still don't see it. I don't get any errors in the original code where there are only 7 vars. As soon as I ad number 8 ($search_value) to pageBrowser('totalrows','numLimit','amm','queryStr','numBegin','begin','num'); then I get the error. $search_value has a value in it all the way through the code in front of the call but not inside the function.
  11. I'm running a php script that displays data in columns. There is a config setting for establishing the number of rows to display, after which it creates a second page, etc. There is a particular variable that works fine outside the function but is empty inside the function. If I  understand right, this is normal since variables inside a function are different than variables outside the function. I need to know how to pass the variable into and out of the function. The funtion works fine like this function pageBrowser($totalrows,$numLimit,$amm,$queryStr,$numBegin,$begin,$num) { but if I add the code to it for the var I need ($search_value)  like this  - function pageBrowser($totalrows,$numLimit,$amm,$queryStr,$numBegin,$begin,$num,$search_value) { it crashes and I get the error message Warning: Missing argument 8 for pagebrowser() I've looked everywhere on the page for any other type of code naming the function but I can't find any. How do I get the value of the var $search_value passed to the function?
×
×
  • 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.