743 Posted Topics
Re: These are the PHP session files in serialized (encoded) form. Note that is it not encrypted, it is just encoded. The strings represent objects in PHP, and PHP knows how to turn it back into actual Objects. The value of this file is available for the specific user through the … | |
Re: [QUOTE=foxwizzy;1035447]Can i use one of this to update my password in the mysql db?[/QUOTE] Please post your question in a new thread instead of resurrection a thread that is years old. Here is the documentation to the syntax of a mysql update query: [url]http://dev.mysql.com/doc/refman/5.0/en/update.html[/url] Here is the documentation for mysql_query: … | |
Re: Is there an error you're getting? I don't see any particular problem in the code. Normally, you'd want to have a database do this job for you. It is much simpler than having to read/write from files. For example, with a DB it is as simple as: [CODE]$result = $Db->Query("DELETE … | |
Re: Hi mahe4us, When you pipe to the php script, you must make sure that the php script does not send any output. It looks like your php script is has the output: [B]PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version … | |
Re: [QUOTE] <?php if(!$sql){ echo 'There has been an Error for Submitting your request. Please Contact the Web Master.'; }else{ echo "Hello <u><b>".$name."</b></u>"; echo '<br/><hr>Thank you'; echo '<br/><br/>Your Request is under process. Our Representative will get in touch with you.'; sleep(5); echo '<script><!-- window.location= "http://www.widecomindia.com/home.html" //--></script>'; // header("Location: http://www.widecomindia.com/home.html"); }[/QUOTE] You … | |
Re: [QUOTE=phpuser;637432]I made one php project in which we provide facility to create his/her own web site. Now I wants to add new feature giving different subdomains to the members' web pages. Because the number of members is about 120,000, manual configuring is not the solution. Let me give you an … | |
Re: Just a note. A disadvantage of using .inc is that it will be visible to visitors if accessed directly. Using .php will hide the source code since the server will always parse the PHP before serving. | |
Re: It would be a lot simpler to get the sums one by one and add it in PHP. | |
Re: Yes, that could be the issue. When passing strings from PHP to the shell, make sure to escape them with escapeshellarg(). see: [url]http://php.net/manual/en/function.escapeshellarg.php[/url] btw, the reason the $ is causing a problem is because the shell sees it as the token that begins a variable. When using escapeshellarg() the meta … | |
Re: [QUOTE=iketunde;172141]I have a php page with two hyperlinks. I one to send email to certain addresses and the other to also send emails to another address and also delete their records from the database. I don't want a case where the user accidentally clicks on the link takes the wrong … | |
Re: [QUOTE=steven01]sorry,I don't familiar with it.Can you give me some codes or how to do in dreamweaver?[/QUOTE] HI steven01 RSS is a way of syndicating site content. The RSS file is an xml file with the RSS specification. That means its written to follow rules layed out for all RSS files. … | |
Re: Hi, Where is the part where [B]google_ad_request_done(google_ads);[/B] is called? | |
A very simple MySQL database class. [B]Usage:[/B] [CODE]// connect $config = array( 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database); $DB = Database_MySQL::getInstance($config); // set query $DB->query("select * from table1 where col1 = %d and col2 = '%s' LIMIT 1", 5, 'a'); // get rows $rows … | |
Re: I would prefer PDO over Mysqli since it is not tied to a single database product (MySQL). With PDO, you can have the choice of database product to use, and thus if you wanted to change the databse product you use from MySQL to SQLite, it is simpler. ie: PDO … | |
Re: Sessions by default PHP settings will store to files. As already mentioned, it is per user only. [B]If you don't have root access:[/B] You can however store the chat messages in memory only. Probably the simplest way to do this is to store your database table in memory. Mysql has … | |
Re: Hi Wallace, What to note is that PHP includes files relative to the current file being executed. ie: [URL="http://en.wikipedia.org/wiki/Working_directory"]current working directory[/URL]. So the path does not depend on which file you are calling another file from, but from the file being executed by PHP (the first file PHP started executing). … | |
Re: The @ suppresses error messages. For different database extensions see: [url]http://www.php.net/manual/en/refs.database.php[/url] PDO is a really good abstraction of the database layer that you can build on: [url]http://www.php.net/manual/en/book.pdo.php[/url] | |
Re: Are you sure you installed PHP correctly? It would be hard to find a distribution of PHP that does not have MySQL enabled by default. Try creating a PHP file with a simple call to mysql_connect() in it. See if you get the same problem. How did you install PHP … | |
Re: A simple way to read files in a directory is to use the glob() function. Example: [CODE] $files = glob('/path/to/directory/*'); [/CODE] You can use filemtime() to get the modification time of the file, so the latest file would be what you are after. You can use is_file() and is_dir() to … | |
![]() | Re: [CODE]$creation_salt = sha1($username.':'.time());[/CODE] This salt is way to easy to guess. Considering time() is a number of seconds, there are only 60*60 in an hour, and 60*60*24 in an hour: [ICODE]86400[/ICODE] possible salts in one your. |
Re: [QUOTE=jianwu_chen;506812]thanks for the reply. But maybe you mis-understand my issue. Here my problem is not the javascript code itself. But the java script can't assess the data inside <![[CDATA .... ]][/QUOTE] Test it with XHTML and see if you get anything. | |
Re: If you're getting the error: Cannot modify header information - headers already sent by Add ob_start() to the beginning of the script. | |
Re: Instead of using preg_replace() use str_replace(). It a lot faster. If you need regular expression functionality, then you'd have to use preg_replace. | |
Re: You can use SET in a MySQL insert statement: [url]http://dev.mysql.com/doc/refman/5.1/en/insert.html[/url] The best way to see what that error is, is to check for errors when you execute a query. Eg: [CODE]$result5=mysql_query($query5); if (!$result5) { echo mysql_error(); }[/CODE] Calling mysql_query() should automatically trigger an error. But if you have error output … | |
Re: [QUOTE=tleisher;402819]Hi, I have two websites. I have an RSS feed from one that I want to host on the other, just the headlines and links back to the second website... Right now I'm using SimpleXML and fopen/fclose to bring in the XML documents. But for some reason it's not working... … | |
Re: [QUOTE=ivatanako;1240529]Hi, Here's another option, try using cron jobs. [CODE]find /yourdir/tmp -mtime +1-exec rm {}[/CODE] 1 is the xx days. Regards, Al[/QUOTE] Don't you need to close the statement after -exec ? [CODE]find /yourdir/tmp -mtime +1-exec rm {} \;[/CODE] | |
Re: Yes, you can use Wordpress. Are you familiar with it? If not, I'd suggest installing a few CMSs and seeing which you find suitable. Some good PHP ones are Drupal, Joomla, Symphony CMS etc. (It is better to spend time to test a few, rather then make the mistake that … | |
Re: If you're working with a developer you don't trust much, it would probably be better if you have a development server that both can play with, and you only have access to the production server. Or even better you can install version control software on your server and only offer … | |
Re: What is the structure of: $row_Totals_i Please do a dump of it to see it's structure and post it here. eg: [CODE]var_dump($row_Totals_i);[/CODE] With the limited info given, it is hard to get what is wrong. ![]() | |
Re: mysql_query() only supports one query at a time. note: you can grant permissions to users via SQL querys on Cpanel hosts, you just need to be doing so under a user with the grant option and also the privileges you are granting. [url]http://dev.mysql.com/doc/refman/4.1/en/grant.html[/url] ![]() | |
Re: [QUOTE=ShawnCplus;564746]Without rival the most useful javascript debugger/general web development tool is [url=http://getfirebug.com]FireBug[/url] in combination with [url=http://chrispederick.com/work/web-developer/]Web Developer Toolbar[/url]. Firebug has a very powerful debugger complete with conditional breakpoints and source tracing. Web Developer Toolbar has a veritable cornucopia of handy tools for web developers.[/QUOTE] Firebug wins hands down! | |
Re: What are you using to pass the XML? Which PHP library? | |
Re: It is not a good idea to actually have the auto_increment column value in your insert. For very low frequency inserts it will work, but if there are every two inserts close to each other you have the chance they will try and insert the same value for the auto_increment … | |
Re: Do a [CODE]var_dump($json); [/CODE] to see the structure. | |
Re: You can validate email addresses before actually sending emails. First you can validate the syntax. That is check if the email address is of valid format. Then you can try validation via SMTP: [url]http://code.google.com/p/php-smtp-email-validation/[/url] As for validation within emails, to see if they were opened, you can embed images that … | |
Re: Just do a dump of the variable to see if you got it correctly. [CODE]$file = JRequest::getVar( 'img2', null, 'files', 'array' ); var_dump($file); die;[/CODE] | |
Re: You can use file_get_contents(). Just add the user and password to the url in the form: [url]http://user:[email protected]/path/to/file.xml[/url] Or you can specify the http header to send in the stream context parameter. eg: [CODE]$context = stream_context_create(array( 'http' => array( 'method' => 'GET', 'header' => sprintf("Authorization: Basic %s\r\n", base64_encode($username.':'.$password)), 'timeout' => 5, … | |
Re: What programming language are you using on the server side? I think you'll have more help in the appropriate forum for that language. | |
Re: The form will be submitted to where the action parameter specifies. eg: [CODE]<form method="post" action="parser.php">[/CODE] will be submitted to parser.php You can redirect to a different page using a HTTP redirect from that page after processing a form. Eg: [CODE]header("Location: /index.php");[/CODE] will take you back to /index.php. | |
![]() | Re: You'll need the filesystem functions: [url]http://php.net/manual/en/ref.filesystem.php[/url] or with PHP5 you can use OO equivalent functionality: [url]http://php.net/manual/en/class.directoryiterator.php[/url] |
![]() | Re: The two main things here is: 1) Saving the form field values added by the user 2) Returning to the form without the "resend post" message [B]Saving the form field values added by the user[/B] The only way to save the values effectively is to save them server side (or … |
Re: After the mysql_query() do some error checking. It will let you know what went wrong with the query. Example: [CODE]if (!$result) { trigger_error("MySQL error: ".mysql_error(), E_USER_ERROR); }[/CODE] I believe the problem is that DATE is a function so you need to escape it in the SQL query. | |
Re: Please post problems you're having, instead of the whole task. I'm sure no-one will want to do the work you're getting paid for, for free. :) | |
Re: [QUOTE=toradh77;1239093]Hi all in daniweb, I attempted some form validation but I seem to have made a complete mess of it. Before I introduced the validation and regular expressions it was working fine but because I'm not really sure of this topic I made some syntax errors. I would really appreciate … | |
Re: [QUOTE=ajithraj;516098]haii friends.... [COLOR="Red"]i want to select a particular string from textarea...i need it in javascript.... am using the tag <layout:textarea> i did not need the whole ,but only a part...plzz help me...[/COLOR][/QUOTE] What markup language are you using? In HTML a text area is just <textarea>. You'll need a reference … | |
Re: Hi, How are you using the PHP files in Joomla? Joomla requires your php files to be structured into components, or modules, or plugins... Are you asking how to use the php files with Joomla, or just php in general? :) | |
Re: [QUOTE=gptArun;988612]Hello everybody, I have to edit joomla left panel contents but didn't find code. how would do this? i chk administrator part where i cant change/add links. But not found code other than "<jdoc:include type="modules" name="left" style="rounded" />" in index file. somebody help me out !![/QUOTE] Do you want to … | |
Re: You cannot place statements as parameters. You need to create your HTML in a string, and then do the replacement with that string as the parameter. eg: [CODE]session_start(); if(!session_is_registered(username)) { $html = 'href="http://www.mywebsite.com/Login.php" title="Login">Login</a>'; } else { $html = 'href="http://www.mywebsite.com/logout.php" title="Logout">Logout</a>'; } $template = str_replace ("{_SIDE_URL1_}", $html, $template);[/CODE] Here you … | |
Re: You can definitely send SMS for free, but reliability isn't a feature. Here is a list of Email to SMS gateways. [url]http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit[/url] I've used it in the past, to send SMS and works most the time. You just need to construct the email address for each phone number based on … | |
Re: It doesn't matter if you use pear or mail(), an email server configured to deny senders that do not have accounts on the mailserver will not send email with different sender addresses. If your mail server sends email with sender addresses with accounts not on the server, then you essentially … |
The End.