Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
The same structure I described still applies. You are deleting the bottom most type of data in a structure of Parent Child Level 1 Child Level 2 You should normalize the data. In the code you just posted, nowhere do you SET $id before attempting to use it. So that's what's causing your problem.
-
Okay, here's what I would try. Anywhere you see a "header("Location: register00.php");" you need to comment that out, and kill the script then with die(); Do something like die('Error: '.$error_message); I think you're getting to the redirect because of validation, and need to see where in the process it's falling apart.
-
You need to have several tables. One for boards, one for threads, and one for posts. Your posts table will have foreign keys to thread_id and board_id. This is called normalizing data. I suggest googling that term and reading about how relational databases work, and changing your DB structure accordingly. Your links should not have username and password in them, this is very unsecure. You need to manage login by session/cookies. Lastly, to determine why $id isn't set we'd probably need to see more code. I suggest addressing the above issues first.
-
Then why are you deleting a board in your query? Also, where clauses are joined with AND, not by commas.
-
Add a die(); after your echo. (You don't need to put quotes around a variable to echo it, btw.)
-
I think there may be a terminology issue. A forum is made up of many parts. Boards which are for specific topics, Threads (or topics), which will have a subject post and replies, and posts which will have a single post by a user. Are you trying to delete an entire board, a whole thread, or a single post within a thread? On the errors, you won't get errors because you're not displaying them. your attempt to delete should read $result = mysql_query("DELETE * FROM `boards` WHERE `boardname`='$board', `id`='$id'") or die(mysql_error()); Above post is correct, and you'd get an informative error about it if you check for errors
-
It will return as rows. Did you *try* it at all?
-
Ah. The way I would do it is to join the videos to both categories and subcategories ordered BY category and subcategory, so you have an array of all the videos with what groups they belong in. Create a variable for cat = '' and subcat = ''. Then loop through that array of videos. If the current video is in a different cat/subcat than the value in the variables, echo the HTML for the cat's name. Otherwise echo the video name. Always end by storing the current cat/subcat in that var. <?php $cat = ''; $subcat = ''; $sql = "SELECT ... " // Do your join here based on category and subcat relationship $res=mysql_query($q); while($row=mysql_fetch_array($res)) { if($res['cat'] != $cat){ //It's the start of a new category } if($res['subcat'] != $subcat){ //It's the start of a new sub-category } echo $res['video']; $cat = $res['cat']; $subcat = $res['subcat']; } ?>
-
He wants to process the form when you press the enter key inside a textarea. By default a new line will be entered when you press enter in a textarea. It sounds more like he is using inputs, not textareas. If you try to do this with a textarea, you will only succeed in pissing people off. Don't break basic functionality. nogray is correct on the current functionality.
-
If you look at the docs you can see that you are assigning $row to a variable which is NOT an array. http://www.smarty.net/docs/en/language.syntax.variables.tpl You need to have categories be an array, I'd suggest reviewing that page.
-
1. I would check if those two fields are submitted. 2. Yes you can add a hidden input. 3. you add a class and id to a button the same way you do to an <a>.
-
Is there a reason you're unable to spell my name correctly? If it's taking that long, why don't you just do a page per letter or something, instead of splitting it up by groups of X
-
I don't get why you have a link and a button. Apparently in IE <8, if you hit enter instead of clicking the button it does not post the button. Check if one of your other values is submitted instead of the button.
-
I still don't understand what you're asking then. Once you've constructed your form, try filling it out and submitting, then print_r($_POST) and you can see exactly what gets posted.
-
There's the problem. Did you use any other tool to create or upload the file? It looks like it got edited in the wrong format.
-
I don't get what your code has to do with what you said. You can use a combo of implode and explode, or just concat the new value. $values .= ',white';
-
So you know what the names should be, when you go to process that form, again select the desired column names just like you did here, and loop through them to process them.
-
Are you using any kind of website creator program like Dreamweaver etc? If you open the sendmail.php file in notepad does it show <?php or something else?
-
Thanks, I had never heard that before. I've also not experienced that. Personally rather than using a hidden input, I would just check for any other field (except a checkbox). If you have a text field, even if it's empty it should be in the submitted POST array. Unless there's an IE bug about that too?
-
Right now, what does the code look like that generates the dynamic form based on their desired column names?
-
if you upload a file with this: <?php phpinfo(); ?> and browse to it, what do you see?
-
Sorry, where are you stuck? I reread your post and I don't understand at what step in the process you are stuck. Break it down into simple 1 sentence steps for me.
-
you're welcome! Mark as solved!