Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. can you uncomment and post the results from //echo "<br>query: ".$query; also did you update BOTH of the email lines ? $query .= "email = " . $email[$i] . " ";
  2. yep, you need to quote strings ie change $query .= "email = " . $email[$i] . " "; to $query .= "email = '" . $email[$i] . "' ";
  3. Okay let give an example if i was going to store details from 3 files types ie jpg,png and gif I could create 3 tables ie Table: jpeg_file Fields: height, width, filename Table: png_file Fields: height, width, filename Table: gif_file Fields: height, width, filename But as each hold the same data it would be easier to create 1 table and add a field for each type ie Table: image_file Fields: height, width, filename, filetype filetype would be set to "jpg" or "png" or "gif"
  4. Do all the tables have the same schema ? wouldn't it be easier to have an extra field ?
  5. Okay when your ready you may want to check this it MAY help Dynamic DropDown PHP/AJAX Topic Solved ?
  6. What about another table, ie download_log `id` int(5) NOT NULL auto_increment, //uid `did` int(5) NOT NULL , //download ID `timedate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP then just insert a record on every download this will give you a better idea of stats but remember to include a clean up,, ie delete all records where the timestamp is older that a week/month/year whatever!
  7. Okay.. 1) Main page is load with ?poem_id=123. 2) the Main page contains an Iframe.. So. instead of having <iframe src="/functieknoppen/functieknoppengedicht.php"> to load up your iframe you do this <iframe src="/functieknoppen/functieknoppengedicht.php?poem_id=<php echo $_GET['poem_id']; ?>" thus passing poem_id from the main page to the iframe.. So in view source it will appear as <iframe src="/functieknoppen/functieknoppengedicht.php?poem_id=123" Now when functieknoppengedicht.php loads up it will be able to use $_GET['poem_id'].. Another option is always sessions!
  8. Well you need to remember that the form and data entered is client side (until its posted) and php is server side!.. So i would normally say yes via ajax BUT it the real question is what do you want to do ? if you wish to run any PHP code without reloading the page then ajax is probably what you want.
  9. From the first reply I truely didn't think i'll have to give an example!
  10. Well thats like me pretending it was design and planned correctly.. See perfect!
  11. it depends on the schema,, You need to plan it out! your example only is pointless.. you have A to C and an array or 10 questions! so that doesn't make sense! Planning Planning Planning Planning Planning Planning !!!!
  12. if you need to insert 100 rows every post or 5 minutes then yeah it will overload your SQL server, its about the design of the system! but your question was how can i insert 100 records without using inserting 100 records.. Now you may want to look into MySQLI, you could structor your SQL query like this INSERT INTO `list1` (`ID`, `Name`) VALUES (1, 'Dogs'), (2, 'Trees'), (3, 'Apples'); but thats more SQL than PHP, i won't insert more than 50 records like that but that would mean you need to open 2 connections instead of 100 Either way it depends on the design.. For example the statment above would insert 3 records, now you could assume thats more data then 1 record! but not if the one records contains an 16gb Blog!.. again its all about the design!
  13. Erm.. What! I guess you could use MySQLi and implode the array! but the simple truth is if you want to insert a 100 rows then you need to insert 100 rows! If you gave reasoning why you don't want to do it this why may help!
  14. Yes.. via apache use .htaccess file ie Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html or apache & php RewriteBase / RewriteRule ^([^/]*) index.php?page=$1 [L]
  15. Okay, Well getting the contents would be simple $x = file_get_contents("http://domain.com/blar"); removing tags.. strip_tags() or a regex would clean up most.. Well their will be no links, as you wanted them removed "no links either" but again a regex could get these.. I don't mind helping but i won't write it for you (i get paid for that), if you write what you can and post your code i'll help from their!
  16. simple solution would be echo it to the frame ie <iframe src="/functieknoppen/functieknoppengedicht.php?poem_id=<php echo $_GET['poem_id']; ?>"
  17. to resume FTP you need a resumable server! as for reading data from a large file.. well could give you 201 ways to do it but it depends on 201 things, 1. can you post your code (as this is in the PHP section i assume it PHP code problem), 2. why are you reading a file like this? i assume this is from your PHP server!..
  18. After a quick look.. i seams theirs a few things that would cause problems.. 1. case "quote_to": $query_custData = sprintf("SELECT contact AS dbinfo FROM customer WHERE cust_id=",$_GET['ajax']); break; case "email_to": $query_custData = sprintf("SELECT email AS dbinfo FROM customer WHERE cust_id=",$_GET['ajax']); break; should probably be case "quote_to": $query_custData = sprintf("SELECT contact AS dbinfo FROM customer WHERE cust_id=%d",$_GET['ajax']); break; case "email_to": $query_custData = sprintf("SELECT email AS dbinfo FROM customer WHERE cust_id=%d",$_GET['ajax']); break; also why are you clearing these document.getElementById('quote_to').innerHTML = ""; document.getElementById('email_to').innerHTML = ""; as email_to will always be blank! and this document.getElementById(cust_id).innerHTML = xmlHttp.responseText; should be document.getElementById('cust_id').innerHTML = xmlHttp.responseText;
  19. put the confirmation message in a if block ie <?php if (isset($_POST["send"])) { ?> <!--CONFIRMATION MESSAGE--> <?php $confirmation = "Thanks <span class=\"sendersName\">$firstName</span> for your message, we will contact within 24 hours."; ?> <div class="confirmation_message"> <?php echo $confirmation; ?> </div> <!--END CONFIRMATION MESSAGE--> <?php } ?>
  20. OKay this is just a basic idea.. but should help.. your need to tweak the RegEx (we have a RegEx section) <?php $html = file_get_contents("http://www.fandango.com/san+diego_ca_movietheatershowtimes"); preg_match_all('%<div class="title">.*?<h4>.*?<a[^>]*?>\s*(.*?)</a>.*?</h4>.*?</div>.*?<div\s+class="times">(.*?)</div>%sim', $html, $result, PREG_PATTERN_ORDER); $result = $result[0]; foreach($result as $r) { echo $r; } ?> Please note the RegEx was written in a kinda rush.. so some clean up is required
  21. Humm.. Personally i would use flush(); as if you get a timeout you won't get any results!! add the following to KingPhilip code sleep(1); ob_flush(); //add flush(); /add Another idea would be to redirect to yourself and use Get to pass the last ID
  22. Hello and Welcome to PHPFreaks.. Nice to see a FMP Developer. personally i don't use FMP for web based development (but i know friends who do) However his doesn't seam to be FMP Related but purely down to sessions.. So..
  23. My 4cents 1. Backup data and take laptop back to store with shotgun in hand. 2. Check ALL audio setting (mute etc) control panel -> sound and audio devices(or sound effect manager) check what device is set to playback, etc 3. Confirm is hardware, if possible get a sound test boot CD or Boot from USB and install windows (on the USB) and test. 4. If the built in speakers are above the function (F) Keys, its likely they disconnected it while cleaning, you maybe able to slide the section to its left and see the loss cable.
  24. the one at pear.php.net isn't just for *nix.. just install but your need to install PEAR as well.. if the example in the link supplied "doesn't work" then phpmailer probably won't work either, your need to check sockets are installed, check your phpinfo(); PS: saying "doesn't work" and giving no other info is kinda usless to anyone try to help. it would be like me saying "yes it does!"
  25. php mail() does not support SMTP authentication, So you could try PEAR Mail or Use a socket connection.. if this sounds like too much hard work.. then get a copy of phpmailer and that will do it all for you including HTML email and attachments. Hope that Helps
×
×
  • 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.