wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Mini File host Image upload problem
wildteen88 replied to zysac's topic in PHP Installation and Configuration
PHP4 is no longer supported. You should be using PHP5. YellowTip seems to be outdate/old. Personally I'd setup the AMP stack manually using the latests builds. -
Preview PHP page, page script is returned
wildteen88 replied to nlandgraf's topic in PHP Coding Help
You wont be able to do that if your website is populated by whats in your database. You have to setup a database locally to be able achieve what you're doing. -
If you dont know, how are we supposed to know. Can you explain what you're trying to do, tell use what the script is supposed to do, what it doing now and post any errors you get here in full
-
Preview PHP page, page script is returned
wildteen88 replied to nlandgraf's topic in PHP Coding Help
PHP is unnable to connect to your websites database server.Your host may not allow external connections to mysql. You're be better of performing a database dump on your host and transfering your database locally. -
Preview PHP page, page script is returned
wildteen88 replied to nlandgraf's topic in PHP Coding Help
You will need to edit your php.ini file and enable short tags. Open you php.ini and find the following line short_open_tag = off and set it to on, like so short_open_tag = on Save php.ini Now restart Apache. Your code should now be parsed. -
Preview PHP page, page script is returned
wildteen88 replied to nlandgraf's topic in PHP Coding Help
Are you using short tags in your code (<? ?> or <?= ?>) By default short tags are not enabled. You need to enable short tags for your code to work properly. Also you need to be saving all your sites files in Apaches htdocs folder (C/path/to/apache/htdocs). You must also be going to http://localhost to run your php scripts. -
If your variable can only contain certain values then setup an array of possible values. $accepted_values = array('value1', 'value2', 'value3', etc); // now see if $_GET['value'] contains a value that is accepted if(in_array($_GET['value'], $accepted_values)) { // $_GET['value'] holds an accepted value } You can ofcourse go the other way and setup an array of non accepted values
-
Preview PHP page, page script is returned
wildteen88 replied to nlandgraf's topic in PHP Coding Help
Can explain your problem more clearly. Also I am assuming you have setup Apache with PHP? Apache on its own wont be enough to run your scripts. -
You'd want setup a counter, eg $i = 0; while ($list = mysqli_fetch_assoc($result)) { // work out bg color $bg_color = ($i%2 == 0) ? 'color 1' : 'color 2'; // display row echo '<tr style="background-color: '.$bg_color.'">'; // display columns here echo '</tr>'; // increment counter $i++; }
-
Use $imagename = $subject . '.jpg';
-
Why don't you develope/test your code off line. You can install PHP locally saves alot of time. Look into using wampserver or xampp
-
Well that line assigns the variable $imagename to the uploaded file name. So if your uploaded file is somefile.txt then $imagename will be set as somefile.txt If you want the uploaded file to be named the value of the $subject variable you'd use $imagename = $subject;
-
Mini File host Image upload problem
wildteen88 replied to zysac's topic in PHP Installation and Configuration
Whats yellowtip? -
Maybe its fetch_row() What database class are you using
-
PHP will not parse variables from files that are being read either.
-
How to retrive image from mysql and dispaly it on ie.
wildteen88 replied to sundeep's topic in PHP Coding Help
Well the basic query would be SELECT image_field_name FROM image_database_name You'd use mysql_query to run your query. Next you'll want to use mysql_fetch_array retrieve the results. You'll wan to use a while loop to loop through your results. Within your while loop you'll use something like echo '<img src="'.$row['image_field_name'].'">'; to dispaly your images -
Is the variable $me coming from the value of a form field? It if its PHP wont parse variables within forms. It will treat them as normal text. To parse these variables you'll have to use eval. However this can be very dangerous. Can you explain more clearly what you're trying to do.
-
To submit the form to itself you dont set the action attribute in the form tag. As my example shows.
-
Your best bet is to submit the form to itself rather than to another script. This way you can do something like this <?php function set_field_value($form) { return isset($_POST[$form]) ? $_POST[$form] : ''; } function show_field_error($form) { global $error; return isset($error[$form]) ? '<span style="color:red"><b>'.$error[$form].'</b></span><br />' : ''; } if(isset($_POST['submit'])) { if(isset($_POST['name']) && empty($_POST['name'])) { $error['name'] = 'Please fill in your name'; } if(isset($_POST['age']) && !is_numeric($_POST['age'])) { $error['age'] = 'Please fill in your age'; } } ?> <form action="" method="post"> <?php echo show_field_error('name'); ?> Name <input type="text" name="name" value="<?php echo set_field_value('name'); ?>" /><br /> <?php echo show_field_error('age'); ?> Age <input type="text" name="age" value="<?php echo set_field_value('age'); ?>" /><br /> <input type="submit" name="submit" value="Submit" /> </form>
-
[SOLVED] setting pc to work like a server.. problems..
wildteen88 replied to jasonc's topic in PHP Coding Help
In what way? As in you're getting errors. A blank screen. What? You need to be more descriptive about your problem. -
Mini File host Image upload problem
wildteen88 replied to zysac's topic in PHP Installation and Configuration
Make sure you have enabled the GD extension for PHP. Open you php.ini file look for ;extension=php_gd2.dll Remove the semi-colon ( from the start of the line. Save the php.ini and restart your HTTP server (eg Apache, IIS etc). NOTE: Make sure you have setup the extension_dir directive to point to PHP's extension folder. For example if PHP is installed in C:/php then extension_dir needs to be set like extension_dir = "C:/php/ext" -
[SOLVED] setting pc to work like a server.. problems..
wildteen88 replied to jasonc's topic in PHP Coding Help
In what file are you saving your php code? All PHP code must be saved in files ending in .php, example filename.php. All files must be saved in WAMP's www folder (eg C:/wamp/www) To run your php scripts you must be going http://localhost Also there is no need to restart your PC when changing PHP settings. Your only need to restart the WAMP services. -
You'll want to check if your query returns any rows before your while loop. Something like if ($db->num_rows() != 0) { echo "<ul>"; while ($row2 = $result2->fetch()) { echo '<li><a href="' . $root .'?page='. $row2['page_ref'] . '">' . $row2['title'] . '</a></li>'; } echo "</ul>"; } $db->num_rows() may not be correct. As I don't know your database class I cannot suggest the proper function to use. Your class should have a function that returns the number of results from a query, eg mysql_num_rows
-
Is that line 432 in state_entry2.php?