Jump to content

tommytx

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by tommytx

  1. well yes it was that field, especially since it is the only field I am using... but your question about what is the exact error.. got me back to the basics and I removed that dinky little nothing error report above that tells you absolutely nothing but that it failed.. so I added the mysql error reporter as I should have to begin with and it called out an error with something like... we've meaning it did not like the ' symbol.. so before submitting the update I now have the program scan every character and escape this little sucker... like so.. \' and all is well.. Thanks for getting my brain spinning with the "exactly what is the error" that brought me back to basics and a solution.. Thank you very much... I can move on now to the next molehill that I will be able to make into a MOUNTAIN.. HaHa.. For anyone who is following this thread to learn... here is the error monitor i added and got rid of the useless one above. $result=mysql_query($sql) or die("MySQL error has occurred.-> Your Query: " . $sql . "<br/> Error: (" . mysql_errno() . ") " . mysql_error())
  2. Not sure what that is supposed to do.. I went to mysql and wp_posts and executed that which gave the below.. no info.. basically wp_posts CREATE TABLE `wp_posts` ( `ID` bigint(20) unsign... But it a simple matter to look at the structure for posts_comments and see that it is a "longtext" capable of handling a whole lot more than 255 characters... if anyone has the time I would greatly appreciate it if you could run my tiny php file and see if you can update a large paragraph... and I did try the below and it woud not write it either.. even though the data is already being held by the same post_content.. Its really wild as you can see it grabs a full page with images from post id 1 of the post_content column but will not post same to the id 877.. gets a fail and the data is not stored... makes no sense.. I would be forever in someone's debt if you could take the time to simulate and tell me what I am doing wrong... its very important and holding up an important project. Thanks in advance. <?php include("connect-vicky-info.php"); $id = 1; $sql = "SELECT post_content FROM `wp_posts` WHERE ID='$id'"; $result=mysql_query($sql); $row = mysql_fetch_array($result); $post_content = $row['post_content'] . "<br>"; echo "$post_content<br>"; $id = 877; $sql="UPDATE wp_posts SET post_content='$post_content' WHERE ID='$id'"; $result=mysql_query($sql); if($result){ echo "<br><b>Successful!</b><br><br>"; } else { echo "<br><font color=red><b>Negative Result.<b></font><br><br>"; } ?>
  3. Its a longtext field.. I thought everyone knew that wp blog post_content would be a huge text field since sometimes it holds several pages of infomation.. When directly accessing a longtext field is there anything I need to tell the program so it knows how to handle a long text field... there is no reason it should consider it a 255 max for long text.. Maybe I will post this on the wordpress site.. maybe they will have some idea... makes not sense to me..
  4. Well I will look at it just for shits and giggles, but as I stated above.. it is the post_content field in a word press blog.. and since its the content section and sometimes needs to hold several pages of data I doubt it would be restricted to 255 characters since all of mine have a 3 or 4 thousand on very page... and I am trying to edit and replace the same date... take it out edit it and put it back... but it won't go back.. This does not make any sense... Also just for experiment i will go to the SQL panel and see if I can do manual SQL and put in more... now I know for sure I can export it into csv then edit and import back.. but I really need to do it one by one... not a ton of csv... messing the entire table... Any other thoughts.. Just thought of another possibility.. will read the post_content then edit and try to instantly update (replace) but I am pretty sure that won't work either... damn this is annoying..
  5. I am trying to update the post_content on a mysql blog and of course that normally will allow a huge amount of characters... but for some reason I am not being allowed to do the update via php unless the text length of the update is under 255 characters.. if I exceed the 255 it says failed.. under 255 works fine.. Any suggestions. $id = 877; $mydat = must be 255 or less... include("connect-vicky-info.php"); $sql="UPDATE wp_posts SET post_content='$mydat' WHERE ID='$id'"; $result=mysql_query($sql); if($result){ echo "<br><b>Successful!</b><br><br>"; } else { echo "<br><font color=red><b>Negative Result.<b></font><br><br>"; }
  6. When I visit any table in the database and then click the Table Structure.. the structure is missing and when trying to Export CSV i get the following message. export.php: Missing parameter: what export.php: Missing parameter: export_type And the csv export does not occur.. any ideas? I tried both firefox and IE8 and same.. and just earlier today all was fine. Tried shuttting down and restarting but no change. Also I do notice that the full Table Structure is in place when you select a data base.. For example if I click on data base number 1 or 2 or any database.. The full data base has the structure in place but if you click on any table in the data base the structure is missing and just a small amount of dat is on the bottom of the page.. The data base seems to continue to work ok.. but I cannot export.. as for example when I try to export CSV or any other export it fails. Never seen this before..
  7. Is there someplace on the server where I can grab the status code each time google hits my site? For example when I set up a new site or even transfer one site to a new one, I monitor the crawl to make sure if something goes wrong I can fix it without waiting for a thousand 404 errors in my google toolbox. So I log each google visit... but what I would like to do is check the status code that google received like a 200 or 404 or 301 forward and etc.. that way I could add the code right along with the page visit and each hour i could monitor to see if the crawl is going well.. or is going bad... I know that it is logged into the awstats, but I want to dynamically capture it on the server at the same time I capture the page and ip of the google bot. Does anyone have any idea how this might be done.. Below shows an example of what I want to do.. 66.249.73.215 Sunday, 22 July 2012 09:23 pm Refer: UserAgent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) ReqFile: /idx/?idx-q-Cities=Montclair+Twp.&idx-q-PriceMax=2000000&idx-q-PriceMin=1500000&idx-q-PropertyTypes=1547 Status:200 as you can see I have the url as Requested file... but it would be much better if I could get the status code like 200 or 404 etc.. You see the Status:200 I don't know how to get dynamically... This way if I see a lot of errors popping up i can fix the rest of them before google finds them... for example when using short code...
  8. that worked to send commands to the cron, but only after log in manually... what I am really trying to do is auto log into Cpanel so that I can set crons remotely... i used to do it with the old myuser:mypass@mydomain.com but that no longer works so I need a work around to do cpanel autolog in... via unattended PHP... can anyone point me in the right direction for automating login to cpanel.. X mode...
  9. Can someone help me with this.. I cannot figure out why it will not log in.. The actual url and user/pass are valid so feel free to test the live site. <?php // INIT CURL $ch = curl_init(); // SET URL FOR THE POST FORM LOGIN curl_setopt($ch, CURLOPT_URL, 'http://www.handy-hanky.com/shirley/homesell_cron.htm'); // ENABLE HTTP POST curl_setopt ($ch, CURLOPT_POST, 1); // SET POST PARAMETERS : FORM VALUES FOR EACH FIELD curl_setopt ($ch, CURLOPT_POSTFIELDS, 'user=tom&pass=test&login_theme=cpanel'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); // EXECUTE 1st REQUEST (FORM LOGIN) $store = curl_exec ($ch); echo "STORE = $store<br>"; // CLOSE CURL curl_close ($ch); ?>
  10. I have no idea where to place this... I have asked on several fourms and so far no one has been able to explain it.. My browser whether it be my IE8, IE7, or FF... my referrer is flat gone... in other words when I visit a site the referrer is always blank... I tried upgrading from IE7 to IE8 and loaded firefox but same result.. I have turned off all my security completely.. no change. I only noticed this a few weeks ago... if I visit a website that tells me what my referrer is, it is always blank... this is a serious problem for me, as I design websites and many of them have doors that won't let you in unless your referrer is from a specific site... so you can imagine what problems I am haveing .. if I set one up I cannot test it since my referrer is always blank.. Any suggestions would be greatly appreciated.... I
  11. Actually I suppose it is really adding the record (insert) if not already there and then immediatley doing an update... but what the hell it works.. just extra unnecessary commands but unless anyone has a better idea this is great... It can't hurt to make a record then do an instant update... same data anyway.. Does this make sense....
  12. Thanks everyone for all the help, using your input I came up with this end result and i am posting it here as others may be able to use it.. It works great, either adding a new record if Link does not exist or editing the record if the record does exist. Link is a long about 50 unique characters that identifies a unique record. The only thing I am not sure about is why I had to send the Insert command twice... if you simply send the one long command, it will not add (insert) new records.. it will only update. But that is ok as it only has to run against maybe 20 records each day so speed ins not a problem... and of course this is super fast anyway even with the duped command. Anyone have any thoughts whey it requires the clean "Insert" to work... But its not really important as it works like a big dog... thanks for the ideas.. $sql = "INSERT INTO `test` VALUES ('$fname', '$lname', '$phone', '$fvisit', '$Link')"; mysql_query($sql); $sql = "INSERT INTO `test` VALUES ('$fname', '$lname', '$phone', '$fvisit', '$Link') ON DUPLICATE KEY UPDATE fname='$fname', lname='$lname', phone='$phone', fvisit='$fvisit'"; mysql_query($sql);
  13. Typo: write the code to (update) all the ones that were in the data base and (insert) all the ones that the link was missing from. But surely its easier than that...
  14. Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier . I am not too good at this but i did look up mysql affected rows() and it seems to give the number of affected rows, but not the identity of each updated row.. Could you expound a little so i might catch one... Bottom line what I need to be able to do is do update on lets say 20 rows, then do insert on any rows that failed the update. I had thought about just searching all the links to see which links are in the data base and which are not and the write the code to insert all the ones that were in the data base and insert all the ones that the link was missing from. But surely its easier than that... Sounds like the idea you offered would work if i could just understand it better.
  15. $sql = "UPDATE test SET fname='$fname', lname='$lname', phone='$phone', fvisit='$fvisit' WHERE Link = '$Link'" or exit(mysql_error()); I am using the above to do some updates into a data base and it works fine, but i need some way to detect when the update fails so I can the do an insert. Basically I have some updates and new entries in a text file that I am using php to attempt and update and if that fails it is assumed that the record does not exist so now I need to switch over and do an insert. AT this point the updates are working fine, but if the record does not exiist it it not alerting me and just simply skips that record... I added the errror checker at the end as you see above but it is not showing any failure... Anyone have an idea how as it parses the text file will let me know if it fails to update so that I can immediately using something like if fails then do an insert... or add record.. Shouldn't the above code be throwing an error for the ones that the $Link is not found so I can do insert on that record?
  16. Ok. I figured it out on my own. But thanks a lot anyway.
  17. Thanks a bunch... worked great.... Small note.. for anyone else using this... I could not get it to work with the url_decode function, but when looking it up it appears it should be urldecode.... but you are the best... thanks..... problem solved... But what is a little _ here and there among friends.. Thanks again....
  18. http%3A%2F%2Fmydomain1.com%2Fping3.php%0D%0Ahttp%3A%2F%2Fmydomain2.com%2Fping3.php%0D%0Ahttp%3A%2F%2Fmydomain3.com%2Fping2.php%0D%0A This is the $_Get from a form sent by a text area... How do I escape or unescape this to get the basic original data that was in the Here is the origina data before the form sent it to a php program that grabbed the data via $_GET <textarea> http://mydomain1.com/ping3.php http://mydomain2.com/ping3.php http://mydomain3.com/ping2.php </textarea> Thanks for any help. Tom
  19. Formal Thanks to linuxdream.. He actually set me up on his own server to tackle my problem... now that is what I call helping out..... Actually I am a little embarrased as there was nothing wrong with his class.... speaking of that it is a reall class program... I am sure a lot of work went into it..  Anyway so linux doesn't have to embarrass me which I am sure he wouldn't anyway for anyone who is following this thread the only problem was the fact that all of my VPS one on slhost and one on hostgator were still running the old 4.4.4 version of PHP and of cours linus state of the art class doesn't go for that old stuff... so I am in the process of beating up the hosts to get then to update the php. Thanks again linux you are the best. For anyone following this thread, it pops out a great header just like the doctor ordered and not my local header, its the header of the site that the url is used on...
  20. linuxdream Thanks I just sent you and email with ftp access in case you want to see why the class hates the linux server or what? Thanks
  21. Just thought I would throw this is as to my curl installed: CURL support  enabled  CURL Information  libcurl/7.15.3 OpenSSL/0.9.7a zlib/1.2.1.2  Any other ideas on something I might check. Thanks
  22. linuxdream ******** It is giving the very same error on 3 servers as shown below. Is there a simple "hello world" script I can use to get down to real basics to see if my setup will work at all. Also is there a forum anywhere that discusses this class so I don't keep wasting your time. Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/ownahome/public_html/ripcurl.class.php on line 15 http://www.adsentry.net/header_ripcurl.php http://www.vahud.com/header_ripcurl.php http://www.2ownahome.com/header_ripcurl.php All 3 sites are still in place in case you want to visit them to see the error. this looks like a great class, I hope I can get it working.. thanks again.
  23. Thanks that was perfect only 30 k and looks great... below is the first few lines of the code in the gz that I downloaded.... and it is 160k if you can believe that.... ripcurl.class.php                                                                                  0000644 0001750 0001750 00000067564 10554246761 013351  0                                                                                                    ustar  ching                          ching                                                                                                                                                                                                                  <?php //RipCURL class 0.4 - SD Linux Services //This class was written by Brandon Ching of SD Linux Services //It is licensed under the GPL class ripCurl{ //Class definitions //Define the default directory for ripWrite. Must include I will try the new pgm now and let you know.... But this looks great... thanks again... By the way below is what the 30k file looks like and it looks sweet.. I will try my unzipper again tomorrow to see if there is something wrong with my unzip... it has been working fine for years..... <?php //RipCURL class 0.5.2 - SD Linux Services //This class was written by Brandon Ching of SD Linux Services //It is licensed under the GPL class ripCurl{ //Class definitions //Define the default directory for ripWrite. Must include trailing "/".
  24. Thanks Linux, The class looks like a real cool tool and I think will do exactly what I need. However I am having a problem getting it to load into my DzSoft PhP Editor. Is it protected so I can't view the code in the class using the Editor... I can load the class into a text editor, but all scrambled so hard to read. The php editor will straighten it up.  I did try to upload in both text and binary for the class but no joy either way. Normally I can see code in the class in the DzSoft Php editor. I copied the code you wrote above and renamed the class as you have it but I got this error... Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/adsentry/public_html/ripcurl.class.php on line 12 any ideas come to mind..... its on http://www.adsentry.net/header_ripcurl.php with the class named  ripcurl.class.php When the url above is activate the error is as shown... I will include my actual code used to load the class below: <?php require_once('ripcurl.class.php'); $rip = new ripcurl(); $url = "http://vahud.com"; $rip->showHeader(); $rip->ripRun($url, 1); echo $rip->getRawHtml(); ?> Oh by the way I did download from both of the sites you gave with the same results from both sites. I really would like to get the class going as there is a lot of features that I would like to experiment with.... Thanks again.
×
×
  • 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.