
DaveyK
Members-
Posts
289 -
Joined
-
Last visited
-
Days Won
1
Everything posted by DaveyK
-
We already posted two working solution, what's wrong?
-
Parse error: syntax error, unexpected T_STRING
DaveyK replied to james909's topic in PHP Coding Help
I just posted this code on localhost and I dont get any errors... $error_font_color = "red"; $title_image ="<img src= \"http://www.britishpolarengines.co.uk/assets/images/logo.jpg\" border=\"0\" lt=\".: BPE Demo :.\" title=\".: BPE Demo :.\" hspace=\"5\" vspace=\"2\">"; var_dump($error_font_color); var_dump($title_image); the result I get is: string(3) "red" string(150) "" are you sure about the error? care to post all the relevant code? -
You state that "you cant get it to update the new field no matter how hard you try". Surely can find the code you have tried so hard on?
-
Parse error: syntax error, unexpected T_STRING
DaveyK replied to james909's topic in PHP Coding Help
Its actually not unlikely the source of the error is not on that line, but the previous one. Post more relevant code please, in code brackets (the "<>" in the menu). -
As I said, I am not and Im just judging from what I see. And what I see is a URL change, that URL being a "pretty url" and everything just works. I wouldnt know how, but to the users its the same as an .htaccess solution. But as I mentioned, it still requires .htaccess on page load, but thats. But yeah, you need to have JS enabled otherwise backbone.js wont work, obviously. But who doesnt have JS enabled these days? REGARDLESS, thats how .htaccess would be set up.
-
I just realized that would be a little stupid, I think this would be better: strings | string_id | string_name ----------------------------------------- | 1 | "user_name" | 2 | "email_address" languages | lang_id | language_name | language_code ----------------------------------------- | 1 | "English" | "en_US" | 2 | "Dutch" | "nl_NL" translations | trans_id | string_id | lang_id | string ----------------------------------------- | 1 | 1 | 1 | "User name" // English (lang_id 1) | 2 | 1 | 2 | "Gebruikersnaam" // Dutch (lang_id 2) | 3 | 2 | 1 | "Email address" // English (lang_id 1) What do you guys think? EDIT(S): I should check my posts better >.< errors everywhere!
-
I would be very interested in hearing what is "best practice" for this. However, I think you would introduce string names, like 'user_name', which you COULD store as: | id | string_name | lang_id | string ----------------------------------------- | 1 | user_name | 1 | User name // english (lang_id 1) | 2 | user_name | 2 | Gebruikersnaam // dutch (lang_id 2) Its just a suggestion, I've never actually built it. If anyone knows a better method, I would be glad to hear it. EDIT: Markup
-
I am not a JS developer, but I know one who does this with backbone.js without .htaccess (only the first page load uses .htacess). Just accept that it is somehow possible.
-
Client side validation is markup (great for validating charsets and such), server side validation is real deal. However, the signup issue you describe only occurs on ajax calls and not when you try to do it via the traditional method? One method that always work is just making the user name unique in the database table, its not that pretty though (you'd run an UPDATE IGNORE and check how many rows were actually affected to see if the add worked).
-
Im just saying its possible in JS, and its not necessarily hard at all. To explain: <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On </IfModule> RewriteCond %{REQUEST_FILENAME} !-f // if the URL exists as a file RewriteCond %{REQUEST_FILENAME} !-d // or if the ULR exists as a directory RewriteRule ^(.*)$ index.php?q=$1 [QSA,L] // reroute to index.php?q= The url like sitename.com/some-url will be sitename.com/index.php?q=some-url As you can see, its pretty basic. EDIT: Typo
-
You need to work with either JS scripts, but its easily done by using a .htaccess file. This video may help, its a vanity url tutorial by alex from phpacademy.
-
Where to start to make a very basic page maker/editor?
DaveyK replied to MrTIMarshall's topic in PHP Coding Help
As trq said, you should focus on little pieces. What you describe is still a process. If you leave out the live part for now and just focus on the upload, that would be a good start. Because what is the actual difference? If you have the upload working and you are capable of displaying the images on page load, you can do the same for any ajax call when the time is fit (because its the same script, just called asynchronously). "How can I, with the aid of any other programming language, allow the user to upload an image file"? -
Basic scale then crop Barand, correct me if I'm wrong but cutting off the sides if required is cropping right? EDIT: autocorrect...
-
I dont know, honestly. Well, its your own choice. Maybe you want to install mysqli then? I dont know how that works
- 18 replies
-
- configuration
- php
-
(and 2 more)
Tagged with:
-
That would be JavaScript.
-
Neither do I buddy, I am very sorry but I cant help you with that...
- 13 replies
-
- mediawiki
- account creation
-
(and 1 more)
Tagged with:
-
I dont know what you plan on doing, but I think (but do not know for sure) you can just use mysqli() without having to install anything. for starters: var_dump(function_exists ('mysqli_connect')); // dont use this function for real, its just a check if you have th mysqli library If this returns true, you can start using: $sqli = new mysqli (LOCATION, USER, PASSWORD); // same credentials as used in mysql_connect()
- 18 replies
-
- configuration
- php
-
(and 2 more)
Tagged with:
-
I imagine you have some sort of login file? You could post the relevant code here.
- 13 replies
-
- mediawiki
- account creation
-
(and 1 more)
Tagged with:
-
The only thing I can say is: if( approved_account = '0' ) { needs a dollar sign at the variable and two equal signs for comparing. so if( $approved_account == '0' ) { ONE equal sign is for SETTING a variable TWO equal signs are for comparing THREE are also for comparing, but more strict than 2. Other than that, I have no experience with the PHP class you are using to handle SQL queries so I really couldnt tell.
- 13 replies
-
- mediawiki
- account creation
-
(and 1 more)
Tagged with:
-
You have to do anything to configure it, if your version of PHP is up to date its built in. The difference is that MySQL is deprecated as per PHP 5.5.0. That means php has dropped support for mysql and move on to mysqli or PDO_mysql(). The queries are the same (more or less), the PHP around it is a little different. However, as I said, PHP will not support mysql in the future and IF you can make a choice between what to use, Id suggest to go with the future proof option. Personally, the project Ive been working on was too far into mysql before I found out I shouldnt be using it. So I still use mysql, but I will convert too.
- 18 replies
-
- configuration
- php
-
(and 2 more)
Tagged with:
-
Where to start to make a very basic page maker/editor?
DaveyK replied to MrTIMarshall's topic in PHP Coding Help
When you upload an image with PHP, its automatically stored to a temp location. You can access that location (I think), and it will remain there untill either moved or deleted. I dont know how often that folder gets emptied. -
the logic you describe works out and is used a lot. What is the difficulty you are facing then?
- 13 replies
-
- mediawiki
- account creation
-
(and 1 more)
Tagged with:
-
Where to start to make a very basic page maker/editor?
DaveyK replied to MrTIMarshall's topic in PHP Coding Help
Well, if you wish to write and then store something, you have various options to store those strings. An option is to store those strings in a database table, obviously. Having it live means you will need Ajax (which is JS with PHP). Another option is storing as (encrypted?) files, though I never did that before.