262 Posted Topics
Re: Please show your code. I do not understand how you expect people to assist in "connecting the two" if you do not show the code to start with | |
Re: This has been done time and time again. Have you tried using the search function in the forum? There are plenty of examples ![]() | |
Re: Store the data in a database, and use $_GET[] to identify the URL page. Connect to database and select and echo the `$pageTitle` | |
Hi all, I seem to have an issue with my CSS. The page setup that has the issue is: <footer> <section 1></section 1> <section 2></section 2> <section 3></section 3> </footer> The sections are set to 33% width and floating left. The containing footer does not seem to expand in height: … | |
Re: @yy886, This is part of an upload script i put together and using well: $mime = array('image/gif', 'image/jpeg', 'image/jpg', 'image/png'); if (in_array($_FILES['file']['type'], $mime) == FALSE) { echo "You are attempting to upload a \"{$_FILES['file']['type']}\" file type. <br/> This is not permitted.<br/>"; } else { `$mime` is an array that holds … | |
Re: have you tried running it? i think magic quotes is now removed from PHP ( think i read it somewhere): just checked : http://php.net/manual/en/security.magicquotes.php removed since 5.4. | |
Re: When uploading files you also need to declare a "enctype". Also please show the full error, and the lines of code it will refer to | |
Re: Your question makes no sense. Where did the code come from? Was it written by yourself | |
I have a very simple class for date display: class timing { public $today; public $year; function __construct() { date_default_timezone_set('GMT'); } function now() { return $this->today = date("D j M Y"); } function year() { return $this->year = date("Y"); } } I am pulling in using: $x = new timing(); … | |
Re: Storing images in DB is something that has been regularly discussed on DaniWeb. Personally i would not store the actual image in the DB, only the location and file name. This is a faster way to pull the images in. | |
Hi All, I am using pritaeas found here: http://www.daniweb.com/web-development/php/code/430455/configurable-table-class I am pulling in the data and my brain has taken a vacation. I am using $arr = $dsn->getRecord('memeber', array('user_id' => 2)); But cannot for the life of me pull the data out. I get duplication as well from the data: … | |
Re: you have a missing " from your img tag echo ('<td><img src="photos/image'.$i.' "/></td>'); | |
Evening all. I am goign through my Image upload script and found it looks messy, would you recommend an cleaner way of doing this: move_uploaded_file($_FILES['file']['tmp_name'], 'photos/' . $_FILES['file']['name']); try { $fileName = $_FILES['file']['name']; $resizeObj = new resize('photos/' . $fileName); // *** Resize options: exact, portrait, landscape, auto, crop $resizeObj->resizeImage(225, 150, … | |
Re: I use percentage as this allows for more flexibility and fluidness for cross browser/platform. For text i use `èm` | |
Re: reformed smoker. Used to smoke 20~30, unless i was drinking and it nearly doubled :( | |
Re: I have to agree. Are you asking a question? If you are unsure on how to ask a well formed question, please refer to the link in my sig. Thank you for your understanding. | |
Hi All, I am creating an "About Us" portfolio page for a company. On this page will be a small bio and a photo. The bio is not a problem, uploading and storing/calling the image is not a problem, as i already have code i can reuse. The part i … | |
Re: This may help: http://stackoverflow.com/questions/14071791/how-to-remove-duplicate-rows-from-a-csv-file | |
Re: Also what do you have the "content" field set as? for example : VARCHAR, CHAR, DATE etc | |
Afternoon all. I have noticed recently that i am unable to log in to DaniWeb from Android Mobile. When selecting the "Member Login" the pop out box appears then disappears before i can do anything. Could this be looked at? Or has DaniWeb got a mobile app? | |
Re: Maybe you do not have short hand PHP tag enabled. Above line 42: <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> Change to : <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post"> Although, if you are new and starting fresh code, i would suggest you drop the MYSQL syntax usage and opt for either PDO with MySQL, or … | |
Re: This is one i found for generating 1 time/use URLS: http://phpmaster.com/generating-one-time-use-urls/ *All kudos to PHP Master on this one* | |
Re: `session_start()` needs to be the first thing. Shift your PHP above the HTML doctype | |
Re: It maybe over kill but i use salt and SHA1 I use this to create a random 50 character string: private function randomString($length = 50) // Produces random string of $lenght { $rdString = ""; $possible = '12346789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; // Available characters for string $mxlength = strlen($possible); if ($length > $mxlength) … | |
I googled and googled to try and find a comprehensive wiki/tut on how to share htdocs across a dual platform. My base install is Windows 7 64bit, and recently (6wks ago) set up a dual boot. One thing pained me for a while of not being able to use the … | |
Re: @kakalahori You need to install the PHPUnit module. This can be easily done via PEAR http://pear.php.net/manual/en/installation.getting.php Or via GIT https://github.com/sebastianbergmann/phpunit/ I used PEAR in my set up as it also allows access to the pre compiled libraries. | |
Hi All, Not sure really where this should go but..... I have recently setup a shared HTDOCS under XAMPP across a dual boot system (Win7 & Ubuntu). Not sure if there is an interest, but if anyone would like to know how to do it, please give me a shout … | |
Re: Whats in your config.php As Diafol has mentioned the error is in there | |
Re: Where are you getting `$Geneprocess` from? | |
Re: This is just the SQL code for the table. You need to add an additional column for example `bday DATE NOT NULL,` Change bday to what you want it to be called | |
Re: Post in the correct forum? This is PHP | |
Re: ZF2 is no longer using zf.bat. If you look over the base tutorial it takes you through how to install: cd /my-project/dir git clone git://github.com/zendframework/ZendSkeletonApplication.git cd ZendSkeletonApplication php composer.phar self-update php composer.phar install This obviously assumes you have composer, and git installed. Here is a sample tut: http://bigemployee.com/zend-framework-2-simple-web-application-crud-using-ajax-tutorial/ that the … | |
Re: Please format your code block correctly using the `code` or `inline code` | |
Re: From what i understood OOP is not com[patible with MySQL. You will need to use MySQLi or PDO wrapper. Your increment is in the wrong place, this should be after doing X and looping, for example: $i=1; while($i<=5){ echo "The number is " . $i . "<br>"; $i++; #<-- increment … | |
Evening all I am working my way through Zend Framework 1.x, and seem to have an issue. I am trying to set the `doctype()` to HTML5: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function __initDoctype() { $this->bootstrap('view'); $view = $this->getResources('view'); $view->doctype('HTML5'); } } I have check the documentation and using `doctype('HTML5')` … ![]() | |
Re: I agree. People are not going to review 1000 lines. Post the code you pinned as the problem | |
Re: +1 to pritaeas. A simple google search will bring up some introduction tutorials which are nice to follow. You will need: a development environment locally (XAMPP/EasyPHP) an IDE (NetBeans, Dreamweaver, even NotePad++), many chocies for these, so try a few, and see which one you are more comfortable with. ![]() | |
Re: Have a look here: `http://php.net/manual/en/function.mysql-fetch-assoc.php` $image seem's to be very popular variable, the below is not tested session_start(); include("connect.php"); $user = $_SESSION['username']; if($user) { $user_id = $_SESSION['user_id']; //get user_id who ever is loged in $sql = "SELECT * FROM image WHERE user_id = $user_id ORDER BY image_id DESC"; } echo … | |
Re: try adding under line 8: $sql->free(); Because you are not flushing the content or use unset($sql); | |
Re: no one is going to go through 290+ lines of code for you. Narrow it down | |
Re: DO NOT USE THE MYSQL extension. Although a lot of tuts will still use this, it has been superceeded by MySQLi. You could also opt for, and one i use, PDO. MySQLi basic connection: $mysqli = new mysqli("localhost", "your_user", "your_password", "your_database"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: … | |
Re: Evening tuyendoan. In your .htaccess file you will need something like : RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php This will remove the `.php` from the URL on the first level. You would need to test further for the deeper nested ones Although i would suggest … | |
Re: > Hi, i'm creating a image gallery, using .htaccess. And this is my first time i work with .htaccess > Simple, you cannot use .htaccess for this. You cannot execute code in that manner. | |
Re: > this code snippet is written with dirty values? why write code for semeone and allow dirty values in one of the most vulnerable of php functions? > sanitize the post values or suffer the consequences. > > this code snippet is written with dirty values? why write code for … | |
Re: This is not actually a PHP question, but............ if you install the speed test extension for Chrome or Firefox, this will indicate where you can improve page speed. |
The End.