Jump to content

shadiadiph

Members
  • Posts

    955
  • Joined

  • Last visited

Everything posted by shadiadiph

  1. Hi I just noticed a major issue with my site i had lot so of images that were not showing in wordpress as they had a .JPG file extension. I fixed them all and tried to write a normal .htaccess Redirect 301 / from the uppercase img to the lower case now I am getting lots of 404 errors from certain backlinks. How can I make a rewrite ".JPG" to ".jpg" in a url in .htaccess been trying for an hour now can not seem to find the answer. Any help would be appreciated.
  2. Hi I am baffled. I am trying to modify some html using $dom = new DOMDocument(); $dom->preserveWhiteSpace = true; $dom->loadHTML($html); $html = $dom->saveHTML(); return $html; I have my functions already worked out the above is what I have narrowed the error down to, all the rest of my code works probelm is when it loads html and saves html it seems to change this. prevText: '<i class="fa fa-chevron-left"></i>', nextText: '<i class="fa fa-chevron-right"></i>', to this prevText: '<i class="fa fa-chevron-left">', nextText: '<i class="fa fa-chevron-right">', The rest of the document is fine just this portion changes and messes everything up. The above code is javascript embedded into the code from somewhere it is a wordpress plugin. When I remove the new DOMDocument(); code it works fine. All the other stuff I am doing is working fine, just wondering is there anyway to fix it so it does not remove the tags. Thanks in advance.
  3. I keep getting the following error even though it is still inserting it it is driving me nuts any ideas? You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`campaignid`,`ipaddress`,`cc`,`country`,`oldadddate`,`oldaddtime`,`oldtimestring' at line 1 `oldrecordid`,`campaignid`,`ipaddress`,`cc`,`country`,`oldadddate`,`oldaddtime`,`oldtimestring`,`adddate`,`addtime`,`timestring` '1','1','58.9.96.60','TH','Thailand','2014-07-16','02:11:41','1405501901','2014-07-16','02:43:45','1405503825' my insert strings // INSERT IP RECORDS LOG $fi=""; $fi="`campaignid`,`ipaddress`,`cc`,`country`,`adddate`,`addtime`,`timestring`"; $fv=""; $fv="'$campaignid','$IpAddress','$cocode','$coname','$cdate','$ctime','$nowtime'"; echo "$fi<br />"; echo "$fv<br />"; $insertid="";$insertid=insertdata('iprecords',$fi,$fv,'yes'); my function which has always worked until today if(!function_exists('insertdata')){ function insertdata($table,$fields,$params,$idrequired){ global $db_host; global $db_name; global $db_user; global $db_pass; $db_con=mysqli_connect($db_host,$db_user,$db_pass,$db_name); if(mysqli_connect_errno($db_con)){return false;} $insertinfo="INSERT INTO $table ($fields) VALUES ($params)"; $rinsertinfo = mysqli_query($db_con,$insertinfo); if($idrequired=="yes"){ $insertid =mysqli_insert_id($db_con); if($insertid==true) { return $insertid; } // END if($insertid==true) else { return false; } // END else } // END if($idrequired=="yes") else { return $rinsertinfo; } // END else mysqli_close($db_con); } // END function insertdata($table,$fields,$params.$idrequired) } // END if(!function_exists('insertdata'))
  4. thanks i googled it mysqli_close and clicked on the link said function does not exist thanks for that
  5. Can anyone enlighten me I just went to php.net and search for mysqli_close says it does not exist?? mysqli_close($db_con); I have been using this to try to close a connection any advice?
  6. There is already an action attribute on the form i am calling i am just adding to the input fields with php but i want to change the action on the fly
  7. I am dynamically creating a form from two seperate sources and need to remove the action="something" or action="" or if there is a way to change the action="someting or nothing" can't seem to get the correct regex to replace any text between it so i am trying to remove it and recreate it. The php variable is $formhtl="<form action="something or nothing" method="post">(form fields etc</form>"; I tried str_replace and preg_replace but cant get it to work.
  8. $formhtml="<form action="sometext" method="POST">"; Please this is driving me nuts how can i remove an action="sometext" or action="" from a form?
  9. thanks makes sense guess i need to sleep more brain is not working 100% lol
  10. so you mean something along the lines if i must store a form it should be save as <input type="text" name="name" value="#_namex" /> And when i call the $form use str_replace or preg_replace to change it up?
  11. Solved it with just had to evaluate the php code which must be like <input type="text" name="name" value="<?php echo $name ?>" /> when it is saved to work $form=$fdata["form"]; eval('?> ' . $form . ' <?php ');
  12. Actually i am: 1) saving the form with <input type="text" name="name" value="<?=$name?>" /> to sql 2) calling $name 3) calling $form which has the above input tag 4) echo $form and it is showing the php code as the value
  13. Hi, Probably a silly question I have a page where I save a form with <input type="text" name="name" value="<?=$name?>" /> to an SQL database When I call it from the database $name is already called prior to calling the form but when it displays it displays the input field with the php code <?=$name?> I tried <?php echo or just using $name got the same results each time is there anyway to make this work so it displays the variable instead of the php text?
  14. Hi probably a simple answer but this is driving me nuts <script> function subform(ifrm,name,email) { var ifrm = document.getElementById(""+ifrm); //alert(name); ifrm.contentWindow.document.forms[0].elements[name].value = 'James'; ifrm.contentWindow.document.forms[0].elements[email].value = 'test@gmail.com'; //ifrm.contentWindow.document.forms[0].submit.click(); } window.onload = subform('adrian1','Name','Email'); </script> This script is filling in a form it only works if i alert(name); if i don't it does not work?? am i missing something or do i need to declare the name differently for example name value could be Name or FName or LName email could be Email e_mail Thanks in advance
  15. it does not work as soon as i get out of the ../../../httpdocs folder to ../../../../mobile the .mobile subdomain it starts throwing an open_basedir error
  16. Hi can anyone tell me how I can write data to the main www.example.com from mobile.example.com i keep getting a http write error when i try to mkdir or a file on the main domain from the subdomain??
  17. both are telling me this. Last week it wasn't but I just downloaded the latest firefox also says *html is not allowed in css documents
  18. Just downloaded the new firefox and it tells me opacity and filter are no longer valid in css?? Does anyone know what to use instead, I tried -moz opacity but the w3 validator still kicks it out can anyone give me an idea. I tried looking at w3's css page but couldn't find the solution??
  19. I have been trying to make a div with contenteditable have ironed out sevral cross browser problems already but am having the following problems 1) when i click in the editable area in chrome there is no initial caret (cursor) until I type something. 2) On mozilla and seamonkey the caret (cursor) initially appears to be the same height as the div until I type. Any ideas?? CSS #editabletxt{ width:500px; height:100px; text-align:left; font-size:80%; font-weight:normal; background:#fff; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; border: 1px solid #dbe1e6; padding: 4px 4px 4px 4px; } .editortext{ width:500px; height:100px; line-height:150%; display:block; overflow:auto; outline: 0px solid transparent; word-wrap: break-word; white-space:pre; } HTML <div id="editabletxt" name="editabletxt" class="editortext" contenteditable="true"><div></div></div> if you are wondering why there is an empty div in the main div its a hack for IE to stop it including double line breaks.
  20. solved it must have been tired last night
  21. works the same but it's saving the real sized image
  22. Sorry bit rusty but been trying this for hours I upload an image no errors are showing i upload a jpg file and it saves to the server fine but its saving the original size not the new resized image size any ideas?? if (isset ($_FILES['file'])) { $tmp_name = $_FILES["file"]["tmp_name"]; $file_type = $_FILES["file"]["type"]; $fileatt_name = $_FILES["file"]["name"]; if ($file_type=="image/pjpeg" OR $file_type=="image/jpeg" OR $file_type=="image/jpg") { $src = imagecreatefromjpeg($tmp_name); } // END if ($file_type=="image/pjpeg" OR $file_type=="image/jpeg" OR $file_type=="image/jpg") if ($file_type=="image/png" OR $file_type=="image/x-png") { $src = imagecreatefrompng($tmp_name); } // END if ($file_type=="image/png" OR $file_type=="image/x-png") if ($file_type=="image/gif") { $src = imagecreatefromgif($tmp_name); } // END if ($file_type=="image/gif") list($width,$height)=getimagesize($tmp_name); $width = $width; $height = $height; $newwidth = "200"; $newheight = "200"; $ratio=''; if($width==$height) { $newwidth = "200"; $newheight = "200"; } if($width>$height) { $ratio=($height/$width); $newwidth = "200"; $newheight = ($newwidth*$ratio); } if($width<$height) { $ratio=($width/$height); $newheight = "200"; $newwidth = ($newheight*$ratio); } $tmp = imagecreatetruecolor($newwidth, $newheight); $new=imagecopyresampled($tmp, $src,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = "./yxy/". $fileattt_name; imagejpeg($tmp,$filename,100); imagedestroy($tmp); }
  23. thanks seems to work but not sure if it is what i wanted as i am trying to format the text bold underlined etc problem is when I add a <b> tag to the innerHTML it seems to automatically close it so the font type doesn't change??
×
×
  • 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.