Jump to content

AjBaz100

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Everything posted by AjBaz100

  1. ** Gets specific date from MySQL row *** How is this specific date determined. Basically you could create a SQL file with the query, then put this in your cron * 5 * * * user mysql -u xx -p xx -h somehost.com database < query.sql query would look like this delete from table where fieldname >= curdate() and fieldname <= curdate()
  2. AjBaz100

    MySQL/XML

    Sounds like simpleXML is your answer. Have a look at: http://au2.php.net/simplexml
  3. $val = $row['phone']; echo '<phone>'.substr($val, 0, 4 ).'</phone>'; echo '<phone>'.substr($val, 4, strlen($val) ).'</phone>';
  4. you are also spot on in that the session id isn't being retained. This is the output from session_id(); 937a57f8dcd4935a29fe54f534fa6307 - request 1 5843c3c6bb8d36fb8ebbd2ddf23a0329 - request 2. I've checked the disk usage on the box, file system looks ok, no I/O errors and php.ini file settings look ok.
  5. Yes, I've tried using firefox 3 and IE 7, and I've also tried it from a couple of different computers. I've put the exact same code on a different server and it worked fine. So this lead me to think that something had gone wrong with the php.ini file, So i copied the php.ini file from the server that worked on the the one that doesn't, restarted apache and still same problem.
  6. I have the strangest problem with sessions. On Friday when I left work, everything was working fine, but this morning when I came in I noticed that none of my sessions are working. I'm using Ajax to call a php script and return a value that is based on a session state. I've broken down the script to a very simple session and still no luck. Here is an example. Javascript var myRequest = new ajaxObject( '/displays/eb/overlayContent.php' ); myRequest.update( params, 'GET' ); myRequest.callback = function(responseText) { if( responseText.length ) { alert( responseText ); } } PHP <?php session_start(); echo " --".$_SESSION['Test']."-- "; $_SESSION['Test'] = "Hello"; ?> On the first call, ---- is returned, which is correct, but I would have thought that on the second call to this page --Hello-- should be returned. I've checked the /var/lib/php5 directory and session files are being written, but it seams to write a file for every page request. So it's like it's creating a new session for every request. I've also skipped the ajax call and gone directly to the URL, still a new session file is being created for each page request, and the session isn't holding the value. What is strange though is that this was working fine on Friday. I've never had this kind of problem with PHP before, and I'm a little stumped on a solution.
  7. I'm looking for a good php price comparison script, anyone know of one??
  8. can you post a snippet of code you are using to insert the records.?? Hard to tell without seeing that.
  9. You should probably try wrapping the code in a If strlen() function.. I don't think trim can handle a null character. $name = htmlentities($_POST['dbhost']); if( $name ) { $name = trim($name); if(strlen($name) == 0) { echo alert("Enter your host address."); } }
  10. on the end of your connection string you could try putting the path to the socket.
  11. you could use a for loop as in the php snippet above.
  12. Sounds like you want to to a JOIN of some sort, that's normally the way you join rows. Search google for SQL JOIN syntax.
  13. maybe this would work. RewriteCond %{HTTP_HOST} ^mywebsite.com [OR] RewriteCond %{HTTP_HOST} ^www.mywebsite.com RewriteCond %{REQUEST_URI} ^/([A-Za-z0-9-]+).com$ RewriteRule ^(.*)$ /mypage.php?d=%1 [L]
  14. Yes, you could use php to write the file, although I don't know why you would want to. The second I don't really understand what your asking.
  15. when the script that runs deletes the ad, you could add another query to first insert the records into another table. I can't remember the exact syntax of the top of my head, but if you look into using the INSERT INTO query.
  16. function get_after_thumbs() { $dir = get_dir(); $afterdir = $dir . 'after/thumbs/'; $files = scandir($afterdir); foreach($files as $value) { if( substr($value, 0, 1 ) == "." ) continue; // check for image files if(valid_image_file($value)) if(!strtok($value, '._')) // build image array $imgarr[] = $value; } $count = count($imgarr); for ($i=0; $i<$count; $i++) { echo '<img class="floatright" src="' . $dir . 'after/thumbs/' . $imgarr[$i] . '" width="25" height="25" alt="09 285" />'; } var_dump($imgarr); }
  17. cut and paste the pagination into the first script???
  18. NOOOOO.. why not just stick with PHP.????
  19. pointers aren't difficult once you get used to them and they are very powerful and extremely high performance.
  20. it looks like your link is <a href="site2/about.html" /> where it should be <a href="/about.html" />
  21. No, ajax is a client side service that posts to the server so as long as you have a valid url on your server it should work without any worries. Just try posting to a very simple php page <?php echo "Hello I'm from AJAX"; ?> and in your responseText in the AJAX see what the output is using an alert function. alert( responseText );
  22. could try: foreach( $_POST as $key => $val ) { echo $key.'='.$val; }
  23. you could try: RewriteCond %{HTTP_HOST} ^mysite.com [OR] RewriteCond %{HTTP_HOST} ^www.* RewriteCond %{REQUEST_URI} ^/shop/([A-Za-z0-9]+)/$ RewriteRule ^(.*)$ /site.php?c=%1 [L] and ensure your hrefs always have the / at the beginning. <link rel="stylesheet" type="text/css" href="/css/style.css" />
  24. You'll have to download and install all the dependencies to get it to install.
×
×
  • 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.