Jump to content

SE_Danny

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

0 Neutral

About SE_Danny

  • Rank
    Newbie
  1. SE_Danny

    Date comparison

    Hi guys !Ok I have a date that looks like that : "Wed, 08 Jun 2011 11:04:18 -0100"And I have the current date.How can I convert both the current time/date and the other date into numbers so I can compare them ?Like : if($currentdate<$otherdate) ...Thanks a lot !
  2. Hi guys !I have a simple php script that saves a webpage in my database, and looks for a thumbnail for it.Here's the code :The problem is, it's extremely slow.How can I make that much faster ? <?php$message = "saving bookmark ... please wait.";include "functions.php";if(!loggedin()){ header("Location: ../index.php"); exit();}else{$title = mysql_real_escape_string($_POST['Title']);$site = mysql_real_escape_string($_POST['Url']);$num = $_POST['num'];$p = $_GET['p']; if($title&&$site&&$num){ switch (true) { case stristr($site,'.png'): $thumbsite = "$site|||/Logos/png.jpg";
  3. Thanks a lot ! The 'switch' does not actually make it faster, as it is basically the same thing as if .. else, but I got an awesome idea thanks to you for ($i = 1; $i <= 9; $i++) {$test = "site$i";switch($$test){ case "": echo "The $test is empty<br/>"; break;}} So thanks !
  4. Hi guys !So basicely, I have some variables $site,$title,$thumb. Now depending on the variable $site (if empty or not), I want to dislplay something different. So i thought the only way to do so is with some if else statements.But as I have to check the variables $site1 to $site9, it gives a long list of code, and I thing it will slow down the loading of the page.The idea is, when a user has not set up/choosen a value for $site, I want to show just something else than when he has already saved it.I'm having all this values stored on my database.But how can I do this without slowing down the ho
  5. Thank you !So I didn't use a function as it would slow down the thing to connect to the database 9 times, so I just did it like that :$query = mysql_query("SELECT * FROM user WHERE username='danny' ");while($row = mysql_fetch_array($query)){$title1 = $row["$titlep1"]; $title2 = $row["$titlep2"]; $title3 = $row["$titlep3"];$title4 = $row["$titlep4"]; $title5 = $row["$titlep5"]; $title6 = $row["$titlep6"];$title7 = $row["$titlep7"]; $title8 = $row["$titlep8"]; $title9 = $row["$titlep9"];$site1 = $row["$sitep1"]; $site2 = $row["$sitep2"]; $site3 = $row["$sitep3"];$site4 = $row["$sitep4"]; $site5
  6. Thanks for you fast reply How do I do that ?
  7. Hi guys.I have a website where user can save websites.So I have a database with information for each user that are :title 1, title2 ... (Webpage title)site1, site2 .. (Webpage url).Now I want to display all these infos to the user, so I need variables like $title1, $site1 ... and to avoid tons of lines of code, I wanted to make a PHP function like that : function getinfo($a){$title = "title$a";$site = "site$a";$query = mysql_query("SELECT *FROM user WHERE username='randomuser' ");$row = mysql_fetch_array($query);while($row = mysql_fetch_assoc($query)) { $$title = $row["$title"]; $$site =
  8. Yeah that's what I meant Thanks a lot dude !@Fmdpa, of course I know how to assign a variable. I just forgot the ';' But thanks for your reply !
  9. Hi guys !I have some simple variables $a and $b like that : $a = 'google'$b = 'http://google.com' And what I want to do is define the variable $google like that : $google = 'http://google.com' Is that possible ??Thanks !
  10. Ok, thanks for your replies guys !
  11. Thanks ! And the for part, are they using php then ?
  12. But isn't that illegal ? I mean there are security reasons why we have not access to iframe content for example.And how do they change the links then ?
  13. Yeah thanks, but that was already clear to me. The question is how are they doing it ? How are they changing it ?
×
×
  • Create New...