1,376 Posted Topics
Re: It appears that you have echo'ed the picture instead of displaying it. And I am guessing that the image is attached to an email so it may be kinda hard to fix since those scripts are usually very large. So if the picture is an attachment then check that the … | |
Re: There is a nice thread at [URL="http://www.daniweb.com/forums/showthread.php?t=185571&highlight=session+expire"]http://www.daniweb.com/forums/showthread.php?t=185571&highlight=session+expire[/URL] and to change the session expiry time (if the session id is not in the url) you can simply use the following code: [CODE=php]<? session_start(); setcookie(session_name(), $_COOKIE[session_name()], time()+600, '/');[/CODE] Hope that helps. | |
Re: Well for starters, the php.ini file configures the functions associated with php and has nothing to do with .htaccess files. So basically, the php.ini file is a default settings file. If however you want to enable .htaccess files then it is the apache httpd.conf file that you need to modify … | |
Re: If you mean weather you can write to a file using php then the following should be able to test that: [CODE=php]<? file_put_contents('test.txt','The server is writable.'); echo file_get_contents('test.txt'); ?>[/CODE] | |
Re: Place this in the .htaccess file that is in the same directory is the homepage: [CODE]RewriteEngine On RewriteRule ^([^.]+)\/(.*)$ $1.php?$2[/CODE] Edit: I discover that the script I posted takes over all real directories so you will need to specify each directory like the following: [CODE]RewriteEngine On RewriteRule ^page\/(.*)$ $1.php?$2 RewriteRule … | |
Re: Try this: [CODE]RewriteEngine On RewriteRule ^([^.]+[^/])$ index.php?req=$1[/CODE] | |
Re: Well your while loop can be replaced with a mysql query. So your script can be replaced with the following: [CODE=php]else { ##User isn't registering, check verify code and change activation code to null, status to activated on success mysql_connect("localhost", sssssss, passs) or die(mysql_error()); mysql_select_db("sssss") or die(mysql_error()); $queryString = $_SERVER['QUERY_STRING']; … | |
Re: If ya want a tutorial all it takes is a google or yahoo search. A good one I found was at [URL="http://www.zimmertech.com/tutorials/php/25/comment-form-script-tutorial.php"]http://www.zimmertech.com/tutorials/php/25/comment-form-script-tutorial.php[/URL] which shows how to make a comments box in a similar way that I would do it although there is a lot of optional code in the tutorial. … | |
Re: I found a nice little script that will do the job but won't delete 2 billion subdirectories due to a permissions denied error. [CODE=php] function delete_directory($dirname) { if (is_dir($dirname)) $dir_handle = opendir($dirname); if (!$dir_handle) return false; while($file = readdir($dir_handle)) { if ($file != "." && $file != "..") { if … | |
Re: Try something like this: [CODE=php]$result=mysql_query('SELECT * FROM `tablename`'); for ($n=1;$row=mysql_fetch_array($result);$n++) { $var='variable'.$n; $$var=$row['columnname']; //replace columnname with real column name } echo $variable1; echo '<br>'; echo $variable2; echo '<br>'; echo $variable3; echo '<br>'; echo $variable4; echo '<br>'; echo $variable5;[/CODE] | |
Re: [QUOTE]Please help me with this... i really do not know php.[/QUOTE] If you are new to php then I would suggest to start with basic php and not oop (Object Orientated Programing) as the concept of oop for a beginner can be hard to get a grip of. Also I … | |
Re: If you mean transferring data from your localhost to your webhost on scheduled times then I would suggest downloading and using crone for your localhost server (not to be mixed with crome or chrome). With crone, you have the ability to schedule command line events which in this case you … | |
Re: [QUOTE]can someone help me make a site to compete with [url]www.google.com?[/url] im on aim halp plz :) [/QUOTE] Well I am doing just that. I have found PHP is not powerful enough so I am using Perl to compete with Google. I have already completed a type of search engine … | |
Re: Depending on how your web host is set up, you may need to change the database server to localhost At least that is what most web hosts would have it set to. | |
Re: It meens that the file located at /forum/forums/libs/functions_forums.inc.php does not exist. If you believe it should exist and that the location is relative to the base of your website then you will need to a - adjust it to the base of something like the server root or b - … | |
Re: Try making this your code: [CODE=php]/*Line 134 */ { echo '<tr>' foreach (explode('|',$theline) AS $val) { echo '<td>'.$val.'</td> '; } echo '</tr>'; } ?> </table>[/CODE] | |
Re: I would suggest using javascript to change the table cells into forms. To do it, you would probably give each cell a row number and column letter for the id= and the edit button (onclick) can trigger the javascript event. | |
Re: If you mean for a user to be able to select multiple items in a combo box then make the name of the combo box [ICODE]name=name[][/ICODE] and use a foreach loop to check the results. | |
Re: Try adding the following field to your html form to prevent uploads larger than 60MB [CODE=html]<input type="hidden" name="MAX_FILE_SIZE" value="60000000" />[/CODE] Other than that, php has no way of validating the upload since php is server side an not client side. So the only real ways to validate an upload is … | |
Re: [QUOTE][CODE=php]$this->error->trigger('noRoute','URL Has No Matching Route',array('URL'=>$url),'404');[/CODE][/QUOTE] Isn't that code meant to be the following: [CODE=php]$this->$error->trigger('noRoute','URL Has No Matching Route',array('URL'=>$url),'404');[/CODE] The code above will only work if $error is a method of $this and trigger() is a method of $error. Also you forgot a dollar sign for the middle variable. | |
Re: Try replacing line 82 in your script with the following: [CODE=php]$image = imagecreate(abs($box[2]-$box[0]),abs($box[5]-$dip));[/CODE] I believe the @ symbol was messing with your code. | |
Hi, for the past couple of weeks I have noticed that daniweb crashes when the traffic exceeds 4200 members online. It usually happens around a Thursday night Australian Eastern Standard Time and is real annoying at times since I need to wait for the next day to post. I know … | |
Re: The only book I would recommend is the [I]PHP5 and Mysql Bible[/I]. A great book that explains most of php in depth. | |
Re: Usually for a page to take that long to load, it is due to one or more loops taking too long to process or even a slow mysql server. So post the script for index.php and I will check what modifications need to be done. | |
Re: If you would like it to post on server side then you could just use curl. So the following is an example script that will display only the paypal page but still submit the post variables to the second link: [CODE=php]$vars=''; foreach ($_POST AS $key => $val) { $vars.=$key.'='.$val.'&'; } … | |
Re: It is possible to do by entering a relative file path. Below is an example of a file system: [CODE]htdocs file.php subdomain index.php[/CODE] Say in the above example index.php was open and index.php was the homepage for the subdomain and ya wanted to include file.php which is in the base … | |
Re: [QUOTE=totalnoob;855554]Hi! I was wondering if there is any way to just include a small part of a file? ... Is this possible?[/QUOTE] Well actually yes it is possible. Just place an if element around what you don't want. Below is an example: [CODE=php]<? //index.php $includes='t'; include('file.php'); ?>[/CODE] [CODE=php]<? //file.php echo … | |
Re: Trying placing the following in your htaccess file and place the htaccess file in the same folder as the homepage: [CODE]RewriteEngine On RewriteRule ^([^.]+[^/])$ $1.php[/CODE] Also note that when linking to directories such as the hompage you may need a forward slash at the end. | |
Re: Try this: [CODE=php]$SQL="SELECT * FROM Guestbook"; $Content=mysql_query($SQL); if (mysql_num_rows($Content)>0) { while($rs= mysql_fetch_array($Content)){ echo "$rs[EntryText]"; } }[/CODE] | |
Re: To solve the first e_notice error, simply assign a value to the $subject variable before sending the mail and as for the second error, as previously mentioned it means that the mail function cannot connect to the wamp mail service. So to solve that first error the code will be … | |
Re: If the 64-bit version works then it probably means that you have a 64-bit operating system. To check weather you have a 32-bit or 64-bit operating system just follow the instructions under the vista section [URL="http://www.mydigitallife.info/2008/03/19/how-to-check-if-windows-vista-xp-and-2003-system-is-32-bit-or-64-bit-x86-or-x64-version/"]in this page[/URL]. If you follow those instructions and it says 64 bit on the … | |
Re: [QUOTE]in other words, if i have a 56k connection can i still watch youtube or for that matter a live stream?[/QUOTE] Of course you could however you need a buffer if the download rate is slower then the display rate. Just from the top of my head, the formula to … | |
Re: Try the following code: [CODE=php]<?php $num_to_guess=42; $num_tries=0; $num_tries = (!isset($_POST["num_tries"])) ? $num_tries + 1 : 0; $message = ""; if (!isset($_POST["guess"])){ $message = "WELCOME TO THE GUESSING MAChINE!"; } else if ($_POST["guess"] >$num_to_guess) { $message = "$_POST[guess] is too big! TRY a smaller number"; }else if ($_POST["guess"] < $num_to_guess) { … | |
Re: Your php code is incorrect and needs quotes inside the array. So the correction is the following: [CODE=php]<html> <head> <title>READING IMPUTS FROM THE FORM </title> </head> <body> <?php echo "<p><b>YOUR NAME IS: </b>".$_POST['user']."</p>"; echo "<p><b>YOUR ADDRESS IS: </b>".$_POST['address']."</p>"; echo "<p><br>YOUR PRODUCT CHOICES ARE:<br></p>"; if(!empty($_POST['products'])){ echo "<ul>"; foreach($_POST['products'] as $value) { … | |
Re: [QUOTE=samarudge;854210]Yer go for eather Wamp or Xampp (But NOT PHP 4, the current version is 5.somthing)[/QUOTE] Also as a note, I have seen that it is possible to install both php4 and php5 on the same webserver. (Two file extensions - [B].[/B]php4 & [B].[/B]php) So if you have a lot … | |
Re: As you've mentioned, it is best to have 1 table as it will save recourses and space. So the table structure will be as follows: [CODE]tblCategory cat_id as primary key cat_name as nvarchar topic_id as nvarchar topic_name as nvarchar[/CODE] Then to retrieve the data and display it as the html … | |
Re: Perhaps ajax. I checked the source code and appears that at least javascript to some degree must have been used since there is no hyperlink but instead an oop reference with javascript. Then and although I haven't dug in deep enough to confirm this but it appears there is some … | |
Re: [QUOTE=Josh Connerty;853824]Sorry I don't quite understand what you are trying to acheive. Is it similar to linkbuks and other sites like that?[/QUOTE] I think subirs77 is talking about making a cms (Content Management System) which is probably the hardest thing to make with php if you want to achieve the … | |
Re: [QUOTE] $query = "DELETE from color WHERE colorid = $colorid";[/QUOTE] That line should be the following: [CODE=php] $query = "DELETE from color WHERE colorid = '".mysql_real_escape_string($colorid)."'";[/CODE] And add the mysql_real_escape_string() to all inputs into mysql like I did in the problem line above otherwise your script like it is now … | |
Re: Try adding this to the top of the your php files: [CODE=php]ini_set('file_uploads', 1); ini_set('upload_max_filesize', '8M');[/CODE] Could be just that uploads are disabled in the php.ini file. | |
Re: [QUOTE=kssi89;852543]Hello, This query works when entered directly into MySQL but when used in a php page it fails and generates the following error: Also, the date values are not accepted in either the php page or mysql terminal, they default to '0000-00-00'. Here is my query: [CODE] mysql_select_db("ecommerce"); $query = … | |
Re: [QUOTE=HITMANOF44th;851210]are you trying to make the table get bigger and smaller with the window it's kinda hard to follow what you are saying? if you clear up what you are trying to do i can help more[/QUOTE] Well I can understand it due to the use of code I'll explain … | |
Re: Well php itself can launch the window since php deals with the server side items while other languages such as javascript and flash deal with the client/user side items. So that makes it impossible for php itself to make a popup but you can make php send to the browser … | |
Re: I agree with nav33n but I suppose newbies to daniweb aren't familiar to the code tag concept. Also in addition, I would secure that mysql query of yours. The corrected and easier to read code is as follows: [CODE=php]<?php include("connect.php"); if (!isset($_POST['Submit'])) { $GpoNumber =$_POST['GpoNumber']; $invoice=$_POST['invoice']; $amount=$_POST['amount']; $receiver=$_POST['receiver']; $dateIn=$_POST['dateIn']; $submitter=$_POST['submitter']; … | |
Re: Also the following will do the same job: [CODE=php]$arr = array(1 => "apple",2 => "orange",3 => "mango"); $var = "apple 1"; if(!in_array( $var, $arr )) { // not found, do something... } else { // found $found = $var; }[/CODE] | |
Re: That code works perfectly for me so perhaps it's the html code on the main page used to include the iframe. The code I used to include the iframe is as follows: [CODE=html]<iframe src='frame.php' width=300 height=30>Iframe Not supported</iframe>[/CODE]Also if you want to know what language to do the proper vision … | |
Re: I received your message and had a crack at the code but it seems there is some sort of anti-bot protection script on the website. The following is the script I used: [CODE=php]<? //array('AF','DZ','AS','AD','AO','AI','AQ','AG','AR','AM','AW','AT','AU','AZ','BS','BH','BD','BB','BY','BE','BZ','BJ','BM','BT','BO','BA','BW','BV','BA','IO','BN','BF','BG','BI','KH','CM','CA','CV','KY','CF','TD','CL','CN','CX','CC','CO','KM','CG','CD','CK','CR','CI','HR','CY','CZ','DK','DJ','DM','DO','EC','EG','SV','GQ','EE','ET','FK','FO','FJ','FI','FR','GF','PF','GA','GM','GE','DE','GH','GI','GR','GL','GD','GP','GU','GT','GN','GW','GY','HT','HM','VA','HN','HK','HU','IS','IN','ID','IQ','IE','IL','IT','JM','JP','JO','KZ','KE','KI','KR','KW','KG','LA','LV','LB','LS','LR','LY','LI','LT','LU','MO','MK','MG','MW','MY','MV','ML','MT','MH','MQ','MR','MU','YT','MX','FM','MD','MC','MN','MS','MA','MZ','MM','NA','NR','NP','NL','AN','NC','NZ','NI','NE','NG','NU','NF','MP','NO','OM','PK','PW','PS','PA','PG','PY','PE','PH','PN','PL','PT','PR','QA','RE','RO','RU','RW','SH','KN','LC','PM','VC','WS','SM','ST','SA','SN','CS','SC','SL','SG','SK','SI','SB','SO','ZA','ES','LK','SR','SJ','SZ','SE','CH','TW','TJ','TZ','TH','TL','TG','TK','TO','TT','TN','TR','TM','TC','TV','UG','UA','AE','GB','US','UM','UY','UZ','VU','VE','VN','VG','VI','WF','YE','ZM','ZW'); $country=array('AF'); for ($id=0;isset($country[$id]);$id++) { $ch = curl_init(); // set the target url curl_setopt($ch, CURLOPT_URL,'http://tools.cisco.com/WWChannels/LOCATR/performBasicSearch.do'); curl_setopt($ch, CURLOPT_HTTPHEADER, … | |
Re: Although I don't know about putting the picture into the database, I have made a function that will resize the picture for you. The script is: [CODE=php]<?php function resize_image($filename,$newwidth,$newheight) { if (!file_exists($filename) || !in_array(preg_replace('/(.*)[.]([^.]+)/is','$2',basename($filename)),array('png','jpg','jpeg','gif','xbm','xpm','wbmp'))) { //note .wbmp is 'wireless bitmap' and not 'windows bitmap'. return false; } else { $ext=preg_replace('/(.*)[.]([^.]+)/is','$2',basename($filename)); … | |
Re: If you are trying to retrieve 1 row of a mysql table via link then it is probably best to just have a unique number/hash column and link to the php page with that row id in it. Then when retrieving the row, you can just use [ICODE]SELECT * FROM … | |
![]() | Re: I would suggest using mysql databases and the following is an example mysql query: [CODE]mysql_query('INSERT INTO `table` SET `title`="'.mysql_real_escape_string(stripslashes($_POST['title'])).'" `date`="'.mysql_real_escape_string(stripslashes($_POST['title'])).'" `body`="'.mysql_real_escape_string(stripslashes($_POST['title'])).'"')[/CODE] Then to place the contents into a page use the following: [CODE=php]$result = mysql_query('INSERT INTO `table` SET `title`="'.mysql_real_escape_string(stripslashes($_POST['title'])).'" `date`="'.mysql_real_escape_string(stripslashes($_POST['title'])).'" `body`="'.mysql_real_escape_string(stripslashes($_POST['title'])).'"') while($row=mysql_fetch_array($result)) { echo '<div class="post"> <div class="post_title"><h2>'.$row['title'].'</h2></div> <div class="post_date">'.$row['date'].'</a></div> … |
The End.