Jump to content

shadiadiph

Members
  • Posts

    955
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

shadiadiph's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  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. I mean automatically to change the html
  9. $formhtml="<form action="sometext" method="POST">"; Please this is driving me nuts how can i remove an action="sometext" or action="" from a form?
  10. thanks makes sense guess i need to sleep more brain is not working 100% lol
  11. 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?
  12. 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 ');
  13. 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
  14. 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?
  15. no problem i solved it
×
×
  • 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.