-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
But - where is the code? A lot of us are afraid (rightfully so) to click on posters links. Pick out the part of your code that is giving you this message and post it here in the <> tags(above) And be sure to tell us which line matches the error message line number.
-
After seeing ALL of these posts that were impossible to read I felt like giving the OP a 'suggestion' perhaps. OP - if the post is not easily readable by you when you create it, why would you want to post it for US to try and read something like that? We would like to help you out but not if it means we have to struggle to understand it. Make It Easy for us please. Code with basically one instruction per line, text that one doesn't have to scroll through left and right. Code that is in text format and not an image file or something which we cannot copy into our editor and modify to show you what we are suggesting.
-
PHP Form just errors every time - Can't figure out why!
ginerjm replied to Johnnygrr's topic in PHP Coding Help
Besides what Barand has said you need to know that every input tag has to have a name= attribute for it to recognized by your php code. The id attribute is necessary if you want to reference a field with JS code or to set the focus onto it at page load. -
It was. If I did what was asked that is.
-
Here is what I wrote. $a = array(11,22,33); $b = array(44,55,66); $c = array(66,77,88); $d = array(99,100,110); $e = array(111,122,133); foreach($a as $a_val) foreach($b as $b_val) foreach($c as $c_val) foreach($d as $d_val) foreach($e as $e_val) echo "A:$a_val B:$b_val C:$c_val D:$d_val E:$e_val<br>"; exit();
-
Looks like your teacher is introducing you to arrays and loops. This exercise wants you to create arrays of each set of values and then loop thru each array inside of the previous array. 10 minutes later: I was right. It was easy.
-
Sounds like you did not have any error checking turned on... If you could not connect there should definitely (imho) have been some message.
-
And you are not getting any error messages or warnings, which I do hope is enabled?
-
Damn! Missed that silly little dot.
-
Is this block of code wrapped in single quotes? That could be the problem since the php variable reference won't be interpreted if not. Maybe try this? echo "<div class='modal' id='modal'> <div class='modal-header'> <div class='title'>Bio</div> <button data-close-button class='close-button'>×</button> </div> <div class='modal-body'>" . $row['bio'] . "</div> </div> <div id='overlay'></div>"; Note how I began the echo with a double quote and swapped all the other doubles for singles. Now the $row reference will work. Kind of confused as to what that reference to × is supposed to be. Is that supposed to be $times?
-
You really should stop using the @ sign in any php code. No sense in it. If there is an error to be hidden it is better to program to handle it than ignore (hide) it.
-
if (isset($_SERVER['HTTP_ACCEPT_CHARSET']))
-
You specified a filename that apparently doesn't exist. THEN you tried to write to it. Whenever you do something that relies on success you must check on the action to be sure it happened. You are not. The more correct way is: if (!$fp = fopen($filename, 'w')) { echo "Could not open file $filename"; exit(); } Now you will see a message if the file isn't there and exit. You can figure out how to handle it some other way if necessary. The point is that when you want to rely on php doing something 'external' such as looking for a file or an image or executing a query or making a db connection, etc. you MUST check the result. When you look something up in the manual to learn how to use it and you see that there is a result such as a boolean one, you have to write code to check that result before continuing on with your program.
-
By now you have probably fixed this error or should have. As I posted 22 hours ago you need to put quotes around your index values
-
I think that I replicated your code. if(!empty($header_email)) { $icon = esc_attr($header_email_icon); echo "<li> <span> <i class='fa $icon'></i> </span>"; echo esc_html($header_email); echo "</li>"; } if(!empty($header_phone)) { $ph = esc_attr($header_phone_icon); echo "<li> <span> <i class='fa $ph'></i> </span>"; echo esc_html($header_phone) echo "</li>"; } echo "<a href='$header_phone'>$header_phone</a>"; A bit cleaner to read now. That said I don't know what your anchor is supposed to do with that phone number. It should be some destination rather than a simple phone number, no? And how do you have a separate class for each phone or email value? That space you placed after 'fa' implies a separate classname so I am confused. OK - had to correct the code I tried to replicate. You have some huge issues here. You have a list item that I think you want to show in italics but also using a strange class. I don't think the class is being specified correctly and there is nothing inside the (outdated) italics tag to be shown.
-
If you had errors you could have shown us the code and the error and point out the line number. It's hard to help you if we don't know what you wrote.
-
I see no code attempt at adding an image name to your table nor to upload a file (the image) to your site.
-
Basicall what MacGyver is saying is: When you have a variable name such as $arr[item] you need to wrap the (item) in quotes to become $arr['item']. In this case 'item' is an index value for the array named $arr.
-
And now show us line 97 of your code. True code is what you get when you open up your script in an editor and highlight the part you want to show us and you copy it and paste into the forum. Not some image that you create. That way if we wish we can copy it to our own editor and re-work it.
-
I have no idea what this line is supposed to be: (css=#bodyleft{width:30%; height:50px; float:left} mismatched parens and some type of code that is not in any manual I have yet to read.
-
Can you give us the true code (not a picture) that is doing that output to which you wish to add this date value? That would give us something to actually modify for you
-
I gave you a solution? I just thought I was giving you some help to know what we needed from you.