White_Lily
Members-
Posts
531 -
Joined
-
Last visited
-
Days Won
1
Everything posted by White_Lily
-
To clear the sessions when they are no longer needed just use; unset($session variables);
-
Displaying Pages In A Drop Down Menu Via Page Types
White_Lily replied to White_Lily's topic in PHP Coding Help
I didnt write the code for any of this, I'm merely adding to it/fixing errors. The way it was written wasn't really my choice unfortunately. You have confused me with the whole labels thing... sorry -
I am only posting what I have been told from others. and yes i read what you wrote.
-
Im only passing on what I been told by others no need to have a go at me.
-
I'm just saying what I have been told. So far I have you telling me I am supposed to be using E_ALL and a Mod telling me to use -1
-
The -1 will show all possible error, whereas E_ALL will suppress E_DEPRECATED and few others. Using -1 lets a developer correct as much as possible, and helps make sure the code isn't going to suddenly stop working when the server is upgraded to the next version of php. So actually it is more useful to use -1.
-
If he uses the php.ini it means he can sort out as many errors in his whole site as he possibly can rather having to insert code at the top of each page to find the errors. Therefore its actually easier just to restart the web server since it only takes 20 seconds
-
As i found out the other day its better to use "-1" not E_ALL and if he uses php.ini it will show errors across his entire site, not just one page.
-
Whats with all the inserts? O.o Have you also tried using a php.ini file? If not - create one and type into it: display_errors = on error_reporting = -1 Save that file as "php.ini" and run your web page again. (NOTE: you may need to re-start your web server)
-
Maybe see if you spelt the connection settings correctly?
-
Sessions are better since they can be carried across the entire website, where as post can only be carried to the next page.
-
You link a database to php through a php connection script. Ex: <?php //Define connection settings $host = "localhost"; $user = "root"; $pass = ""; $database = "database name"; //Connect $con = mysql_connect($host, $user, $pass) or die("Could not connect."); //Select the database your website gets its content from $db = mysql_select_db($database) or die("Could not select database."); ?>
-
Displaying Pages In A Drop Down Menu Via Page Types
White_Lily replied to White_Lily's topic in PHP Coding Help
<label>Page:</label> <select name="catSel" style="width: 300px;"> <? $getCategories = select("pages", "id, name", "(page_switch = 1) AND (type = 2 OR type = 4 OR type = 5)"); // this line is the fix while ($categories = mysql_fetch_array($getCategories)) { echo "<option value='".$categories['id']."'>".$categories['name']."</option>"; } ?> </select> -
Add Hyperlinks To Data Pulled From Mysql Via Php
White_Lily replied to webguync's topic in HTML Help
<td><a href="-filename-"><?php ehco $record["url_t"]; ?></a></td> -
Displaying Pages In A Drop Down Menu Via Page Types
White_Lily replied to White_Lily's topic in PHP Coding Help
I will post the solution tomorrow when I am back at work. Sorry. -
Displaying Pages In A Drop Down Menu Via Page Types
White_Lily replied to White_Lily's topic in PHP Coding Help
A friend managed to fix it for me. -
@beyzad - re-read his problem. he WANTS each image to have a unique name.
-
Displaying Pages In A Drop Down Menu Via Page Types
White_Lily replied to White_Lily's topic in PHP Coding Help
No it didnt work, and error reporting isnt showing any errors either. php,ini id set to: display_errors = on error_reporting = -1 -
Displaying Pages In A Drop Down Menu Via Page Types
White_Lily replied to White_Lily's topic in PHP Coding Help
Got a point there lol guess i didn't see it like that - will try the || -
Hi, I have a page that allows you to select pages that you want have related pages on. The problem I'm having is that its not displaying anything, not even the types of pages that I want it to display and have specified. <?php $getCategories = select("pages", "id, name", "page_switch = 1"); while ($categories = mysql_fetch_array($getCategories)) { //if(!isset($usedCats[$categories['id']])){ if($categories["type"] == 2 && $categories["type"] == 4 && $categories["type"] == 5){ echo "<option value='".$categories['id']."'>".$categories['name']."</option>"; } //} } ?> I can't seem to figure out why it's not displaying anything Any help would be appreciated.
-
Also, make an id column for each table you mentioned so that you can match the story with the user.
-
All we can see is broken images.
-
You say it just redirects you to login page with no errors... Try commenting out all header() lines, and put error messages in their place instead. Then post back here and tell us what the error is. //error message echo "Error: ".mysql_error();
-
your php.ini file should be this: display_errors = On error_reporting = E_ALL
-
Its just a completely blank page? Check your php.ini settings if this is the case.