premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Look into curl as I believe it can follow redirects.
-
Just a side note: $arrSQLFilters[] = sprintf( That statement you set it equal to an array index of $arrSQLFilters, if you do not want it to be an array, remove the []. If you wanted it to be an array, then you have to call the index to use it: echo $arrSQLFilters[0]; Assuming that the index at 0 is what you want to use. You can also do a foreach to loop through the array.
-
Nope, the reasoning for it is that you need to access that script to get the image. If you just type in image.jpg, there is no image.jpg on the server and without a mod_rewrite being setup to put that through the script the server just sees it as a 404 Page Not Found. Unfortunately that is just how it is.
-
I would like "for" to wait 5 sec
premiso replied to salman_ahad@yahoo.com's topic in PHP Coding Help
sleep Sleep it for 5 seconds -
I do not think your line of thinking is possible, as that is not really part of variable's variable. A variable's variable is this: $test = "normal"; $$test = "not normal"; echo $normal; Which I am sure you have an understanding of, given the post. But that just basically creates a variable called Normal which was created dynamically in a sense. Now with arrays, the indexes cannot be interpreted from [0], as far as I know, as it just does not work. Now if that is all you are doing you can easily do a str_replace on the [ and ] and remove them then use that for the index, or add the index as [0] which would also work. But as far as you are trying to use it I do not think that is possible and I think you are missing the point of variable's variable. I could be wrong, but I have never seen anyone try to do something like that. The real issue is that the brackets are in no part of the index of an array and php does not know to "remove" them without being told to, and thus those will throw it off.
-
In order to do what you want, you will need to utilize mod_rewrite and parse/send any .jpg's to your image script to process, this can be tricky as you probably have normal jpgs on your server that do not require that script to display. But yea, you want to look into mod_rewrite for Apache.
-
Slow data retrieval which requires improvement..plz help
premiso replied to joshtheflame's topic in PHP Coding Help
In your database is the c_id a primary key? If not set it to index, other than that try running that query on it's own and see how long it takes, if it still takes 10 seconds, well it is your SQL setup. If it takes way less (should take no more than 3 seconds) the issue is with the javascript retrieval. Narrow it down that way and post your results so we can better help you. -
Your brackets are incorrect in the echo: $num = "0"; // no brackets needed here echo $test[$num]; // [ ] are needed here Not sure if that is what you are looking for, but that basically does what it seemed like you wanted done.
-
Well for starters that can be done in a more efficient matter. Where does $flight_num come from and what is the mock up of it (post some example flight nums). And I can help you make this more efficient for ya.
-
I started when I was 8 on our first computer which ran DOS / Win 3.1 with Prodigy Internet. I would watch my dad and memorize all of his passwords then get into the computer and login to the internet. Little did I know that the internet cost money by the minute and yea, I got in deep shit for racking up the bill and for being on it at 8. I did not get into web design until I was 12/13 while playing Rainbow 6 I saw a website someone made for the clan I was in and asked him how it was made, I actually was asking how he made this 3d image, and he just said "Notepad". So I looked all over how to do images in notepad and somehow stumbled onto HTML. Well I memorized most if not all HTML within 2 weeks and my hunger was not settled, so I went and learned Javascript and did all my testing on Geocities/Homestead with shitty websites (think of the Simpsons when homer makes his website prior to the Mr X). After that I was easily amused with Javascript for a few years and learned a bit of Java, not much though. After that I tried VB/ASP but I was kind of put off by the Visual studio costing money so I looked for a free solution and found Pearl/CGI. Learned some Pearl until I came across PHP. Well after I found PHP that was what I wanted to code in. I learned it all from online. When I went to college I took a course in Pearl, as they did not offer a PHP course. Learned the basics of programming there, namely how to properly use functions and debugging techniques. Then a bunch of classes later (all the same basic thing as Pearl) I took an Oracle class and learned SQL and how to do databases properly. After graduating college with an associates degree at 19, I took on a job for a local programming company. Well the company was not in the ideal location, but I learned a ton from the few months I worked for them and finally got a job closer to my wife (gf at the time) doing IT Support. Although I love to program, IT support is more my area as I have a nack for helping people / talking people through computer problems without getting too frustrated and I do like the hardware side of computers too, so taking them apart is always fun. Now PHP is really just a hobby, however I used to be pretty decent in .Net studio, J# C# C++ VB and ASP, I have not used them in a long time. I do use Java now and again, but PHP is just too nice for me and I like to stick to it. Fun stuff and it all started by memorizing my parents passwords as they typed.
-
Well after doing some reading (really hard to find much information on this) I have come to a conclusion that something in PEAR stops this or you are missing a needed step, which I do not know what it is. How about sending the message un-encrypted and just encrypting the attachment? Or try encrypting the attachment before you attach it as well as the message, maybe you have to them both encrypted for it to work? I do have to say I know nothing about this cause I never used the GPG encryption method, so yea. I am just grabbing at straws.
-
Have you tried doing some basic debugging by outputting the encrypted, testing that the file was created and contained data? Have you tried removing the encryption part and seeing if that sends? In all of the bumps you failed to tell if you have tried anything or just waited for a response. The reason you are getting lack of responses is the PEAR package, not many people want to install the exact setup just to test and see how to get your script to work, sorry. But for the most part you are going to have to just debug this old fashioned way with trial and error until you figure out what is wrong. How I would approach this problem: Take out all the complex stuff and create a script that simply sends a test.csv file (that is already created in the folder the script is in) and send that, with nothing else. If that sends fine, slowly add more items, if it does not you now know your problem lies with PEAR and can at least pin point why it is not sending properly. But your first problem is testing that you can indeed send a file and receive it without all the extra stuff, if that is where the problem lies figure out how to fix it then add on from there.
-
FML was pretty funny, Lamebook I just couldn't get into. But that Star Wars deal was pretty funny. Ty for some humor for the day
-
When you do the update query you set the column that you want to be the time to that value: UPDATE table_name SET col_time_log = NOW() + INTERVAL 120 SECOND WHERE userid = someid Then if you want to see if the user has posted recently before insertion you can do this: SELECT userid FROM table_name WHERE userid = someid AND col_time_log < NOW() And if there is a row returned that user has posted within the 2 minutes and should not be able to post (given that I did my logic correctly). EDIT: Thanks mchl for pointing out how to do it in MySQL
-
As corbin stated, I am sure it is the www. that is throwing it of, remove that part then after you do it try this to flush the DNS and see if it works: Start > Run > gpupdate /force After it is done refreshing the policy try to go to that site and see if it took.
-
You can do it by using include.
-
Yea, I think the whole bill folding is just a load of shit. I mean come on, if these people who believe it was a US Govt. conspiracy theory could provide more proof than "Oh Lookz a bill foldz to show some funky ass design", I may listen. I mean come on you can turn anything you look at into anything you want if you look at long enough. As far as I am concerned it was terrorists fault, whether domestic or foreign, why do we need to differentiate between them? If you do believe it was a conspiracy (non-US Govt), well I would have to agree as the terrorists who did this had to conspire to pull it off in the first place. Conspiracy is defined as: a group of conspirators banded together to achieve some harmful or illegal purpose. But as far as a US Govt conspiracy, there has not been one argument I have read to sway me that it was. Just because engineers theories say that it could not melt the steel does not mean that to be true. A rough example is Myth Busters, they always do the math and sometimes they are completely wrong. Certain circumstances can cause different results and to replicate it is nearly impossible unless you want to waste a ton of money to build a replica and crash jets into that replica to see. Eh my 2cents. Sorry if I put anyone down, your views are your views, that is just mine. Not meaning to offend anyone.
-
It could be that you are not closing the <li> tag, try adding a </li> after the </a>, as the li class may be causing the issue.
-
Becareful when using $ inside of double quotes as it is interpreted. return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}\$/ix", $str)) ? FALSE : TRUE; Try that and see if you get the same errors (note I escaped the $ by adding a \ infront of it.).
-
Instead of setting it to 120, use a timestamp instead. Setting the database field to time()+60*2 would put that timestamp 2 minutes in the future, then when you check it, if the current time is less than that time stamp the user cannot re-post. EDIT: I am not sure what function you would use to mimic that in MySQL, but time is a PHP function.
-
mysql_query returning boolean instead of mysql ressource
premiso replied to jfdio29's topic in PHP Coding Help
The only alternative I can think of is your Query has an error in it and thus returning false. As you said you did test in phpMyAdmin, try adding this just to see if there was an error: $resultatProjets = $DB_obj -> execute($queryProjets); echo "<br />MySQL Error: " . mysql_error() . "<br /><Br />"; Other than that the code looks fine, so add that and see if there was an error in your query. -
Eh, never worked with Access in PHP, so yea. Let me ask you this, have you tried it like so: if ($rs->Fields("Address") !="") And see if that worked for you? Technically you should not have to trim it unless someone messed with the data as I doubt PHP or Access (well not really access but yea) would add random whitespaces to a column...
-
mysql_query returning boolean instead of mysql ressource
premiso replied to jfdio29's topic in PHP Coding Help
Ok, so what is going on is basically you are passing a bool to those functions and not the resource, if you can post the code where this error occurs (Where you actually call it) that would be helpful, in the meantime this may help you understand: $dbCon = new DBconnexion($db_host, $db_user, $db_pass, $db_name); // note this is just an example so yea. $query = $dbCon->execute("SELECT projets_id, projets_nom, projets_nomStrip, projets_url, projets_pdf, projets_login, projets_password, projets_miSession, projets_finSession, projets_cote FROM projets ORDER BY projets_nomStrip ASC"); $numRows = $dbCon->number($query); $row = $dbCon->row($query); Hopefully that will help you figure out what is wrong, if you still cannot get it working post the code plus 5-10 lines above it where you run the actual query. -
Basically it can show poor coding, meaning that you are not outputting your data at the end of the script, like you should. It is considered bad practice to output data as you go along in the code, it generally should be saved and printed out at the end altogether. To fix it, you can store all output into a string instead of echoing it out then just echo out that string at the end. The output buffering is basically like a massive band-aid over the code.
-
mysql_query returning boolean instead of mysql ressource
premiso replied to jfdio29's topic in PHP Coding Help
Can you provide the query you are using and perhaps what you expected to be returned and what was returned?