
computermax2328
Members-
Posts
281 -
Joined
-
Last visited
Everything posted by computermax2328
-
Right, but what I am saying is that the session['uid'] is not data that is stored in a database. It is just a piece of information that the server remembers in order to trace a user around the website. When they log in or they make a log in account do you give them a unique id? That would be something the query. You can't query something that is not stored in the database.
-
That thing is a tank! Good price too. Looking for something a little slimmer.
-
Well to start off, idk if you just forgot to paste them in but in file1.php home/1.php and home/2.php dont have semicolons at the end. It should be... <?php $home['1']='home/1.php'; $home['2']='home/2.php'; ?> Second, not really sure why you have a / between "home" and 1. Just name the file home1.php. Also, just name your variables $home1 and $home2. Correct me someone if I am wrong, but I am pretty sure the 1 and 2 are only used after a variable to identify them in a common array. Correction: multidimensional array, not common array
-
Unless the session id is stored in the database the query is looking for something that is not in the database.
-
There could be a number of problems or there might not be. We can't tell without seeing your raw code. If you post your code in this forum we can see if there are any errors. Are their any errors? I would start by saving your files as .php files and not .html files. So contact_us.html would become contact_us.php
-
Ok strip the htmlentities() function and n12br() function from your mysql_real_escape_string(). Not sure why you are doing that. I am also looking to the use of session['uid'] in your where statement. I think that might be the problem.
-
Hey, I am taking a look at these right now and the first thing I noticed is that your HTML form never closes and you have to give your form a action. Right now your form action is set to "" which means it is not taking any action. In this case it seems you are doing a single page submission so you action would be "edit_profile.php" Close your form and set the action and let me know what happens
-
show php mysql record According to date
computermax2328 replied to neerajmasih's topic in PHP Coding Help
The current date and time or do you have date and time saved into a database somewhere? -
I do like their os but I have a thing against their corporation and their products. Again this isn't about Mac vs PC. We can go all day on that but not here. Not now
-
Hello All, There comes a time in everyone man's life when he has to let go of his childhood laptop.... Anyway, I have had the same computer for 8 years, maxed out the RAM at 2GBs, added an new 320 GB hard drive, added a new CD drive and even went as far as switching out the CPU. The only thing I haven't done is replaced the motherboard. Obviously, I am not going to waste my time on that. Seeing as I am graduating college in a few weeks, I thought I would turn to my fellow PHP community to ask for some suggestions. Here are the two sides of the spectrum: Side one: HP Spectre 14t-3200 Ultrabook Sleek, slim and lite SDD Reviews say the graphics card isn't the best Side two: Alienware 14X Dedicated graphics card Powerhouse of a laptop Love the look and feel of the body Too Heavy Those are the two opposite sides of the spectrum. Any suggestions in between are good. There are a couple of things I am looking for. Intel i7 quad core processor Minimum 6gb of ram dedicated graphics card (Not built into the CPU) full HD 1600x900 Preferred no disk tray, slide in preferred. If it doesnt have one that is fine. Decent battery On my laptop I do pretty much everything. I do a little bit of gaming here and there. Obviously, I code and do other web development stuff. I work with the adobe design suite here and there. Also some small video editing. A lot of multitasking stuff. Please don't mention the Mac Book Pro or the Mac Book Air. I have my reasons for not wanting one and I will leave it at that. Any suggestions will help. Thanks!
-
Yeah it is pretty simple... <table> <?php //query //loop { echo "<tr>"; echo "<td>" . $lista['language']; echo "<td>" . $lista['article']; echo "</tr>"; } ?> </table> This is just an example of the structure. I use to use while(): and endwhile: like you use foreach, but if I were you I would learn how to echo HTML elements like I showed above. It just keeps it more organized and it is a better practice. Helps keep control of all of the symbols and such (;?>) Of course you can add ids and classes to the HTML elements inside of the PHP. Just use single quotes '' instead of double quotes "" inside of a HTML echo so... echo "<td class='data'>" . $lista['language'] . "</td>"; //don't do the following echo "<td class="data">" . $lista['language'] . "</td>";
-
I think I see the problem or part of the problem. It is telling you that the first parameter of your mysqli_query argument is incorrect, so the $dbc is not working. Look at this... DEFINE ('DB_USER', '*******); DEFINE ('DB_PASSWORD', '******'); DEFINE ('DB_HOST','*****'); DEFINE ('DB_NAME','******'); Your DEFINE DB_USER is missing a ' at the end of the ********. See if that works!
-
And the answer to your question is no. Because if you send them the web page their computer will be looking for the file in a file path that does not exist on their computer.
-
Are you running WAMP or anything on your localhost?
-
Take the "C:" out of the hyperlink and see what happens. It looks like your computer is adding the "%" in your localhost to add spaces. Also your link should be.. echo "<a href='php/website/files/$inf'>Link</a>"; If that doesnt work you need to add concatenations to your link before and after the $inf.
-
Need Help Reloading Previously Selected Checkboxes
computermax2328 replied to jostclan's topic in PHP Coding Help
Hey, First off, welcome to the forum! The first thing I am going to do is post your code below in my post so that everyone can read it better. On your next post you can do that by using the <> toggle in the text editor..... <?php do { ; ?> <br /> <label> <input type="checkbox" name="admin_groups[]" value="<?php echo $row_groups['pkID']; ?>" id="admin_groups_<?php echo $row_groups['pkID']; ?>" tabindex="<?php echo $iTabIndexCounter;?>" /> <?php echo $row_groups['group_description']; ?> </label> <?php } while ($row_groups = mysql_fetch_assoc($groups)); ?> There easier to read. As for your problem, you are going to want to write an if statement for the data you wish to receive from your query. Seeing as you are using the checkbox input and not radio buttons you are going to have to put the word "checked" somewhere inside of your <input>. See this link. So what I would do is assign your "value" from the <input> to a variable. $x=$row_groups['pkID'] Then after it write and if statement to see if it exists. Then if it does has a new variable called $checked="checked"; and echo that inside of the input. If $checked exists it will show up in your input. If you need help with that let me know -
I agree with CLUELESS plus if you are going to be using HTML elements in your PHP use the right ones. For your table you have the start a <table> outside of your while loop. Then if you want to have one piece of data per row you need to add <tr> tags in your loop. Replace the <br> tags with them. echo "<table>"; //query while ($SomethingWorks) { echo "<tr>"; echo "$row['whatever']"; echo "<tr>"; } echo "</table>";
-
how can i delete value in database through html form?
computermax2328 replied to devimohan1988's topic in PHP Coding Help
Do you have your HTML form? There are like 10 different ways you can do this. Post your HTML form and I can help you with it. -
Setting/Selecting value from drop-down in PHP - Please help!
computermax2328 replied to navneesh's topic in PHP Coding Help
Hey, Welcome to the club! I am surprised no one picked this one up yet. I haven't been able to look at your code yet, but to start I am going to put this in the forum in code tags so everyone can read it easier. There is a toggle on the text editor that looks like <>. That will put code tags around your code some it will make it look like this.... $output[] = '<tr><td>Order Name</td><td>Shipping Status</td> <td>Billing Y/N</td><td>Billing Date</td><td>Delivered Date</td><td>Order ID * hidden</td><td>Note</td></tr>'; while($row = oci_fetch_array($s,OCI_BOTH)) { $output[] = '<tr><td><input type="text" name="txtOrderNm['.$j.']" class="widthed" value="'.$row["ORDER_NM"].'" readonly/></td>'; $output[] = '<td><select class="widthed" name="txtShippingStatusIDsup['.$j.']" style="width:138px;">'; if($row["REQUIRED_DT"]!=''){ $query1 = "select SHIPPING_STATUS_ID, SHIPPING_STATUS_NAME FROM SHIPPING_STATUS where SHIPPING_STATUS_ID =25"; } else{ $query1 = "select SHIPPING_STATUS_ID, SHIPPING_STATUS_NAME FROM SHIPPING_STATUS where SHIPPING_STATUS_ID =24"; } // currently only one value is coming in "SHIPPING_STATUS_ID" from the above query. $s1 = oci_parse($conn, $query1); oci_execute ($s1,OCI_DEFAULT); while($row1 = oci_fetch_array($s1,OCI_BOTH)) { $output[] = '<option value = "'; $output[] = $row1['SHIPPING_STATUS_ID']; $output[] = '" '; $output[] = '>'; $output[] = $row1['SHIPPING_STATUS_NAME']; $output[] ='</option>'; } $output[] = '</select></td>'; $output[] = '<td><input type="text" name="txtBillingYn['.$j.']" class="widthed" value="'.$row["BILLING_STATUS_YN"].'" readonly style="width:85px;"/></td>'; $output[] = '<td><input type="text" name="txtBillingDt['.$j.']" class="widthed" value="'.$row["BILLING_DT"].'" readonly style="width:100px;"/>'; $output[] = '</td>'; if($row["REQUIRED_DT"]!=''){ $output[] = '<td><input type="text" name="txtDeliveredDt['.$j.']" class="widthed" value="'.$row["REQUIRED_DT"].'" style="width:194px;" />'; $output[] = '<a href="#" onClick="setYears(1947, 2030); showCalender(this, \'txtDeliveredDt['.$j.']\');"><img src="./images/calender.png"></a>'; $output[] = '</td>'; $output[] = '<input type="hidden" name="txtShippingStatusID['.$j.']" value="24">'; } else{ $output[] = '<td><input type="text" name="txtDeliveredDt['.$j.']" class="widthed" value="'.$today.'" style="width:194px;" />'; $output[] = '<a href="#" onClick="setYears(1947, 2030); showCalender(this, \'txtDeliveredDt['.$j.']\');"><img src="./images/calender.png"></a>'; $output[] = '</td>'; $output[] = '<input type="hidden" name="txtShippingStatusID['.$j.']" value="25">'; } //comment //below // this value "txtShippingStatusID['.$j.']" is sent to another page. Since in this case, there is only one possible value for it, thus its hardcoded to '25'. But after I made my change, the value which gets stored in "txtShippingStatusID['.$j.']" should be of that row's ID which is selected in the dropdown. The modified query (original is above) is below: // select SHIPPING_STATUS_ID, SHIPPING_STATUS_NAME FROM SHIPPING_STATUS where SHIPPING_STATUS_ID in (23,24,25,26); //thus, the above code is to be changed such that "txtShippingStatusID['.$j.']" should store in it the value selected in drop-down. //comment //above $output[] = '<td><input type="text" name="txtOrderID['.$j.'] " class="widthed" value="'.$row["ORDER_ID"].'" readonly style="width:150px;"/>'; $output[] = '</td>'; $output[] = '<td><input type="text" name="txtnote['.$j.'] " class="widthed" value="'.$row["note"].'" />'; $output[] = '</td>'; echo "<hr>"; } break; I am going to take a look at this now and get back to you in a little bit... Is there more code to this?? It seems there are a few variables at the top that don't have any values. -
Adding Numbers To Each Result - Can't figure it out!
computermax2328 replied to sandbox's topic in PHP Coding Help
Hey, Welcome to the club! You joined a great community! If you want to make this really easy, instead of using a foreach loop, just echo and ordered list <ol></ol>. So something like this...... echo "<ol>"; echo "<li>" . $res['username'] . ""; echo $res['gold'] . "<br/><br/>" . </li>; echo "</ol>" I am not really sure how you want to arrange your content, but that would be the start. -
Well what kind of file is it? avi, mpg, mov? How big is the file as well? You are failing your very first if statement that asks for the file type and file size.
-
Well Hello, What are you getting out of it? Are you getting any errors or any of your echo messages? That would help to figure out what is happening.
-
Hello All, It is almost that time of the year again. We are looking for people to join our fantasy baseball league, so I thought I would reach out to people in this community. I am the league manager and the rest of the league is composed of friends and family. It is a free league and we would expect that you had a understanding of American Baseball, its teams and players. Let me know if you are interested! Spring training is almost over!
-
Can't insert form data into database
computermax2328 replied to achilles1971's topic in PHP Coding Help
At the top where it says: <?php if (isset($_POST['submitted']) == 1) { if ($_GET['id'] == '') { $q = "INSERT INTO blog (title, date, body) VALUES ('$_POST[title]', '$_POST[date]', '$_POST[body]'"; }else { $q = "UPDATE blog SET title = '$_POST[title]', date = '$_POST[date]', body = '$_POST[body]' WHERE id = '$_POST[id]'"; } $r = mysqli_query($dbc, $q); } ?> I would try !$_GET['id'] in your first if statement. Turn on error reporting while you are still in the developing stage as well.