PHP with bootstrap delete subject :'(

3 replies
Hi,
I have a problem when I want to delete a subject from admin panel,
If I click in Delete button that show a modal that see Are you want to delete this ?
the problem if I click YES the code delete Other subject :'(
this my code :'(

#bootstrap #delete #php #subject
  • Profile picture of the author element121
    Can you share the full page of code?
    {{ DiscussionBoard.errors[10600553].message }}
  • Profile picture of the author Duc Aaron
    Copy and paste your code in projectslist.php?delpro=xxx
    {{ DiscussionBoard.errors[10600798].message }}
  • Profile picture of the author noah.whitmore
    As others have said, it's tough to really narrow anything down with only a bit of code. However, just from looking at what you posted here, it seems that when you visit the script 'projetslist.php' it will delete a project based on what you add to the parameter 'delpro'.

    So, from what I can see, if you visit 'projetslist.php?delpro=12' it looks like the project with id 12 will be deleted.

    You seem to be loading the project id from the PHP variable $rows['idprojets']. I see that variable used twice in the code that you posted. I see it once near the top

    Code:
    <td><a href="http://www.warriorforum.com/projet?project_id='.$rows['idprojets'].'" target="_blank" class="btn btn-info btn-xs
    and then once inside your dialog

    Code:
    <a href="projetslist.php?delpro='.$rows['idprojets'].'" class="btn btn-danger" >Oui</a>

    Since the same variable is used in both places, both links reference the same project ID. So, without knowing much more about the rest of the code, I would bet that's where the issue lies. Maybe the first place where the variable is used, it is correct. But, maybe the second time, the link should not use the same PHP variable.

    Again, go ahead and post your full code and our answers will probably be more helpful.
    Signature
    No Pitch For The Moment - Just A Nice Hello.
    So... 'Hello'
    Feel free to PM me if you have any questions about my posts. I'd like to hear from you!
    {{ DiscussionBoard.errors[10600962].message }}

Trending Topics