Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Your welcome, of course the 100/100 can be replaced with 1 (well 2 if you also remove the +1) i just added to make it clear.. if this is solved can you click solved (bottom left) --MadTechie
  2. The loading of the document seams to be the major performance crippler.. I only really when i need to write an xml but for reading simpleXML seams quicker, however i did my tests awhile back so re-testing maybe an idea
  3. i assume you mean this, <?php $units_stats_1 = array(40, 35, 50); $units_stats_2 = array( $units_stats_1[0] * (1+(50/100)), $units_stats_1[1] * (1+(100/100)), $units_stats_1[2] * (1+(100/100))); echo $units_stats_2[0]."<BR />\n"; echo $units_stats_2[1]."<BR />\n"; echo $units_stats_2[2]."<BR />\n"; ?> remove the 1+ if you do mean (40 x 50%) that = 20 and the 35 and 50 would remain unchanged
  4. its not an array its an SimpleXMLElement object, try this $a->report1->ReportHost[0]->HostName
  5. The only thing i can think of would require you sending a token via the URL on the redirect page, for example: User is on site A and, and click a link that jumps to a redirect page, this uses fopen or curl or sockets whatever! to make a call to site B with the data to be passed and a token i.e. <?php fclose(fopen("http://www.siteB.com/getData.php?token=$token&Details=$Details&ect=$etc", "r")); echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.siteB.com/welcome.php?token='.$token.'"> <title>Re-directing</title> </head> <body> <p>please wait</p> </body> </html>'; Now getData.php gets the data and saves it to a database/file whatever.. Now when the user is re-directed they are only passing a token so it means nothing to them and site B already has the data I hope that makes sense --MadTechie
  6. I see your problem, even using DISTINCT wouldn't help as the end results is for a mail merge, it would seam that creating a temp table with the extra field would be the best approach, providing the table was only used for the mail merge, and not live data, basically you would loop through the list adding the details from tmpData to the mail merge table, the logic i would take would be as follows:~ create a temp table with all fields that are used, in the main table "tmpData" set a variable ($ProvideCounter) to 0 set a variable ($LastProvideCount) to 0 set a variable ($lastDataID) to 0 set a variable ($CurrentRecord) to 0 loop joined queries results compare the $lastDataID to the tmpData.ID field if it does not match then set $lastDataID to tmpData.ID set $ProvideCounter = 0; Insert the data into MailMerge table $CurrentRecord = mysql_insert_id(); else $ProvideCounter++; if($ProvideCounter > $LastProvideCount){ create new fields "Provider{$ProvideCounter}" etc etc } set providers details to "Provider{$ProvideCounter}" fields where ID = $CurrentRecord } this should build a new table with all the details required, I hope that makes sense! EDIT: dame! lucky i can code better than i can explain things!!!
  7. Now would be a UNIX_TIMESTAMP but all dates and times in MySQL are stored as UNIX_TIMESTAMP's and just converted for display, also if you set the time via MySQL then you should use Now() if you set it via PHP time() then you could use time()
  8. Okay i think i have a better understanding now I REALLLLLY would recommend NOT taking the "Provider Name", "Second Provider Name", "Third Provider" approach, I assume the tmp tables is identical to the erm.. live tables If your extracting this data then you could use a SQL JOIN, linking tempId to the table with the remaining details, if you could give a little detail about the database tables (name and fields and what links to what and some samples) and then let me know what your like to output,
  9. I am removing time from Now now the user, i could of added the time to the user (either works) here is the logical break down EDIT: (think of is as minutes past 12) if loginTime = 20minutes and Now = 30minutes then loginTime > (Now - 15) = 20 > (15) = true if loginTime = 10minutes and Now = 30minutes then loginTime > (Now - 15) = 10 > (15) = false
  10. try this SELECT user FROM site_table WHERE loginTime > (now( ) - ( 15 *60 )) AND user = 'tester' 15 = number of minutes EDIT: Erm.. infact it should be SELECT user FROM site_table WHERE loginTime > (now( ) - ( 15 *60 )) as you want all users not just tester
  11. okay let me see if i have all the facts correct You have a 2 sites, Site A and Site B Now you wish redirect from Site A to Site B while passing some details 1. do you have full control over both of them ? 2. are the details sensitive ? 3. how are you getting those details to be sent ? 4. can you give a basic work-flow for example, 5. why can't you put it in the url ? 6. does the visitor end up on site b or stay on site a ?
  12. <div class="subtitulo"><a href="http://hostelsuites.com/combos:php?idioma=$idioma></a><?= ucfirst($lang["combomendoza"]) ?></div> should be <div class="subtitulo"><a href="http://hostelsuites.com/combos.php?idioma=<?php echo $idioma; ?>" target="_blank"><?php echo ucfirst($lang["combomendoza"]) ?></a></div>
  13. I really don't feel like digging around your form and getting what i need, can you provide a short example of what your trying to do!
  14. Don't use a 1 for logged in, use a timestamp and update that to the current time on page activity, to see who is logged in, just do a query on isOnline for records with a timestamp of the last 15 minutes.. and that's who's logged in
  15. mypage.php?name=whatever.tk should be fine <?php echo $_GET['name'];
  16. $_GET would be the better option, and in itself it is NOT unsafe, just remember to filter it see mysql_real_escape_string for protecting mysql,
  17. This is basically a MySql fulltext query, your still need to apply the stemmer but other than that is one sql query!
  18. No, cURL can't "create" files, it commonly used to read contents from other sites and post requests I would suggest using file_put_contents however it depends what your attempting to write, here is an example from PHP.net <?php $file = 'people.txt'; // Open the file to get existing content $current = file_get_contents($file); // Append a new person to the file $current .= "John Smith\n"; // Write the contents back to the file file_put_contents($file, $current); ?>
  19. I totally agree with this If you wish to keep it private then your server will need to make the request, via sockets/cURL etc then return you can display it on your site
  20. Your "$pager" class isn't giving you the correct results, so thats probably the part thats broken, you should fix that, a quick hack would be $offset = $pager->offset; $offset = ($offset < 0)?0:$offset; //<--add quick little hack
  21. V, without knowing exactly what your attempting to do its almost impossible to say, as your last thread asked how to thing via the url.. can you provide a more complete picture plz
  22. Your get_file.php file contains more than you posted (or you're host is adding stuff!), it had some html at the start of it this is cause the file to be truncated, by the size restriction header("Content-Length: ". $row['size']); if you remove the above line you should get the full content BUT if you view source your notice some extra html
  23. as a note your regex will need to change from [^A-Za-z0-9] to /[^A-Za-z0-9]/ or /[^A-Za-z0-9]/i for case insensitive
×
×
  • 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.