Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Use exit() or die() after every error. For instance: if(strlen($username < 4)) { echo "Error 5215: Username contains less than 4 characters. "; exit; }
  2. The "cdn1.image.website.webcdn.com" is NOT a web root directory, it's a domain name of the web server. Try, $thumbnail = $_SERVER['DOCUMENT_ROOT'].$arr[1] . '/' . $arr[2] . '/' . $url_id . '/original/8.jpg';
  3. Hey L2c, take a look for a minute at next example, which I created for you. The web structure is: So, all URLs provided for users look like: /cgi-bin/USA/California/San_Diego /cgi-bin/USA/Massachusetts/Boston /cgi-bin/CANADA/Ontario/Mississauga There is no an URL, like - /cgi-bin/display.php?country=USA&state=California&city=San_Diego If some user clicks on the link, for instance, http://domainName.ca/cgi-bin/USA/California/San_Diego, he will reach the file - /cgi-bin/display.php?country=USA&state=California&city=San_Diego without seeing this ugly URL. You can make your own test to analyse, what's going on behind the hood. Test - http://canada.lesno.net/cgi-bin/display.php 1. display.php <?php if (!isset($_GET['country'])) { echo '<a href="./USA/California/San_Diego">Link 1</a><br />'; echo '<a href="./USA/Massachusetts/Boston">Link 2</a><br />'; echo '<a href="./CANADA/Ontario/Mississauga">Link 3</a>'; } else { echo '<pre>' . print_r($_GET, true) . '</pre>'; } 2. .htaccess RewriteEngine on RewriteBase /cgi-bin/ RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z_]+)$ display.php?country=$1&state=$2&city=$3 [L] Hope that wil help someone! PS: You would create your own RegEX to satisfy your personal whishes.
  4. Absolutely. Are you sure that your hosting provider doesn't allow to use mod_rewrite? jazz.
  5. Hey @Love2c0de, take a look at this good article, especially the part contains "mod-rewrite with Regular Expressions". http://www.sitepoint.com/apache-mod_rewrite-examples/ jazz.
  6. Bash in PHP make me start to sweat nervously Run that script onto your web server and tell me what result you get. <?php $str = 'La Souris Déglinguée - 1988 - Quartier Libre.zip'; $enc = "openssl enc -base64 <<< '$str'"; $exc = shell_exec($enc); $dec = "openssl enc -base64 -d <<< '$exc'"; echo shell_exec($dec);
  7. Ah, I see. I will try to give you an example later
  8. Hey ungovernable, just use openssl instead utf8_encode to encode and after to decode the string of the file. So, here is a simple test that I made it for you: #!/bin/bash openssl enc -base64 <<< 'La Souris Déglinguée - 1988 - Quartier Libre.zip' Result: TGEgU291cmlzIETDqWdsaW5ndcOpZSAtIDE5ODggLSBRdWFydGllciBMaWJyZS56aXAK # decode the string openssl enc -base64 -d <<< 'TGEgU291cmlzIETDqWdsaW5ndcOpZSAtIDE5ODggLSBRdWFydGllciBMaWJyZS56 aXAK' Result: La Souris Déglinguée - 1988 - Quartier Libre.zip So, do you know how to run a bash command(s) inside the php script?
  9. Good morning The word should start with a capital letter or it doesn't matter? If you want to start with the same word, you would use that one: RewriteEngine On RewriteCond %{REQUEST_URI} ^/Gardenable/$ RewriteCond %{QUERY_STRING} ^page=([a-z]+)$ RewriteRule ^(.*)$ http://localhost/Gardenable/%1 [R,L]
  10. Or just get all lines from the pointer. <?php $handle = fopen("data.txt", "r"); if ($handle) { while (($lines = fgets($handle, 4096)) !== false) { echo "<hr><b><font color=brown>Summary For ID : $lines</font></b><hr>"; } if (!feof($handle)) { echo "Error: unexpected fgets() fail\n"; } fclose($handle); } Source - http://php.net/manual/en/function.fgets.php
  11. Also, don't repeat the $password variable twice in your if statement.
  12. Well, what is the file's name of that script? Do you know that the action of your html form goes to the file, called - "del_updprod.php"? If that file's name is different nothing from here will be executed.
  13. Of course NOT, your nickName is Stalingrad So, seriously, you should really avoid runing queries in loop(s), unless you want to easy to start hammering the database. Use a SQL join clause which combines records from two or more tables in a database. Redesign your script and come back again and we help you out on this.
  14. Also, make sure that the table "loginstatus" exists in the selected database "$db"
  15. Could you echo the $query before to send the statement to DB? $query = "Select * FROM $table WHERE username = '$user' AND id = $id "; echo $query; exit;
  16. Who says that the ip address should be only ipv4?
  17. Wrong css: #my_div:{ background:url(images/send_msg2.png) 0 0 no-repeat; }
  18. Good for you, that's the easiest way, much more elegant and flexiable So, about PDFs, I could suggest you to provide a link for download styling with a pdf web logo. Something like that - http://www.adobe.com/misc/linking.html#pdficon
  19. You defined the query_wrapper() function without any arguments but when you call it you inserted two. Can you explain that? $r=query_wrapper("SELECT * FROM tblmembers WHERE mem_email = ?",$mem_email);
  20. Most of the shared hosting providers limit their maximum execution time of the scripts and set a rule of their SMTP relays about 1000 mails per day. So,if you have a lot of users you have to consider using the sleep php function and the cron job together avoiding flood the mail server.
  21. Well, there are lots of good articles (books) on the web which group of languages are suggested to be learning as first and why!? Anyways....it's only my point of view and personally I will never suggest someone to start learning the basic concepts of programing with php unless his scope of desires are - build a website easy and fast.
  22. Is there an echo inside includes/scotch_gard.php? PS: It's a bad practice by the way!
  23. Hey buddy, I gave you everything that you want to do. Just replace my paths to the directories (sub-directories) with yours - that's all.
  24. Irrelevant. That does not change the fact that PHP sux as a first language and doesn't provide basic concepts of programming. Why don't you ask someone who's jumping from PHP to another language how easy is it?
  25. I think I should be more specific. Personally, I love it. I think it's a great language and it can be used on any system and the web isn't going anywhere. It's a great tool where many tasks we would be accomplished so easy, but in my opinion PHP is not a good language to start programming. When somebody starts to learn PHP first, usualy he/she isn't learning how to solve problems as a usual programmer using the basic fundamentals and thinking in algorrithmic way. He's learning how to set up Apache, HTML, CSS, SQL and so оn, so on.... and after an year he completely lost what PHP is and what PHP does. I see members here and not only after 4, 5 years with PHP, still having lack of the programming conventions, concepts and the basic ideas of programming. That's a ridiculous gift! And some day m-r "X" decided to jump into some based good structured framework like Symfony, ZF for instance and he got in trouble, b/s all concepts of programming had been lost some time in the start. So, I'm newbi in PHP also. My previous languages were Pascal and Bash. I would suggest the first one to be C or Python. They are really good examples teaching us of good programming discipline that PHP obviously would not.
×
×
  • 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.