- Strength to Increase Rep
- +12
- Strength to Decrease Rep
- -3
- Upvotes Received
- 114
- Posts with Upvotes
- 101
- Upvoting Members
- 56
- Downvotes Received
- 14
- Posts with Downvotes
- 14
- Downvoting Members
- 6
743 Posted Topics
Re: For parsing ini configuration files there is a parse_ini_file() function. http://php.net/manual/en/function.parse-ini-file.php That could simplify the class a bit. | |
Re: [QUOTE=loopylouis;299573]Hi i own an online game and i wish to know weather there is a way to disable my members from changing the URL in the url bar and only allow them to click links. If they change the URL in the url bar i would like it to header/re-direct … | |
Re: [QUOTE=jej1216;396659]I have a website that lists pdf files for downloading, with links to each file. What I want to do now is design a search page that will look in the folder that contains these docs and search for docs that match a partial name. I have created search pages … | |
Re: The problem is that your function does not support sending to multiple email addresses. With SMTP, multiple addresses are sent one after the other, and the client has to wait for a response before writing the next recipient. So in your function change: [CODE]//email to fputs($smtpConnect, "RCPT TO: <$to>" . … | |
Re: [CODE]You're saying it's possible to host this script on another server and still have the added benefits of seo for my domain?[/CODE] A side effect of using JavaScript is that it is that it is invisible to Search Engines. So the reviews would not be indexed by search engines. If … | |
Re: [B]Headers already sent[/B] refers to [B]HTTP Headers[/B]. The server cannot send any more http headers if the HTTP Content has started sending. In PHP code, this means you have ouput something to the page with echo or print etc. PHP will not output any whitespace in between php tags, However, … | |
Re: [QUOTE=solomonski;271126]Sorry i didnt mention that the website sits on a windows platform machine.[/QUOTE] The windows scheduled tasks manager works the same as cron. You can set up the task to run your php script. If you want a purely web based solution take a look at this article in my … | |
Re: [QUOTE=nikesh.yadav;676618]hi all, i m working on the email validation i ve to check email id either it is correct or not but i cannt send mail on them. ie when i validate all email id client send newsletter and they should not bounce. thanx in advance[/QUOTE] You can validate if … | |
Re: The thing that get's me about template engines is that in order to be as expressive as the language they are written in, they can become quite complex and add another learning curve for the designers. The developers have to learn the template syntax as well and know how to … | |
Re: [QUOTE=vssp]Hi friends Is it posssible to create an email account in the cpanel without manualy logging in ? I want to create a php script which logs into the cpanel and create an email account . I hope i would get a solution form u guys Thanks[/QUOTE] Hi vssp; Fortunately … | |
Here is a PHP class written for PHP4 and PHP5 that will validate email addresses by querying the SMTP (Simple Mail Transfer Protocol) server. This is meant to complement validation of the syntax of the email address, which should be used before validating the email via SMTP, which is more … | |
Re: You'll probably get better help with this posting at the xampp forum. [url]http://www.apachefriends.org/f/viewforum.php?f=16[/url] This has little to do with PHP programming so it would be hard to answer your question. It is more to do with the apache server and specifically xampp. | |
Re: You can send SMS for free to most carriers by sending an email to their Email to SMS gateway. A list of carriers is here: [url]http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit[/url] I wrote a class based on this a while ago but never got around to finishing it: If you're interested in finishing it, here … | |
Re: [QUOTE=shishtawitch;1053274]i want to pass a youtube code like [url]http://www.youtube.com/watch?v=NMAYr709-9Y&feature=dir[/url] and it return me the embed code.........!! how can i do that with php and curl........!![/QUOTE] This it the embed code for that particular page: [CODE]<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/NMAYr709-9Y&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/NMAYr709-9Y&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>[/CODE] Notice … | |
Re: [QUOTE=robothy;604081]Hi, Surely the FTP will map your public_html folder, within which will be your PHP scripts. So can you not simply use the unlink function in PHP? Sorry if I am over simplifying the problem. R[/QUOTE] unlink() function in PHP will be run under the Apache user, however, you can … | |
Re: You cannot read files backwards, but you can use fread() and fseek() to read chunks from the end of the file, and see if you have 10 lines in it. This examples keeps reading a chunk from the end, moving towards the beginning of the file, until it finds 10 … | |
Searching the net I couldn't find a simple way of retrieving HTTP Request Headers and HTTP Request Body in a PHP Script. PECL extensions offer this but not a standard PHP install. So heres a simple class that will do it for you. Docs in my blog: [URL]http://fijiwebdesign.com/content/view/90/77/[/URL] | |
Re: The PHP script is not responding when the JSON request is made. ie: $.getJSON() This happens in the client side JS, but your PHP script on the server, will just hang. You'll have to figure out what is hanging. I'm guessing it is the HTTP requests made in the PHP … | |
Re: To retrieve the video/audio stream from the browser you need a browser plugin that has access to the webcam. The most common way to do this right now is with Flash. (I'm guessing you want this to run in the browser). You'll need to write some ActionScript to get the … | |
Re: Heres a search for it on sourceforge. [url]http://sourceforge.net/search/?type_of_search=soft&words=ip+to+country+php[/url] There are a number of IP to country scripts in PHP there.. What to note is that differnet scripts use different IP to Address databases. Some are better than others. If you're interested in writing your own, you can download a database … ![]() | |
Re: [QUOTE]NOTE: This script requires the GD image library to be compiled, and to my knowledge only works on a *nix server. PHP must also be installed using GD support.[/QUOTE] GD works fine on Apache on Windows (PHP4) didn't test PHP5 but it should work. | |
Re: A few ideas: 1) The process created by PHP will be run as the PHP user. Does this user have the required permissions. 2) If you're getting errors, you would need to access stderr. Try "2>&1" at the end to redirect stderr to stdout. 3) Compiling takes time, you might … | |
Re: [QUOTE=Aamit;1080561]Hi, I am trying to read the content of url. when manually i put url in browser link : [url]http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions[/url] it opens. but using code [code=php] $homepage = file_get_contents('http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions'); echo $homepage; [/code] Warning: file_get_contents([url]http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions[/url]) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Unavailable in C:\xampp\htdocs\test.php on line … | |
Re: [QUOTE=MIGSoft]Hey All. Have a question. I have this situation: in JavaScript I have a parent window that opens a child window using window.open(). Now, through the course of the whole thing, comes a point where the child refereshes the parent window using opener.location.reload(). After the reload happens, I have realized … | |
Re: I understand this post is solved with the new host, but there are some security concerns with your code that you should take care of. <?php include 'core/init.php'; protect_page(); not_admin_redirect(); $user_id = $_GET['user_id']; mysql_query("UPDATE `users` SET `banned`= 1 WHERE `user_id` = $user_id"); header('Location: liste.php'); ?> The mysql query has the … | |
Re: [QUOTE=starter;751210]I need help with a dynamic drop down menu. I need when I select a make. the corresponding model load in the second drop down menu [code=php]<?php $conn=odbc_connect("cisproject","" ,"");// database connection $make = $_POST['manuf_name']; if ($make){ ///////////////////////////////////////////////// $query = sprintf("SELECT * FROM Models where manufacture_id='$make'"); $result = @mysql_query($query); $rowModel = … ![]() | |
Re: I would argue that the practice of optimizing essential components of an application does not affect the overall performance of an application. You should be concerned about other areas that do affect performance, such as caching the instances (singleton pattern), lazy loading etc. These do affect performance of a framework. … | |
Re: [QUOTE=dayballer2285;400964]Hello, I am using php to check if a URL is available using th if file exists function. [code] if(file_exists("http://www.domain.jsp")) { $lines = file('http://www.domain.jsp'); }else{ $lines= echo $variable } [/code] But it keeps giving me errors...is there an alternative to if file exists? Thanks[/QUOTE] I don't believe file_exists() works on … | |
Re: So it doesn't matter which language represents the XML document as DOM, it will have the same structure and methods defined by the [URL="http://www.w3.org/DOM/"]DOM Specs[/URL]. Use var_dump() and get_class_methods() to find out what methods are available on an object. For example, on your $album object. It really helps to use … | |
Re: It would be simpler and less error prone to use an actual currency conversion API. Here is a listing: [url]http://www.programmableweb.com/apitag/?q=currency[/url] | |
Re: [QUOTE=scorpionz;980105]Hi this is scorpionz: I need to know how to insert PHP block in database using PHP, because i am generating random tables. So i need that to insert: Here is the query: [code] <?php $sql_insert_revisions = 'INSERT INTO node_revisions(nid,vid,uid,title,body,teaser,TIMESTAMP,FORMAT) VALUES ('.$nid_ins.','.$vid_ins.','.$user_id.','.$ad_title_view.', '"<?php $block = module_invoke('block', 'block', 'VIEW', 66); print … | |
Re: [QUOTE=alpha2006]Hi, I am looking for a PHP script that can take an ip address and return the country where that ip address belongs to. If you know or have been using such a script, please let me know. Thanks[/QUOTE] HI alpha2006, What you need first is to get a database … | |
Re: The PHP Language reference has details on what a function and class is: [url]http://www.php.net/manual/en/langref.php[/url] It also explains most the other features of PHP. If want to learn PHP that is the best place to start. [B]Functions[/B] The function is a grouping of statements (lines of code). For example the following … | |
Re: To ensure an image is reloaded, send a unique URL. eg: <img src="image.php?random-number123" /> Where random_number123 can be generated by: [CODE=php]<?php $random = microtime(true); // eg echo '<img src="image.php?'.$random.'" />'; ?>[/CODE] | |
Re: [QUOTE=gargg321;698509]Thanks Shanti but would you be a bit elaborate about how could I log in to a remote server. I had visited php.net earlier but the first and foremost problem for me is to log into the remote system. Suppose the username is "abcde", password is "wxyz" and IP address … | |
Re: [QUOTE=aniltc;366631]hi all I am new to php and curl.How can we create cookies using curl.What is the advantage of creating cookies this way,instead of creating from php's normal way (Setcookie()); Thanks to all[/QUOTE] Hi, CURL is used by your PHP server to make a Request to another Web Server. Here … | |
Re: I have the same problems with encoding in a different content - XML files. For your prob.. Does excel support utf-8 fully? Question I'm asking myself, how does excel determine encoding? When saving to the database, is the database data stored as UTF-8? PHP functions are also non-utf8 aware. For … | |
Re: Is IE going through a Proxy? [B]Proxy-Connection: Keep-Alive[/B] There is also the: [B]Connection: Close[/B] response from the server. Thats odd for HTTP 1.1 . If there is a proxy, it may be changing the HTTP Request outside what your fiddler picks up. Try testing without a proxy to single it … | |
Re: [QUOTE=R0bb0b;631723]Actually, I think you usually get this answer: [URL="http://en.wikipedia.org/wiki/Scripting_language"]http://en.wikipedia.org/wiki/Scripting_language[/URL] Meaning that a script supports a program and a program runs independently. With this definition, Javascript would be a scripting language because it requires the browser to run, most server side languages including interpreted languages would be programming languages, given that … | |
Re: [QUOTE=JSR;326704]Hi Guys, new to this forum, kinda new to PHP in general haven't been using it long, mostly creating forms for database and custom CMS modules. Anyway, i'm building a html email tool from the ground up and just need some help with one thing. How do i convert values … | |
Re: The simple answer to your question. On every page you want to protect, you need to check if the user is logged in. How to check if the user is logged in depends on your implementation. Heres is a simple login scenario: 1) Login page with {user} and {pass} 2) … | |
Re: Do a var_dump() on your array to be sure of it's structure. You can also do this within your loop. Then it is just making sure you write the correct notation to reference the index you need. ![]() | |
Re: Do you have more memory you that you can increase your PHP memory limit to? Edit PHP.ini. | |
Re: A good place to start is [url]http://php.net/oop[/url] | |
Re: generally, its better to user string functions, like substr and strpos rather then regular expressions (whenever you can) as the regular expression will take longer to evaluate. The following function ([url]http://us3.php.net/preg_match[/url]) will do the trick: [PHP]function ExtractString($str, $start, $end) { $str_low = strtolower($str); $pos_start = strpos($str_low, $start); $pos_end = strpos($str_low, … | |
Re: When using: [CODE] <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">[/CODE] It is best to escape the PHP_SELF variable. [CODE] <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">[/CODE] Older versions of PHP will include the URL parameters with PHP_SELF which allows an XSS injection if it isn't escaped. It is good rule to always … | |
Re: Sorry for resurrecting an old thread. But it was referenced recently and I thought I'd add to it. crc32b should not be used with passwords as it is an [B]insecure[/B] hash function. [url]http://en.wikipedia.org/wiki/Cyclic_redundancy_check[/url] It also generates hashes that are only 8 hexadecimal (base 16) digits long. Thus you have less … | |
Re: Please highlight your code when posting. What type of error are you getting at the moment? Have you set the correct username, password, skin etc. for your Cpanel in the script? Is the sript on the same domain as that you want to create subdomains for? | |
Re: [QUOTE=bondito]Hi, i am a computer science final year student, i was thinking of creating an online voting/polling system,the system could include surveys as well. I really need some ideas in designing the system and any idea you send to me will be highly appreciated.[/QUOTE] The best way to tackle this … | |
Re: I use WAMP which is easy to install... [url]http://www.wampserver.com/en/[/url] |
The End.