1,376 Posted Topics

Member Avatar for nathenastle

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 …

Member Avatar for cwarn23
0
141
Member Avatar for ranyapalanivel

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.

Member Avatar for cwarn23
0
58
Member Avatar for ahmksssv

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 …

Member Avatar for cwarn23
0
82
Member Avatar for sureronald

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]

Member Avatar for cwarn23
0
136
Member Avatar for mohan7690

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 …

Member Avatar for cwarn23
0
119
Member Avatar for coolmind259

Try this: [CODE]RewriteEngine On RewriteRule ^([^.]+[^/])$ index.php?req=$1[/CODE]

Member Avatar for cwarn23
0
129
Member Avatar for SKANK!!!!!

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']; …

Member Avatar for SKANK!!!!!
0
315
Member Avatar for baudday

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. …

Member Avatar for cwarn23
0
122
Member Avatar for angelic_devil

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 …

Member Avatar for angelic_devil
0
116
Member Avatar for ni30rocks

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]

Member Avatar for BzzBee
0
74
Member Avatar for Wallk

[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 …

Member Avatar for BzzBee
0
399
Member Avatar for zunaidius

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 …

Member Avatar for ShawnCplus
0
120
Member Avatar for realestninja

[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 …

Member Avatar for cwarn23
0
983
Member Avatar for jyotiu

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.

Member Avatar for jyotiu
0
151
Member Avatar for jyotiu

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 - …

Member Avatar for jyotiu
0
138
Member Avatar for ADVAD

Try making this your code: [CODE=php]/*Line 134 */ { echo '<tr>' foreach (explode('|',$theline) AS $val) { echo '<td>'.$val.'</td> '; } echo '</tr>'; } ?> </table>[/CODE]

Member Avatar for ADVAD
0
142
Member Avatar for shahzad429

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.

Member Avatar for shahzad429
0
120
Member Avatar for mostafanageeb

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.

Member Avatar for cwarn23
0
62
Member Avatar for Josh Connerty

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 …

Member Avatar for cwarn23
0
5K
Member Avatar for cloudedvision

[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.

Member Avatar for cwarn23
0
116
Member Avatar for baudday

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.

Member Avatar for baudday
0
1K
Member Avatar for cwarn23

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 …

Member Avatar for Dani
0
243
Member Avatar for genieuk

The only book I would recommend is the [I]PHP5 and Mysql Bible[/I]. A great book that explains most of php in depth.

Member Avatar for BzzBee
0
122
Member Avatar for shefeekj

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.

Member Avatar for BzzBee
0
151
Member Avatar for sandeep_more97

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.'&'; } …

Member Avatar for sandeep_more97
0
304
Member Avatar for gkalyan

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 …

Member Avatar for cwarn23
0
84
Member Avatar for totalnoob

[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 …

Member Avatar for totalnoob
0
95
Member Avatar for coolmind259

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.

Member Avatar for vidaj
0
455
Member Avatar for chakaox

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]

Member Avatar for cwarn23
0
127
Member Avatar for ero100@live.com

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 …

Member Avatar for cwarn23
0
149
Member Avatar for Gedebuk

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 …

Member Avatar for Gedebuk
0
339
Member Avatar for drjay1627

[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 …

Member Avatar for cwarn23
0
73
Member Avatar for ero100@live.com

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) { …

Member Avatar for cwarn23
0
175
Member Avatar for ero100@live.com

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) { …

Member Avatar for almostbob
0
167
Member Avatar for hardcore

[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 …

Member Avatar for hardcore
0
129
Member Avatar for Besherek

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 …

Member Avatar for Besherek
0
118
Member Avatar for marjan_m

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 …

Member Avatar for marjan_m
0
159
Member Avatar for subirs77

[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 …

Member Avatar for cwarn23
0
111
Member Avatar for vanessia_1999

[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 …

Member Avatar for cwarn23
0
87
Member Avatar for szita1

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.

Member Avatar for danishbacker
0
98
Member Avatar for kssi89

[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 = …

Member Avatar for cwarn23
0
177
Member Avatar for prawin@123

[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 …

Member Avatar for danishbacker
0
77
Member Avatar for vidhyaponnusamy

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 …

Member Avatar for cwarn23
0
112
Member Avatar for SheSliq

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']; …

Member Avatar for nav33n
0
139
Member Avatar for sreya.n

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]

Member Avatar for nav33n
0
86
Member Avatar for Merlin33069

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 …

Member Avatar for sassenach
0
143
Member Avatar for jyotiu

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, …

Member Avatar for cwarn23
0
1K
Member Avatar for movieprodw

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)); …

Member Avatar for chrishea
0
135
Member Avatar for jameswoodhouse

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 …

Member Avatar for vidaj
0
205
Member Avatar for bthaxor

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> …

Member Avatar for Airshow
0
157

The End.