wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
You cannot go to that page directly. You need to go to edituser.php?id=some_user_id_here make any changes and then click the submit button. _POST data is only sent when the form is submitted.
-
Remove these lines $ud_first = $_POST['ud_first'] $ud_last = $_POST['ud_last'] $ud_login = $_POST['ud_login'] $ud_passwd = $_POST['ud_passwd'] $ud_rank = $_POST['ud_rank'] $ud_email = $_POST['ud_email'] $ud_phone = $_POST['ud_phone'] $ud_invoice = $_POST['ud_invoice'] Your redefining those variables again a couple of lines down.
-
You're not retrieving your _POST data properly. For example you cannot use the variable $ud_first to get the value of the form field named ud_first. You have to use the $_POST superglobal variable to get values from your form fields eg: $ud_first = $_POST['ud_first'] You should also be sanitising/validate your user input to protect your self from SQL Injection attacks. At minimum you should use mysql_real_escape_string $ud_first = mysql_real_escape_string($_POST['ud_first']);
-
The change MadTechie suggested should work. How do you know the changes are not being saved?
-
That error usually means your query has failed due to an error. This line $result=mysql_query($query); Should read $result=mysql_query($query) or trigger_error('Query error! Query: <pre>'.$query.'</pre>Reason: ' . mysql_error()); What is the error message?
-
I see you're using short tags (<? ?> and <?= ?>). These types of tags normally disabled by default on some configurations. You should always use full PHP syntax, eg <?php ?> or <?php echo ?> (instead of <?= ?>). Are you getting a completely blank page? If you are then it most probably means there is an error in your code. Add these two lines before $id=$_GET['id']; ini_set('display_errors', 'on'); error_reporting(E_ALL); Are any errors displayed?
-
Short tags are disabled by default. I do not recommend you to use short tags (<? ?> or <?= ?>). You should use the full length tags (<?php ?>). However to enable short tags enable a setting called short_open_tag within the php.ini In order for mysql to work you need to enable the mysql extension within the php.ini too.
-
Have you configured Apache yet? You need to tell Apache how to handle .php files. Just compiling/installing PHP isn't enough. You need to add something like the following to the httpd.conf LoadModule php5_module /path/to/libphp5.so AddType application/x-httpd-php .php You will need to restart Apache after making any changes to the httpd.conf
-
PHP DEPRECATED code ... oh my god - help please
wildteen88 replied to zeroge's topic in PHP Coding Help
I guessing you are using PHP version 5.3.x (you can confirm this by running phpversion or phpinfo. If you are then POSIX Regex functions are no longer supported. You should instead use the PCRE functions. There have been many changes in PHP5.3, as mentioned in the manual. You should familiarise your self with these changes to ensure your scripts work correctly under PHP5.3. -
What datatype is the ordPhone column set to in your database? What do you mean by Could you post some example data. Post any errors you are getting too.
-
Your code is wrong it should be just var div_not_loading = document.getElementById("main"); div_not_loading.innerHTML += '<div id="load_box"><div id="loading" align="center">Loading...</div></div>';
-
You should be able to do div_not_loading.innerHTML += '<div id="load_box"><div id="loading" align="center">Loading...</div></div>'; rather than div_not_loading.innerHTML = '<div id="load_box"><div id="loading" align="center">Loading...</div></div>' + div_not_loading;
-
Change this: list($id, $categoryid, $jobTitle, $jobName,$post_date,$location,$contact_info,$description)=explode('__',$job); ?> <tr bgcolor="#ffffff" border=1px height="30px"> to list($id, $categoryid, $jobTitle, $jobName,$post_date,$location,$contact_info,$description)=explode('__',$job); // ALTERNATE BACKGROUND COLOR $bgcolor = ($i % 2) ? '#COLOR1' : '#COLOR2'; ?> <tr bgcolor="<?php echo $bgcolor; ?>" border=1px height="30px"> Replace #COLOR1 and #COLOR2 to the colors you wish to alternate between.
-
For auto margins to work correctly make sure you are using a valid DOCTYPE and you have set the width for the .image class selector, eg .image { width: 50px; height: 50px; }
-
How did you install/setup Apache? It is best to install Apache from ubuntu's repos eg: sudo apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils This will setup/configure Apache2.2.x for you.
-
i think you can solve this ..plz give a try....
wildteen88 replied to ultimateweblogos.com's topic in PHP Coding Help
If you want someone to do it for you post in the freelance forum. Have you made any effort to apply the changes you wish to make? -
Woops! This line while($row = mysql_num_rows($result)) should be while($row = mysql_fetch_assoc($result))
-
You can query more than one table at a time within a single query using joins. Trying to stitch together results from separate queries is not recommended. The following is your three queries combined into one $ordPhone = mysql_real_escape_string($_POST['ordPhone']); $query = "SELECT O.ordPhone, O.ordSessionID, C.cartSessionID, C.cartID, Co.coCartID FROM orders O LEFT JOIN cart C ON C.cartSessionID = O.ordSessionID LEFT JOIN cartoptions Co ON Co.coCartID = C.cartID WHERE O.ordPhone = $ordPhone GROUP BY O.ordPhone"; $result = mysql_query($query); if($result && mysql_num_rows($result) > 0) { while($row = mysql_num_rows($result)) { printf("<pre>%s</pre><hr />", print_r($row, true)); } } else { if(!$result) prinft("Error with query: <pre>%s</pre>Reason: <pre>%s</pre>", $query, mysql_error()); else echo "No results!"; }
-
If you dont want to use GET, you could use use cookies or sessions to store the search criteria
-
How do I get the results from a MySQL-queery into a form?
wildteen88 replied to beginann's topic in PHP Coding Help
You'll need to add your form where I have highlighted -
Change this if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); to $upload_path = dirname(__FILE__) . '/upload/'; if (file_exists($upload_path . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], $upload_path . $_FILES["file"]["name"]);
-
Remove array() from this line $moderators = array(moderators()); The moderators() function already returns an array.
-
Looking at your code you can just delete this line $query .= " LIMIT $s,$limit;"; It is not needed at all. Or just change it to $query .= " LIMIT 1";
-
"Normal" screen resolution - wide monitor - what is best??
wildteen88 replied to scanreg's topic in Miscellaneous
For the best resolution your should use your monitors native resolution. Check your monitors manual for this. What is the make/model of your monitor? -
"IF" control not working as expected...
wildteen88 replied to lopes_andre's topic in PHP Coding Help
This line is not right if ($type <> ('detalhe' || 'zona') ) { You cannot compare multiple values at once. The above should be written as if ($type != 'detalhe' || $type != 'zona' ) { What are you trying to achieve with the function?