Jump to content

egturnkey

Members
  • Posts

    91
  • Joined

  • Last visited

    Never

Everything posted by egturnkey

  1. thank you so much i've studied your example and it works pefect also i've applied and works pefect too thanks alot for explain the idea
  2. Hello friends, If i've link as following myownsite.000/index.php?r=5774 and i want to convert it to be myownsite.000/5774 i've tried .htaccess RewriteRule (.*)\ index.php?r=$1 but didn't worked ! can anyone write it thanks
  3. thank you can you or anyone kindly post to us Reference , i mean where to know all about that line feeds. or only it is \n and \r
  4. Hello friends, in my database table or even php files i always find within the text something like this i love people\n i love world\n i love anything and sometimes \r and something \n\r so what does it mean is it like <br> or what ? thanks
  5. i found the reason ! my example above it very simple but the real one has keyword-ID and if the keywords = x y z and i replace space with - so the link will be x-y-z-ID <-- works but for .htaccess RewriteRule -(.*)\.htm view.php?id=$1 <--- will not work RewriteRule _(.*)\.htm view.php?id=$1 <--- will work so the link will be x-y-z_ID <--- Fine enough Now another quetions please what for multi-str replace i mean if i've $x= "I love?world"; i want replce both spaces and ? with - so it be I-love-world r_replace(array(" ","?"), "-", trim($x)); <-- it is right
  6. Hello friends, If we have link $x = "search engin"; <a href="google.com"><?=$x?></a> and we want to remove space btween (search engine) to be (search-engine) ineed we should use str_replace and we change the link to $manal = str_replace(" ", "-", trim($x)); <a href="google.com"><?=$manal?></a> It not working ? and only working if $manal = str_replace(" ", "+", trim($x)); why + not - ? and is there anyway else to replce space to - ? thanks
  7. thank you, but i'm not sure it is secure way as well cause it idea depends on getting size and header and both can be faked easily i've found one of the comments saying, he is using <getimagesize> and if no value or error so it can't be image and if there is values then it must be image and pass it do anyone has comment on it , is it true thanks
  8. Hello dear friends, i've very simple php script for my website and it has feature that visitor can register and upload image for own profile. somone has uploaded PHP Shell as image and succeed to control on my website using that shell. so the problem is in uploading image can pass any file so can someone please help me how how to prevent it and here are the codes of image upload form and function. * Image upload form code <form action="profile.php" method="post" enctype="multipart/form-data" name="form" id="form"> My Picture : <input name="userpic" type="file" id="userpic"/> <input type="submit" name="Submit" value="Update"/> * Profile.php code (it rename the image by add time to its name then put the image in path /users/ then insert the new name of the image into the database table) $ImageName = $_FILES[userpic][name]; // Get the image $t = time(); // Get Time $NewImageName = "$t$ImageName"; // New name copy($_FILES[userpic][tmp_name], "users/$NewImageName"); $sql= "update users SET userpic='$NewImageName'"; How then i can stop they upload shell :'( thanks
  9. thank you all for informations and the null problem informations link. i've read it @blink359 thank you so much i've used your way using (name!='') and worked perfect.
  10. Hello dear friends, If i've database table has named as info (id, name, number) and i wanna say select from info where name must has value not empty select * from info where name='xxxxwhatxxx' i've tired $name and $1 and 1 but all not working how to say where name must has value and not empty example if i've (id, name, number) values (1, 'manal', '4') (id, name, number) values (2, 'shimaa', '7') (id, name, number) values (3, '', '3') and i wanna say sellect from info where name has value so it shows me only data of id "1" and "2" only thank you so much it would helps me alot to improve myself
  11. well i think almost understood your idea i set it if the page number divided by 10 then echo <br> so it means every 10 pages will leave line ... something like this i think... i don't know how to apply it on that code but i will try thank you for that idea
  12. Hello dear friends, I've many titles and the page that show it , show only 15 per page and as the titles are more than 15 so it shows me 15 and select page below the bad news is that the pages number are getting out of the page cause it is too many 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20---> ect (goes out the page) so how can i resize it to be as following 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 (pages number 10 ber line) here is the code that respoible to show the pages number if($page > 1){ $prev = ($page - 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\">Previous</a>"; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i"; } else { echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a>"; } } if($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next</a>"; } where $total_pages is the total pages will be shown thanks so much
  13. thanks for help , that make it more complex lol now with your help i can know if it even number or odd number so i can use double way if even then will divided by 2 if not even ( sure will be odd ) then i will divided by 2 then sub - 1 lol life is so hard so let the total ids $count if ($count % 2) { $half = $count / 2 // not eved so divied by 2 } else { $makeiteven = $count - 1 // odd number so - 1 $half = $makeiteven / 2 // divied by 2 then } then part 1 $sql ="select * from mytable LIMIT 0,$half"; and part 2 $sql ="select * from mytable LIMIT $half,$count"; i wonder is there any way makes life more easy than that way
  14. thank you for your answer but i mean if i've database table with alot of ids ( but i don't know how many ) and willing to cut it into 2 parts part 1 = show from 1 to exact half of the ids part 2 = show from exact half of the ids to the end
  15. LOL i've an idea .. i may use (Count) to get the total count of ids -->1 then i divied it by 2 to be $half = $count / 2 then i use $half to be $sql ="select * from mytable LIMIT 0,$half"; and to get the seond half lol $sql ="select * from mytable LIMIT $half,$count"; lol looks very hurting way is it possible Ops, what if we have odd number of ids
  16. Hello friends, if i've database table (mytable) has the following ids 1 2 3 4 5 6 and i want to get it with limit the first (1 to 3 ) only $sql ="select * from mytable LIMIT 3"; this will show the first 3 (1,2,3) how then i write code that shows which is after 3 so it shows me 4 5 6 and if there any way i can say $sql ="select * from mytable LIMIT (first half of ids)"; and (shows 1,2,3..ect till half) $sql ="select * from mytable LIMIT (second half of ids)"; will (shows 4,5,6...ect till end) thank you
  17. I will also try this, thanks for that idea. Amazing, it works perfect thank you so much it has fixed 2 main problems i have cause i was going to import all categories then makes it into array now with your code, you've made very short way to me thanks
  18. Hello dear friends, I've made littel code that fetch the categories name from an software website $text= file_get_contents('http://win.softpedia.com/'); // it make win.softpedia as text code $start = strstr("$text",'<ul id="windows_cat">'); // search inside to that start point $end = strpos("$start",'" title="'); // end at it to that end point $cat = substr($start,66,$end-66); echo "$cat<hr>"; it will show now the categories but it only shows the 1st one Antivirus/ how then loop it to find next and next and so on to show me the list of the categories ! thanks
  19. thank you both it is working now perfect
  20. Hello friends, if i have the following $path = "http://*site*.com"; why can't i write the following $ORGtext= file_get_contents('$path'); it works only if i write $ORGtext= file_get_contents('http://*site*.com'); but i want to put $path instead of the url at file_get_contents is it possible and if yes then how ? thank you
  21. Hello friends if i've this $text = "i love adult sites" then i wanna clean it by elminate words like adult - bad - kill - die so it be $clean = "i love sites" as you can see it eliminated the word adult how it could be which code can i use ? thanks in advance
  22. Hi there, for every case we have "gooo" as commen in all how this could be one code using anything like elseif or switch whatever... if($refere && (stripos($r, $refere) === false)){ echo "x1" }else{ echo"goooo" } And if($limited && ($line[hits] >= $limited)){ echo "x2" }else{ echo"goooo" } And if($pword && (isset($_POST['password']) && $_POST['password'] == $pword) ){ echo"goooo" }else{ echo"x3" } And if ($line[capt] == 1 && ($_SESSION["security_code"]) ){ echo"goooo" }else{ echo"x4" } thanks in advance
  23. thank you so much, it works that is right , i should have made it $1 then $2 ..ect sorry for editing it, it was in same time
  24. Sorry, thread in wrong section... please admin delete it from here
×
×
  • 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.