Jump to content

egturnkey

Members
  • Posts

    91
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

egturnkey's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  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
×
×
  • 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.